Datasheet
PIC18F97J94 FAMILY
DS30575A-page 62 2012 Microchip Technology Inc.
3.13.4 ABANDONING A CLOCK SWITCH
In the event the clock switch does not complete, it can
be abandoned by setting the NOSCx bits to their previ-
ous values. This abandons the clock switch process,
stops and resets the OST (if applicable), and stops the
PLL (if applicable).
A clock switch procedure can be aborted at any time. A
clock switch that is already in progress can also be
aborted by performing a second clock switch.
3.13.5 ENTERING SLEEP MODE DURING
A CLOCK SWITCH
If the device enters Sleep mode during a clock switch
operation, the operation is abandoned. The processor
keeps the old clock selection and the NOSCx bits
return to their previous values (the same as COSC).
The SLEEP instruction is then executed normally.
3.14 Two-Speed Start-Up
Two-Speed Start-up is an automatic clock switching
feature that is independent of the manually controlled
clock switching previously described. It helps to mini-
mize the latency period, from oscillator start-up to code
execution, by allowing the microcontroller to use the
FRC Oscillator as a clock source until the primary clock
source is available. This feature is controlled by the
IESO Configuration bit (CONFIG2L<7>) and operates
independently of the state of the FSCM Configuration
bits.
Two-Speed Start-up is particularly useful when an
external oscillator is selected by the FOSCx Configura-
tion bits, and a crystal-based oscillator (either a
Primary or Secondary Oscillator) may have a longer
start-up time. As an internal RC Oscillator, the FRC
clock source is available almost immediately following
a POR or device wake-up.
With Two-Speed Start-up, the device starts executing
code on POR in its default oscillator configuration (FRC).
It continues to operate in this mode until the external
oscillator source, specified by the FOSCx Configuration
bits, becomes stable; at which time, it automatically
switches to that source.
Two-Speed Start-up is used on wake-up from the
power-saving Sleep mode. The device uses the FRC
clock source until the selected primary clock is ready. It is
not used in Idle mode, as the device will be clocked by the
currently selected clock source until the primary clock
source becomes available.
3.14.1 SPECIAL CONSIDERATIONS FOR
USING TWO-SPEED START-UP
While using the FRC Oscillator in Two-Speed Start-up,
the device still obeys the normal command sequences
for entering power-saving modes, including SLEEP
and IDLE instructions. In practice, this means that user
code can change the NOSC<2:0> bit settings or issue
#SLEEP instructions before the OST times out. This
would allow an application to briefly wake-up, perform
routine “housekeeping” tasks and return to Sleep
before the device starts to operate from the external
oscillator.
User code can also check which clock source is cur-
rently providing the device clocking by checking the
status of the COSC<2:0> bits against the NOSC<2:0>
bits. If these two sets of bits match, the clock switch has
been completed successfully and the device is running
from the intended clock source; the Primary Oscillator
is providing the clock. Otherwise, FRC is providing the
clock during wake-up from Reset or Sleep mode.
3.15 Reference Clock Output Module
(REFO1 and REFO2)
3.15.1 APPLICATIONS
The PIC18F97J94 family has two Reference Clock
Output modules. Each of the Reference Clock Output
modules provides the user with the ability to send out
a programmed output clock onto the REFO1or REFO2
pins.
3.15.2 REFERENCE CLOCK SOURCE
The module provides the ability to select one of the
following clock sources:
• Primary Crystal Oscillator (POSC)
• Secondary Crystal Oscillator (SOSC)
• 32.768 kHz Internal Oscillator (INTOSC)
• Fast Internal Oscillator (FRC)
• Raw System Clock (sys_clk)
• Peripheral Clock (p1_clk)
It includes a programmable clock divider with ratios
ranging from 1:1 to 1:65534.
When the clock source is a crystal or internal oscillator,
the RSLP bit (REFOxCON<3> can be set to continue
REFOx operation while the device is in Sleep Mode.