Professional Documents
Culture Documents
OSC1
Primary PLL PLL
Oscillator x4, x8, x16
OSC2
Primary Osc
(2)
Primary
Oscillator
Stability Detector
Oscillator
POR Start-up
Timer Clock
Switching Programmable
Secondary Osc and Control Clock Divider
FOSC(1)
Block
SOSCO Secondary
Secondary
Oscillator Oscillator
SOSCI 32 kHz Stability Detector
to Timer1
Note 1: The system clock output, FOSC, is divided by 4 to get the instruction cycle clock.
2: Devices that feature VERSION 2 or VERSION 3 of the Oscillator System allow the internal FRC oscillator to be
connected to the PLL.
Oscillator
TCY
FOSC
FCY
PC PC PC + 2 PC + 4
Register 7-1: FOSC: Oscillator Configuration Register for Oscillator System VERSION 1
Upper Byte:
U U U U U U U U
— — — — — — — —
bit 23 bit 16
Middle Byte:
R/P R/P U U U U R/P R/P
FCKSM<1:0> — — — — FOS<1:0>
bit 15 bit 8 7
Lower Byte:
Oscillator
U U U U R/P R/P R/P R/P
— — — — FPR<3:0>
bit 7 bit 0
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit
Table 7-2: Oscillator System VERSION 1: Configuration Bit Values for Clock Selection
Oscillator OSC2 Pin
Oscillator Mode FOS<1:0> FPR<3:0>
Source Function
EC w/ PLL 16x Primary 1 1 1 1 1 1 I/O (Note 4)
EC w/ PLL 8x Primary 1 1 1 1 1 0 I/O
EC w/ PLL 4x Primary 1 1 1 1 0 1 I/O
ECIO Primary 1 1 1 1 0 0 I/O
EC Primary 1 1 1 0 1 1 FOSC/4
Reserved Primary 1 1 1 0 1 0 n/a
ERC Primary 1 1 1 0 0 1 FOSC/4
ERCIO Primary 1 1 1 0 0 0 I/O
XT w/ PLL 16x Primary 1 1 0 1 1 1 (Note 3)
XT w/ PLL 8x Primary 1 1 0 1 1 0 (Note 3)
XT w/ PLL 4x Primary 1 1 0 1 0 1 (Note 3)
XT Primary 1 1 0 1 0 0 (Note 3)
HS Primary 1 1 0 0 1 x (Note 3)
XTL Primary 1 1 0 0 0 x (Note 3)
LP Secondary 0 0 — — — — (Notes 1, 2)
FRC Internal 0 1 — — — — (Notes 1, 2)
LPRC Internal 1 0 — — — — (Notes 1, 2)
Note 1: OSC2 pin function is determined by the Primary Oscillator mode selection (FPR<3:0> Configuration bits).
2: Note that OSC1 pin cannot be used as an I/O pin, even if the Secondary oscillator or an internal clock
source is selected at all times.
3: In these Oscillator modes, a crystal is connected between the OSC1 and OSC2 pins.
4: This is the default Oscillator mode for an unprogrammed (erased) device. An unprogrammed Configuration
bit has a value of ‘1’.
5: XTL – XTL Crystal Oscillator mode (200 kHz-4 MHz crystal)
6: XT – XT Crystal Oscillator mode (4 MHz-10 MHz crystal)
7: HS – HS Crystal Oscillator mode (10 MHz-25 MHz crystal)
Oscillator
The OSCCON Control register provides control of clock switching and clock source status
information.
The COSC Status bits in OSCCON are read-only bits that indicate the oscillator source that the
device is operating from. The COSC bits are set to the FOS Configuration bit values at a
Power-on Reset and will change to indicate the new oscillator source at the end of a clock switch
operation.
The NOSC Status bits in OSCCON are control bits that select the new clock source for a clock
switch operation. The NOSC bits are set to the FOS Configuration bit values at a Power-on Reset
or Brown-out Reset and are modified by the user software during a clock switch operation.
The POST<1:0> control bits (OSCCON<8:7>) control the system clock divide ratio.
The LOCK Status bit (OSCCON<5>) is read-only and indicates the status of the PLL circuit.
The CF Status bit (OSCCON<3>) is a readable/writable Status bit that indicates a clock failure.
The LPOSCEN control bit (OSCCON<1>) is used to enable or disable the 32 kHz Low-Power
Crystal oscillator.
The OSWEN control bit (OSCCON<0>) is used to initiate a clock switch operation. The OSWEN
bit is cleared automatically after a successful clock switch.
The TUN<3:0> bits allow the user to tune the internal FRC oscillator to frequencies higher and
lower than the nominal value of 7.37 MHz.
Note: The OSCCON register is write-protected because it controls the device clock
switching mechanism. See Section 7.4.1 “Protection Against Accidental Writes
to OSCCON” for instructions on writing to OSCCON.
Lower Byte:
R/W-0 R/W-0 R-0 U-0 R/W-0 U-0 R/W-0 R/W-0
POST<1:0> LOCK — CF — LPOSCEN OSWEN
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
y = Value set from Configuration bits on POR or BOR