Datasheet

2010 Microchip Technology Inc. DS41303G-page 27
PIC18F2XK20/4XK20
2.0 OSCILLATOR MODULE (WITH
FAIL-SAFE CLOCK MONITOR)
2.1 Overview
The Oscillator module has a wide variety of clock
sources and selection features that allow it to be used
in a wide range of applications while maximizing perfor-
mance and minimizing power consumption. Figure 2-1
illustrates a block diagram of the Oscillator module.
Clock sources can be configured from external
oscillators, quartz crystal resonators, ceramic resonators
and Resistor-Capacitor (RC) circuits. In addition, the
system clock source can be configured from one of two
internal oscillators, with a choice of speeds selectable via
software. Additional clock features include:
Selectable system clock source between external
or internal via software.
Two-Speed Start-up mode, which minimizes
latency between external oscillator start-up and
code execution.
Fail-Safe Clock Monitor (FSCM) designed to
detect a failure of the external clock source (LP,
XT, HS, EC or RC modes) and switch
automatically to the internal oscillator.
The Oscillator module can be configured in one of ten
primary clock modes.
1. LP Low-Power Crystal
2. XT Crystal/Resonator
3. HS High-Speed Crystal/Resonator
4. HSPLL High-Speed Crystal/Resonator
with PLL enabled
5. RC External Resistor/Capacitor with
F
OSC/4 output on RA6
6. RCIO External Resistor/Capacitor with I/O
on RA6
7. INTOSC Internal Oscillator with F
OSC/4
output on RA6 and I/O on RA7
8. INTOSCIO Internal Oscillator with I/O on RA6
and RA7
9. EC External Clock with F
OSC/4 output
10. ECIO External Clock with I/O on RA6
Primary Clock modes are selected by the FOSC<3:0>
bits of the CONFIG1H Configuration Register. The
HFINTOSC and LFINTOSC are factory calibrated high-
frequency and low-frequency oscillators, respectively,
which are used as the internal clock sources.
FIGURE 2-1: PIC
®
MCU CLOCK SOURCE BLOCK DIAGRAM
4 x PLL
FOSC<3:0>
Secondary Oscillator
T1OSCEN
Enable
Oscillator
T1OSO
T1OSI
Clock Source Option
for other Modules
OSC1
OSC2
Sleep
HSPLL, HFINTOSC/PLL
LP, XT, HS, RC, EC
T1OSC
CPU
Peripherals
IDLEN
Postscaler
MUX
MUX
16 MHz
8 MHz
4 MHz
2 MHz
1 MHz
250 kHz
500 kHz
OSCCON<6:4>
111
110
101
100
011
010
001
000
31 kHz
31 kHz
Source
Internal
Oscillator
Block
WDT, PWRT, FSCM
16 MHz
Internal Oscillator
(HFINTOSC)
Clock
Control
OSCCON<1:0>
Source
16 MHz
31 kHz (LFINTOSC)
OSCTUNE<6>
(1)
0
1
OSCTUNE<7>
and Two-Speed Start-up
Primary Oscillator
PIC18F2XK20/4XK20
Sleep
Sleep
Main
FOSC<3:0> OSCCON<1:0>
Note 1: Operates only when HFINTOSC is the primary oscillator.