PIC18F46J50 FAMILY
DS39931D-page 42
2011 Microchip Technology Inc.
3.4
USB From INTOSC
The 8 MHz INTOSC included in all PIC18F46J50 family
devices is extremely accurate. When the 8 MHz
INTOSC is used with the 96 MHz PLL, it may be used
to derive the USB module clock. The high accuracy of
the INTOSC will allow the application to meet
low-speed USB signal rate specifications.
3.5
Clock Sources and Oscillator
Switching
Like
previous
PIC18
enhanced
devices,
the
PIC18F46J50 family includes a feature that allows the
device clock source to be switched from the main
oscillator to an alternate, low-frequency clock source.
PIC18F46J50 family devices offer two alternate clock
sources. When an alternate clock source is enabled,
the various power-managed operating modes are
available.
Essentially, there are three clock sources for these
devices:
Primary Oscillators
Secondary Oscillators
Internal Oscillator Block
The Primary Oscillators include the External Crystal
and Resonator modes, the External Clock modes and
the internal oscillator block. The particular mode is
defined by the FOSC<2:0> Configuration bits. The
details of these modes are covered earlier in this
chapter.
The Secondary Oscillators are external sources that
are not connected to the OSC1 or OSC2 pins. These
sources may continue to operate even after the
controller is placed in a power-managed mode.
PIC18F46J50 family devices offer the Timer1 oscillator
as a secondary oscillator. This oscillator, in all
power-managed modes, is often the time base for
functions, such as a Real-Time Clock (RTC). Most often,
a 32.768 kHz watch crystal is connected between the
RC0/T1OSO/T1CKI/RP11 and RC1/T1OSI/UOE/RP12
pins. Like the HS Oscillator mode circuits, loading
capacitors are also connected from each pin to ground.
The Timer1 oscillator is discussed in larger detail in
In addition to being a primary clock source, the
postscaled
internal
clock
is available as a
power-managed mode clock source. The INTRC
source is also used as the clock source for several
special features, such as the WDT and Fail-Safe Clock
Monitor (FSCM).
3.5.1
OSCILLATOR CONTROL REGISTER
aspects of the device clock’s operation, both in
full-power operation and in power-managed modes.
The System Clock Select bits, SCS<1:0>, select the
clock source. The available clock sources are the
primary clock (defined by the FOSC<2:0> Configura-
tion bits), the secondary clock (Timer1 oscillator) and
the postscaled internal clock.The clock source changes
immediately, after one or more of the bits is written to,
following a brief clock transition interval. The SCS bits
are cleared on all forms of Reset.
The Internal Oscillator Frequency Select bits,
IRCF<2:0>, select the frequency output provided on
the postscaled internal clock line. The choices are the
INTRC source, the INTOSC source (8 MHz) or one of
the frequencies derived from the INTOSC postscaler
(31 kHz to 4 MHz). If the postscaled internal clock is
supplying the device clock, changing the states of
these bits will have an immediate change on the inter-
nal oscillator’s output. On device Resets, the default
output frequency of the INTOSC postscaler is set at
4MHz.
When an output frequency of 31 kHz is selected
(IRCF<2:0> = 000), users may choose the internal
oscillator, which acts as the source. This is done with
the
INTSRC
bit
in
the
OSCTUNE
register
(OSCTUNE<7>). Setting this bit selects INTOSC as a
31.25 kHz clock source by enabling the divide-by-256
output of the INTOSC postscaler. Clearing INTSRC
selects INTRC (nominally 31 kHz) as the clock source.
This option allows users to select the tunable and more
precise INTOSC as a clock source, while maintaining
power savings with a very low clock speed. Regardless
of the setting of INTSRC, INTRC always remains the
clock source for features such as the WDT and the
FSCM.
The OSTS and T1RUN bits indicate which clock source
is currently providing the device clock. The OSTS bit
indicates that the Oscillator Start-up Timer (OST) has
timed out and the primary clock is providing the device
clock in primary clock modes. The T1RUN bit
(T1CON<6>) indicates when the Timer1 oscillator is
providing the device clock in secondary clock modes.
In power-managed modes, only one of these bits will
be set at any time. If none of these bits are set, the
INTRC is providing the clock or the internal oscillator
block has just started and is not yet stable.
The IDLEN bit determines if the device goes into Sleep
mode, or one of the Idle modes, when the SLEEP
instruction is executed.