Microchip Technology ARD00385 Data Sheet

Page of 570
 2009-2011 Microchip Technology Inc.
DS39957D-page 43
PIC18F87K90 FAMILY
3.2
Control Registers
The OSCCON register (
) controls the main
aspects of the device clock’s operation. It selects the
oscillator type to be used, which of the power-managed
modes to invoke and the output frequency of the
INTOSC source. It also provides status on the oscillators.
The OSCTUNE register (
) controls the
tuning and operation of the internal oscillator block. It also
implements the PLLEN bit which controls the operation of
the Phase Locked Loop (PLL) (see 
).
       
REGISTER 3-1:
OSCCON: OSCILLATOR CONTROL REGISTER
R/W-0
R/W-1
R/W-1
R/W-0
R
)
R-0
R/W-0
R/W-0
IDLEN
IRCF2
IRCF1
IRCF0
(
OSTS
HFIOFS
SCS1
)
SCS0
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
bit 7
IDLEN:
 Idle Enable bit
1
 = Device enters an Idle mode when a SLEEP instruction is executed
0
 = Device enters Sleep mode when a SLEEP instruction is executed
bit 6-4
IRCF<2:0>:
 Internal Oscillator Frequency Select bits
(
111
 = HF-INTOSC output frequency is used (16 MHz)
110
 = HF-INTOSC/2 output frequency is used (8 MHz, default)
101
 = HF-INTOSC/4 output frequency is used (4 MHz)
100
 = HF-INTOSC/8 output frequency is used (2 MHz)
011
 = HF-INTOSC/16 output frequency is used (1 MHz)
If INTSRC = 0 and MFIOSEL = 0:
)
 
010
 =  HF-INTOSC/32 output frequency is used (500 kHz)
001
 =  HF-INTOSC/64 output frequency is used (250 kHz)
000
 =  LF-INTOSC output frequency is used (31.25 kHz) 
If INTSRC = 1 and MFIOSEL = 0:
)
 
010
 =  HF-INTOSC/32 output frequency is used (500 kHz)
001
 =  HF-INTOSC/64 output frequency is used (250 kHz)
000
 =  HF-INTOSC/512 output frequency is used (31.25 kHz) 
If INTSRC = 0 and MFIOSEL = 1:
)
 
010
 =  MF-INTOSC output frequency is used (500 kHz)
001
 =  MF-INTOSC/2 output frequency is used (250 kHz)
000
 =  LF-INTOSC output frequency is used (31.25 kHz) 
If INTSRC = 1 and MFIOSEL = 1:
)
 
010
 =  MF-INTOSC output frequency is used (500 kHz)
001
 =  MF-INTOSC/2 output frequency is used (250 kHz)
000
 =  MF-INTOSC/16 output frequency is used (31.25 kHz) 
bit 3
OSTS:
 Oscillator Start-up Timer Time-out Status bit
(
)
1
 = Oscillator Start-up Timer (OST) time-out has expired: primary oscillator is running as defined by
OSC<3:0>
0
 = Oscillator Start-up Timer (OST) time-out is running: primary oscillator is not ready; device is
running from an internal oscillator (HF-INTOSC, MF-INTOSC or LF-INTOSC)
Note 1:
Reset state depends on the state of the IESO Configuration bit (CONFIG1H<7>).
2:
Modifying these bits will cause an immediate clock frequency switch if the internal oscillator is providing 
the device clocks.
3:
Source selected by the INTSRC bit (OSCTUNE<7>).
4:
Modifying these bits will cause an immediate clock source switch.
5:
INTSRC = OSCTUNE<7> and MFIOSEL = OSCCON2<0>.