Datasheet

2009-2011 Microchip Technology Inc. DS41365E-page 13
PIC18(L)F1XK22
2.0 OSCILLATOR MODULE
2.1 Overview
The oscillator module has a variety of clock sources
and features that allow it to be used in a wide range of
applications, maximizing performance and minimizing
power consumption. Figure 2-1 illustrates a block
diagram of the oscillator module.
Key features of the oscillator module include:
•System Clocks
System Clock Selection
- Primary External Oscillator
- Secondary External Oscillator
- Internal Oscillator
Oscillator Start-up Timer
System Clock Selection
Clock Switching
4x Phase Lock Loop Frequency Multiplier
CPU Clock Divider
Two-Speed Start-up Mode
Fail-Safe Clock Monitoring
2.2 System Clocks
The PIC18(L)F1XK22 can be operated in 13 different
oscillator modes. The user can program these using
the available Configuration bits. In addition, clock sup-
port functions such as Fail-Safe and two Start-up can
also be configured.
The available Primary oscillator options include:
External Clock, low power (ECL)
External Clock, medium power (ECM)
External Clock, high power (ECH)
External Clock, low power, CLKOUT function on
RA4/OSC2 (ECCLKOUTL)
External Clock, medium power, CLKOUT function
on RA4/OSC2 (ECCLKOUTM)
External Clock, high power, CLKOUT function on
RA4/OSC2 (ECCLKOUTH)
•External Crystal (XT)
High-speed Crystal (HS)
Low-power crystal (LP)
External Resistor/Capacitor (EXTRC)
External RC, CLKOUT function on RA4/OSC2
31.25 kHz – 16 MHz internal oscillator (INTOSC)
31.25 kHz – 16 MHz internal oscillator, CLKOUT
function on RA4/OSC2
Additionally, the 4xPLL may be enabled in hardware or
software (under certain conditions) for increased oscil-
lator speed.
2.3 System Clock Selection
The SCS bits of the OSCCON register select between
the following clock sources:
Primary External Oscillator
Secondary External Oscillator
Internal Oscillator
TABLE 2-1: SYSTEM CLOCK SELECTION
The default state of the SCS bits sets the system clock
to be the oscillator defined by the FOSC bits of the
CONFIG1H Configuration register. The system clock
will always be defined by the FOSC bits until the SCS
bits are modified in software.
When the Internal Oscillator is selected as the system
clock, the IRCF bits of the OSCCON register and the
INTSRC bit of the OSCTUNE register will select either
the LFINTOSC or the HFINTOSC. The LFINTOSC is
selected when the IRCF<2:0> = 000 and the INTSRC
bit is clear. All other combinations of the IRCF bits and
the INTSRC bit will select the HFINTOSC as the
system clock.
2.4 Primary External Oscillator
The Primary External Oscillator’s mode of operation is
selected by setting the FOSC<3:0> bits of the
CONFIG1H Configuration register. The oscillator can
be set to the following modes:
LP: Low-Power Crystal
XT: Crystal/Ceramic Resonator
HS: High-Speed Crystal Resonator
RC: External RC Oscillator
EC: External Clock
Additionally, the Primary External Oscillator may be
shut-down under firmware control to save power.
Note: The frequency of the system clock will be
referred to as F
OSC throughout this
document.
Configuration Selection
SCS <1:0> System Clock
1x Internal Oscillator
01 Secondary External Oscillator
00
(Default after Reset)
Oscillator defined by
FOSC<3:0>