English
Language : 

PIC18F23K20 Datasheet, PDF (27/420 Pages) Microchip Technology – 28/40/44-Pin Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology
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
FOSC/4 output on RA6
6. RCIO
External Resistor/Capacitor with I/O
on RA6
7. INTOSC Internal Oscillator with FOSC/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 FOSC/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
OSC2
OSC1
T1OSO
T1OSI
Primary Oscillator
PIC18F2XK20/4XK20
LP, XT, HS, RC, EC
Sleep
OSCTUNE<6>(1)
Secondary Oscillator
4 x PLL HSPLL, HFINTOSC/PLL
T1OSC
IDLEN
Sleep
Main
Peripherals
T1OSCEN
Enable
Oscillator
FOSC<3:0> OSCCON<1:0>
Internal
Oscillator
Block
16 MHz
Source
31 kHz
Source
16 MHz
(HFINTOSC)
31 kHz (LFINTOSC)
OSCCON<6:4>
16 MHz
111
8 MHz
110
4 MHz
101
2 MHz
100
1 MHz
011
500 kHz
010
250 kHz
001
1 31 kHz
000
0
OSCTUNE<7>
Internal Oscillator
Sleep
Clock
Control
CPU
FOSC<3:0> OSCCON<1:0>
Clock Source Option
for other Modules
WDT, PWRT, FSCM
and Two-Speed Start-up
Note 1: Operates only when HFINTOSC is the primary oscillator.
© 2007 Microchip Technology Inc.
Advance Information
DS41303B-page 25