English
Language : 

PIC18F23K22 Datasheet, PDF (34/492 Pages) Microchip Technology – 28/40/44-Pin, Low-Power, High-Performance Microcontrollers with nanoWatt XLP Technology
PIC18(L)F2X/4XK22
2.3 Clock Source Modes
Clock Source modes can be classified as external or
internal.
• External Clock modes rely on external circuitry for
the clock source. Examples are: Clock modules
(EC mode), quartz crystal resonators or ceramic
resonators (LP, XT and HS modes) and Resistor-
Capacitor (RC mode) circuits.
• Internal clock sources are contained internally
within the Oscillator block. The Oscillator block
has three internal oscillators: the 16 MHz High-
Frequency Internal Oscillator (HFINTOSC),
500 kHz Medium-Frequency Internal Oscillator
(MFINTOSC) and the 31.25 kHz Low-Frequency
Internal Oscillator (LFINTOSC).
The system clock can be selected between external or
internal clock sources via the System Clock Select
(SCS<1:0>) bits of the OSCCON register. See
Section 2.9 “Clock Switching” for additional
information.
2.4 External Clock Modes
2.4.1 OSCILLATOR START-UP TIMER (OST)
When the oscillator module is configured for LP, XT or
HS modes, the Oscillator Start-up Timer (OST) counts
1024 oscillations from OSC1. This occurs following a
Power-on Reset (POR) and when the Power-up Timer
(PWRT) has expired (if configured), or a wake-up from
Sleep. During this time, the program counter does not
increment and program execution is suspended. The
OST ensures that the oscillator circuit, using a quartz
crystal resonator or ceramic resonator, has started and
is providing a stable system clock to the oscillator
module. When switching between clock sources, a
delay is required to allow the new clock to stabilize.
These oscillator delays are shown in Table 2-2.
In order to minimize latency between external oscillator
start-up and code execution, the Two-Speed Clock
Start-up mode can be selected (see Section 2.10
“Two-Speed Clock Start-up Mode”).
TABLE 2-2: OSCILLATOR DELAY EXAMPLES
Switch From
Switch To
Frequency
Sleep/POR
Sleep/POR
LFINTOSC (31.25 kHz)
Sleep/POR
Sleep/POR
LFINTOSC (31.25 kHz)
LFINTOSC
MFINTOSC
HFINTOSC
EC, RC
EC, RC
LP, XT, HS
4xPLL
LFINTOSC
HFINTOSC
31.25 kHz
31.25 kHz to 500 kHz
31.25 kHz to 16 MHz
DC – 64 MHz
DC – 64 MHz
32 kHz to 40 MHz
32 MHz to 64 MHz
31.25 kHz to 16 MHz
Oscillator Delay
Oscillator Warm-Up Delay (TWARM)
2 instruction cycles
1 cycle of each
1024 Clock Cycles (OST)
1024 Clock Cycles (OST) + 2 ms
1 s (approx.)
2.4.2 EC MODE
The External Clock (EC) mode allows an externally
generated logic level as the system clock source. When
operating in this mode, an external clock source is
connected to the OSC1 input and the OSC2 is available
for general purpose I/O. Figure 2-5 shows the pin
connections for EC mode.
The External Clock (EC) mode offers a Medium Power
(MP) and a High Power (HP) option selectable by the
FOSC<3:0> bits. The MP selections are best suited for
external clock frequencies between 4 and 16 MHz. The
HP selection is best suited for clock frequencies above
16 MHz.
The Oscillator Start-up Timer (OST) is disabled when
EC mode is selected. Therefore, there is no delay in
operation after a Power-on Reset (POR) or wake-up
from Sleep. Because the PIC® MCU design is fully
static, stopping the external clock input will have the
effect of halting the device while leaving all data intact.
Upon restarting the external clock, the device will
resume operation as if no time had elapsed.
FIGURE 2-5:
EXTERNAL CLOCK (EC)
MODE OPERATION
Clock from
Ext. System
I/O
OSC1/CLKIN
PIC® MCU
OSC2/CLKOUT(1)
Note 1: Alternate pin functions are listed in
Section 1.0 “Device Overview”.
DS41412B-page 34
Preliminary
 2010 Microchip Technology Inc.