Hi guys. I changed my board to C8051F226 already and i'm using a 32.768kHz external crystal. I have read the datasheet for the oscillator. But i do not understand this sentence, can someone please explain it to me?
"Crystal Oscillator Mode with divide by 2 stage."
The datasheet also recommend me to do the following:
1.Enable the external oscillator 2.Wait 1 ms 3.Poll for XTLVLD '0' ==> '1' 4.Switch to the external oscillator
I have done the 1st 2 steps, but i can't seem to poll for XTLVLD. When i compile, it says undefined symbol.
your wait-loop is going to loop untill OSCICN equals exactly 0x80. you want to mask the other bits and then test for bit 7. You could do a 'bitwise AND' of 0x80 and OSCICN, if the value is not zero then bit 7 is set.
OSCXCN you mean? Can you explain it in simpler terms? I can't really get you.
Since OSCXCN is not bit-addressable you need to use a different method of testing bit7. You should learn about bitwise operations; en.wikipedia.org/.../Bitwise_operation