Reading the datasheet for the 16F690, it states that the default internal frequency on startup is 4Mhz. This device can run at 8Mhz using internal OSC. The register OSCCON can set the internal clock speed via IRCF<2:0> to a full 8Mhz.
So, the question is, what does one set in the Basic compiler as Clock_Frequency? If I set it to 8Mhz, but do not set OSCCON, all the timing loops (WaitMS) will assume 8Mhz, but power on default will be 4Mhz.
If I set Clock_Frequency to 4Mhz, but set OSCCON to run at 8Mhz, everything will be too short in timing.
Should the compiler not set OSCCON bits as part of the initialization routine when checking the config bits (INTOSCIO) and the speed is set in the Basic code? Is this a "wish list" item? What is the point of having Define Clock_Frequency if it does not actually try to set the OSCCON register?
I realize I can fix all this by defining Clock_Frequency = 8 and setting OSCCON to 0x71 at the first line of code. Or, am I mis-interpreting the 16F690 datasheet somehow?
Or, am I not understanding the purpose of Clock_Frequency definition in the compiler? (I know it sets the timing loop counters)
Any input would be appreciated... Early learning user...
So, the question is, what does one set in the Basic compiler as Clock_Frequency? If I set it to 8Mhz, but do not set OSCCON, all the timing loops (WaitMS) will assume 8Mhz, but power on default will be 4Mhz.
If I set Clock_Frequency to 4Mhz, but set OSCCON to run at 8Mhz, everything will be too short in timing.
Should the compiler not set OSCCON bits as part of the initialization routine when checking the config bits (INTOSCIO) and the speed is set in the Basic code? Is this a "wish list" item? What is the point of having Define Clock_Frequency if it does not actually try to set the OSCCON register?
I realize I can fix all this by defining Clock_Frequency = 8 and setting OSCCON to 0x71 at the first line of code. Or, am I mis-interpreting the 16F690 datasheet somehow?
Or, am I not understanding the purpose of Clock_Frequency definition in the compiler? (I know it sets the timing loop counters)
Any input would be appreciated... Early learning user...