Microchip Technology MA160014 Data Sheet

Page of 560
PIC18(L)F2X/4XK22
DS41412E-page 36
 2010-2012 Microchip Technology Inc.
2.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.
2.5.4.1
RC Mode
In RC mode, the RC circuit connects to OSC1. OSC2/
CLKOUT outputs the RC oscillator frequency divided
by four. This signal may be used to provide a clock for
external circuitry, synchronization, calibration, test or
other application requirements. 
 shows the
external RC mode connections.
FIGURE 2-8:
EXTERNAL RC MODES 
2.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 (C
EXT
) 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.6
Internal Clock Modes
The oscillator module has three 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 (
).
2.
The  MFINTOSC (Medium-Frequency Internal
Oscillator) is factory calibrated and operates
at 500 kHz. The frequency of the MFINTOSC
can be user-adjusted via software using the
OSCTUNE register (
). 
3.
The 
LFINTOSC (Low-Frequency Internal
Oscillator) is factory calibrated and operates at
31.25 kHz. The LFINTOSC 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 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
 for more information.
2.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/CLKOUT/
RA7 will be configured as general purpose I/O (RA7) or
F
OSC
/4 (CLKOUT). In both modes, OSC1/CLKIN/RA7
is configured as general purpose I/O. See
 for more
information.
The CLKOUT signal may be used to provide a clock for
external circuitry, synchronization, calibration, test or
other application requirements.
OSC2/CLKOUT
(1)
C
EXT
R
EXT
PIC
®
 MCU
OSC1/CLKIN
F
OSC
/4 or
Internal
Clock
V
DD
V
SS
Recommended values: 10 k
  R
EXT
 
 100 k
C
EXT
 > 20 pF
Note
1:
Alternate pin functions are listed in 
2:
Output depends upon RC or RCIO clock mode.
I/O
(2)