Here is a little know fact (not really) – On the PIC10F322 – If you are using the internal oscillator for the system clock – following any Reset, the IRCF<2:0> bits of the OSCCON register are set to ‘110’ and the frequency selection is set to 8 MHz.
That means, until you change the OSCCON Register INTOSC (FOSC) Frequency Select bits in software – the device is running at 8Mhz.
OSCCON: OSCILLATOR CONTROL REGISTER
bit 6-4 IRCF<2:0>: INTOSC (FOSC) Frequency Select bits
111 = 16 MHz
110 = 8 MHz (default value)
101 = 4 MHz
100 = 2 MHz
011 = 1 MHz
010 = 500 kHz
001 = 250 kHz
000 = 31 kHz (LFINTOSC)
The easiest way to change the system clock speed is by…
OSCCONbits.IRCF = 0bxxx (xxx) is the bit selection from the above list.
Say, you want to set it to the full 16Mhz.
OSCCONbits.IRCF = 0b111;
Maybe you want to go – 1 Mhz..
OSCCONbits.IRCF = 0b101;
Have a technology project in mind? Let’s talk!
Need a custom technology solution for your business? Please send me an email (firstname.lastname@example.org) to discuss your project needs.
I can help you get started on the road of building a simple and well-tested working solution, together, with your team.