Maker Pro
Maker Pro

Setting the internal Oscilator.

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
Hi All,

I wanted to do an experiment to see how accurate the internal oscilators on the (PIC12F683) are. This is mainly to reduce components in a project im working on. (as i tend to go for external clocks if accuracy is needed).

The datasheet for this pic mentions that it is possible to choose from 8 different clock speeds. From 8Mhz-125Khz - does anyone have any idea how to set this up?!

for instance how would i set the internal clock to run at 125Khz using only software (so no timing caps etc...) I imagine i would use the OSCCON register somehow...

Im currently working in C.

Any help - Greatly Appreciated.

Rob
 

rob_croxford

Aug 3, 2010
262
Joined
Aug 3, 2010
Messages
262
Its ok i have worked it out.

For anyone with the same problem....

You have to set the CONFIG parameter OSC to the Internal Oscillator. And the use the OSCCON register to set the frequency. For instance after setting the paramers setting the internal frequency to 125Khz:

OSCCON = 0x11;

Also the internal oscillators are not very accurate bellow 4Mhz (as a 1-2% difference from 4Mhz produces less of an innacuracy than at 125Khz).

Hope this helps anyone in the same situation as me!!
 
Last edited:
Top