Datasheet

2009-2011 Microchip Technology Inc. DS39957D-page 45
PIC18F87K90 FAMILY
3.3 Clock Sources and
Oscillator Switching
Essentially, PIC18F87K90 family devices have these
independent clock sources:
Primary oscillators
Secondary oscillators
Internal oscillator
The primary oscillators can be thought of as the main
device oscillators. These are any external oscillators
connected to the OSC1 and OSC2 pins, and include
the External Crystal and Resonator modes and the
External Clock modes. If selected by the OSC<3:0>
Configuration bits (CONFIG1H<3:0>), the internal
oscillator block may be considered a primary oscillator.
The internal oscillator block can be one of the following:
31 kHz LF-INTRC source
31 kHz to 500 kHz MF-INTOSC source
31 kHz to 16 MHz HF-INTOSC source
The particular mode is defined by the OSC
Configuration bits. The details of these modes are
covered in Section 3.4 “External Oscillator Modes”.
The secondary oscillators are external clock
sources that are not connected to the OSC1 or OSC2
pin. These sources may continue to operate, even
after the controller is placed in a power-managed
mode. PIC18F87K90 family devices offer the SOSC
(Timer1/3/5/7) oscillator as a secondary oscillator
source. This oscillator, in all power-managed modes, is
often the time base for functions, such as a Real-Time
Clock (RTC).
The SOSCEN bit in the corresponding timer should be
set correctly for the enabled SOSC. The
SOSCEL<1:0> bits (CONFIG1L<4:3>) decide the
SOSC mode of operation:
11 = High-power SOSC circuit
10 = Digital (SCLKI) mode
01 = Low-power SOSC circuit
In addition to being a primary clock source in some
circumstances, the internal oscillator is available as a
power-managed mode clock source. The LF-INTOSC
source is also used as the clock source for several
special features, such as the WDT and Fail-Safe Clock
Monitor. The internal oscillator block is discussed in
more detail in Section 3.6 “Internal Oscillator
Block”.
The PIC18F87K90 family includes features that allow
the device clock source to be switched from the main
oscillator, chosen by device configuration, to one of the
alternate clock sources. When an alternate clock
source is enabled, various power-managed operating
modes are available.
REGISTER 3-3: OSCTUNE: OSCILLATOR TUNING REGISTER
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
INTSRC PLLEN TUN5 TUN4 TUN3 TUN2 TUN1 TUN0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7 INTSRC: Internal Oscillator Low-Frequency Source Select bit
1 = 31.25 kHz device clock is derived from 16 MHz INTOSC source (divide-by-512 enabled, HF-INTOSC)
0 = 31 kHz device clock is derived from INTRC 31 kHz oscillator (LF-INTOSC)
bit 6 PLLEN: Frequency Multiplier PLL Enable bit
1 = PLL is enabled
0 = PLL is disabled
bit 5-0 TUN<5:0>: Fast RC Oscillator (INTOSC) Frequency Tuning bits
011111 = Maximum frequency
000001
000000 = Center frequency. Fast RC oscillator is running at the calibrated frequency.
111111
100000 = Minimum frequency