Datasheet
2012 Microchip Technology Inc. DS30684A-page 39
PIC18(L)F2X/45K50
3.5.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.
3.5.4.1 RC Mode
In RC mode, the RC circuit connects to OSC1. OSC2/
CLKO 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 3-7 shows the
external RC mode connections.
FIGURE 3-7: EXTERNAL RC MODES
3.5.4.2 RCIO Mode
In RCIO mode, the RC circuit is connected to OSC1.
OSC2 becomes a general purpose I/O pin.
The RC oscillator frequency is a function of the supply
voltage, the resistor (R
EXT) 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.
3.6 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 3-3).
2. The INTRC (Low-Frequency Internal Oscillator) is
factory calibrated and operates at 31.25 kHz. The
INTRC cannot be user-adjusted, but is designed to
be stable over temperature and voltage.
The system clock speed can be selected via software
using the Internal Oscillator Frequency select bits
IRCF<2:0> of the OSCCON register. The INTSRC bit
allows users to select which internal oscillator provides
the clock source for the 31.25 kHz frequency option.
This is covered in greater detail in Section 3.2.3 “Low-
Frequency Selection”.
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 3.11 “Clock Switching” for more information.
3.6.1 INTOSC WITH I/O OR CLOCKOUT
Two of the clock modes selectable with the
FOSC<3:0> bits of the CONFIG1H Configuration
register configure the internal oscillator block as the
primary oscillator. Mode selection determines
whether OSC2/CLKO/RA6 will be configured as
general purpose I/O (RA6) or F
OSC/4 (CLKO). In both
modes, OSC1/CLKIN/RA6 is configured as general
purpose I/O. See Section 26.0 “Special Features of
the CPU” for more information.
The CLKO signal may be used to provide a clock for
external circuitry, synchronization, calibration, test or
other application requirements.
OSC2/CLKO
(1)
CEXT
REXT
PIC
®
MCU
OSC1/CLKIN
F
OSC/4 or
Internal
Clock
VDD
VSS
Recommended values: 10 k REXT 100 k
C
EXT > 20 pF
Note 1: Alternate pin functions are listed in
Section 1.0 “Device Overview”.
2: Output depends upon RC or RCIO clock mode.
I/O
(2)