English
Language : 

PIC18F23K20_10 Datasheet, PDF (32/456 Pages) Microchip Technology – 28/40/44-Pin Flash Microcontrollers with nanoWatt XLP Technology
PIC18F2XK20/4XK20
2.4.4 EXTERNAL RC MODES
The external Resistor-Capacitor (RC) modes support
the use of an external RC circuit. This allows the
designer maximum flexibility in frequency choice while
keeping costs to a minimum when clock accuracy is not
required. There are two modes: RC and RCIO.
2.4.4.1 RC Mode
In RC mode, the RC circuit connects to OSC1. OSC2/
CLKOUT outputs the RC oscillator frequency divided
by 4. This signal may be used to provide a clock for
external circuitry, synchronization, calibration, test or
other application requirements. Figure 2-5 shows the
external RC mode connections.
FIGURE 2-5:
EXTERNAL RC MODES
VDD
REXT
CEXT
VSS
FOSC/4 or
I/O(2)
PIC® MCU
OSC1/CLKIN
Internal
Clock
OSC2/CLKOUT(1)
Recommended values: 10 k  REXT  100 k
CEXT > 20 pF
Note 1:
2:
Alternate pin functions are listed in
Section 1.0 “Device Overview”.
Output depends upon RC or RCIO clock mode.
2.4.4.2 RCIO Mode
In RCIO mode, the RC circuit is connected to OSC1.
OSC2 becomes an additional general purpose I/O pin.
The RC oscillator frequency is a function of the supply
voltage, the resistor (REXT) and capacitor (CEXT) values
and the operating temperature. Other factors affecting
the oscillator frequency are:
• input threshold voltage variation
• component tolerances
• packaging variations in capacitance
The user also needs to take into account variation due
to tolerance of external RC components used.
2.5 Internal Clock Modes
The Oscillator module has two independent, internal
oscillators that can be configured or selected as the
system clock source.
1. The HFINTOSC (High-Frequency Internal
Oscillator) is factory calibrated and operates at
16 MHz. The frequency of the HFINTOSC can
be user-adjusted via software using the
OSCTUNE register (Register 2-2).
2. The LFINTOSC (Low-Frequency Internal
Oscillator) operates at 31 kHz.
The system clock speed can be selected via software
using the Internal Oscillator Frequency Select bits
IRCF<2:0> of the OSCCON register.
The system clock can be selected between external or
internal clock sources via the System Clock Selection
(SCS<1:0>) bits of the OSCCON register. See
Section 2.9 “Clock Switching” for more information.
2.5.1 INTOSC AND INTOSCIO MODES
The INTOSC and INTOSCIO modes configure the
internal oscillators as the primary clock source. The
FOSC<3:0> bits in the CONFIG1H Configuration
register determine which mode is selected. See
Section 23.0 “Special Features of the CPU” for more
information.
In INTOSC mode, OSC1/CLKIN is available for general
purpose I/O. OSC2/CLKOUT outputs the selected
internal oscillator frequency divided by 4. The CLKOUT
signal may be used to provide a clock for external
circuitry, synchronization, calibration, test or other
application requirements.
In INTOSCIO mode, OSC1/CLKIN and OSC2/CLKOUT
are available for general purpose I/O.
2.5.2 HFINTOSC
The output of the HFINTOSC connects to a postscaler
and multiplexer (see Figure 2-1). One of eight
frequencies can be selected via software using the
IRCF<2:0> bits of the OSCCON register. See
Section 2.5.4 “Frequency Select Bits (IRCF)” for
more information.
The HFINTOSC is enabled when:
• SCS1 = 1 and IRCF<2:0>  000
• SCS1 = 1 and IRCF<2:0> = 000 and INTSRC = 1
• IESO bit of CONFIG1H = 1 enabling Two-Speed
Start-up.
• FCMEM bit of CONFIG1H = 1 enabling Two-
Speed Start-up and Fail-Safe mode.
• FOSC<3:0> of CONFIG1H selects the internal
oscillator as the primary clock
The HF Internal Oscillator (IOFS) bit of the OSCCON
register indicates whether the HFINTOSC is stable or not.
DS41303G-page 32
 2010 Microchip Technology Inc.