Datasheet
PICkit™ 3 Debug Express
DS41370C-page 56 © 2009 Microchip Technology Inc.
The IRFCx bits may be changed by software during program execution, allowing the
program to “throttle” the microcontroller execution speed to current processing needs.
This can save on power consumption when fast clock speeds aren’t required.
The OSTS and IOFS bits are read-only Status bits. The PIC18F45K20 has the option
to start-up running off the internal oscillator until an external oscillator circuit has
stabilized. This allows faster start-up of the microcontroller with external oscillators.
OSTS is used to alert the software when the clock source has switched over to the
external primary oscillator. This functionality is not covered further in this lesson.
The SCSx bits allow the software to switch the microcontroller clock source over to the
internal oscillator block even when an external oscillator has been selected in the
Configuration bits. The secondary oscillator may also be selected, which is the
low-speed low-power oscillator that is part of Timer1 and is usually run with a 32 kHz
crystal for Real-Time Clock (RTC) applications. In this lesson, the internal oscillator has
been selected as the primary oscillator in the Configuration bits, and SCS1:SCS0 = 00.
FIGURE 3-47: OSCTUNE: OSCILLATOR TUNING REGISTER
The 5 TUNx bits in OSCTUNE allow small adjustments in the INTOSC oscillator
frequency. This can be used to calibrate the frequency more accurately than the factory
calibration, and adjust for drift over V
DD and temperature changes.
The PLLEN bit enables the PLL, multiplying the INTOSC output by 4. Note that the PLL
may only be enabled for INTOSC = 8 MHz or INTOSC = 16 MHz. Enabling the PLL with
a 4 MHz base frequency gives a 16 MHz clock, and with a 16 MHz base frequency
gives 64 MHz.
For further information on the internal oscillator block, see Section 2.6 of the
PIC18F45K20 Data Sheet (DS41303).