Datasheet

2010 Microchip Technology Inc. DS39635C-page 45
PIC18F6310/6410/8310/8410
4.0 POWER-MANAGED MODES
PIC18F6310/6410/8310/8410 devices offer a total of
seven operating modes for more efficient power
management. These modes provide a variety of
options for selective power conservation in applications
where resources may be limited (i.e., battery-powered
devices).
There are three categories of power-managed modes:
Sleep mode
Idle modes
Run modes
These categories define which portions of the device
are clocked and sometimes, what speed. The Run and
Idle modes may use any of the three available clock
sources (primary, secondary or INTOSC multiplexer);
the Sleep mode does not use a clock source.
The power-managed modes include several
power-saving features. One of these is the clock
switching feature, offered in other PIC18 devices,
allowing the controller to use the Timer1 oscillator in
place of the primary oscillator. Also included is the
Sleep mode, offered by all PIC
®
devices, where all
device clocks are stopped.
4.1 Selecting Power-Managed Modes
Selecting a power-managed mode requires deciding if
the CPU is to be clocked or not and selecting a clock
source. The IDLEN bit controls CPU clocking, while the
SCS<1:0> bits select a clock source. The individual
modes, bit settings, clock sources and affected
modules are summarized in Tabl e 4 - 1.
4.1.1 CLOCK SOURCES
The SCS<1:0> bits allow the selection of one of three
clock sources for power-managed modes. They are:
The primary clock, as defined by the FOSC<3:0>
Configuration bits
The secondary clock (the Timer1 oscillator)
The internal oscillator block (for RC modes)
4.1.2 ENTERING POWER-MANAGED
MODES
Entering power-managed Run mode, or switching from
one power-managed mode to another, begins by
loading the OSCCON register. The SCS<1:0> bits
select the clock source and determine which Run or
Idle mode is being used. Changing these bits causes
an immediate switch to the new clock source,
assuming that it is running. The switch may also be
subject to clock transition delays. These are discussed
in Section 4.1.3 “Clock Transitions and Status
Indicators” and subsequent sections.
Entry to the power-managed Idle or Sleep modes is
triggered by the execution of a SLEEP instruction. The
actual mode that results depends on the status of the
IDLEN bit.
Depending on the current mode and the mode being
switched to, a change to a power-managed mode does
not always require setting all of these bits. Many transi-
tions may be done by changing the oscillator select
bits, or changing the IDLEN bit prior to issuing a SLEEP
instruction. If the IDLEN bit is already configured
correctly, it may only be necessary to perform a SLEEP
instruction to switch to the desired mode.
TABLE 4-1: POWER-MANAGED MODES
Mode
OSCCON<7,1:0> Bits Module Clocking
Available Clock and Oscillator Source
IDLEN
(1)
SCS<1:0> CPU Peripherals
Sleep 0 N/A Off Off None – All clocks are disabled.
PRI_RUN N/A 00 Clocked Clocked Primary – LP, XT, HS, HSPLL, RC, EC, INTRC
(2)
This is the normal Full-Power Execution mode
SEC_RUN N/A 01 Clocked Clocked Secondary – Timer1 Oscillator
RC_RUN N/A 1x Clocked Clocked Internal Oscillator Block
(2)
PRI_IDLE 100Off Clocked Primary – LP, XT, HS, HSPLL, RC, EC
SEC_IDLE 101Off Clocked Secondary – Timer1 Oscillator
RC_IDLE 11xOff Clocked Internal Oscillator Block
(2)
Note 1: IDLEN reflects its value when the SLEEP instruction is executed.
2: Includes INTOSC and INTOSC postscaler, as well as the INTRC source.