35 www.national.com
of the program. It is the interrupt service routine associated
with the wake-up source (MIWU or NMI) that causes actual
program execution to resume.
10.5.1 Power Management Control/Status Register
(PMCSR)
The Power Management Control/Status Register (PMCSR)
is a byte-wide, read/write register that controls the operating
power mode (Active, Power Save, Idle, or Halt) and enables
or disables the high-frequency oscillator in the Power Save
and Idle modes. The two most significant bits, OLFC and
OHFC, are read-only status bits controlled by the hardware.
Upon reset, the non-reserved bits of this register are cleared.
The format of the register is shown below.
PSM Power Save Mode. When this bit is 0, the de-
vice operates in the Active mode. Writing a 1 to
this bit position puts the device into the Power
Save mode, either immediately or upon execu-
tion of the next WAIT instruction, depending on
the WBPSM bit.
The PSM bit can be set and cleared by the soft-
ware. It is also cleared by the hardware when a
hardware wake-up event is detected.
DHF Disable High-Frequency Oscillator. This bit en-
ables (0) or disables (1) the high-frequency os-
cillator in the Power Save or Idle mode. (The
high-frequency oscillator is always enabled in
Active mode and always disabled in Halt mode,
regardless of this bit settings.) The DHF bit is
cleared automatically when a hardware wake-
up event is detected.
IDLE Idle Mode. When this bit is set, the device en-
ters the Idle mode upon execution of a WAIT in-
struction. In order to enter the Idle mode from
the Active mode, the WBPSM bit must be set
before the WAIT instruction is executed.
The IDLE bit can be set and cleared by the soft-
ware. When a hardware wake-up event is de-
tected, this bit is cleared automatically and the
device returns to the Active mode.
HALT Halt Mode. When this bit is set, the device en-
ters the Halt mode upon execution of a WAIT
instruction. In order to enter the Halt mode from
the Active mode, the WBPSM bit must be set
before the WAIT instruction is executed.
The Halt bit can be set and cleared by the soft-
ware. When a hardware wake-up event is de-
tected, this bit is cleared automatically and the
device returns to the Active mode.
WBPSM Wait Before Entering Power Save Mode. When
the CPU writes a 1 to the PSM bit, the WBPSM
determines when the transition from Active to
Power Save mode is done. If the WBPSM bit is
0, the switch to Power Save mode is initiated
immediately; the PSM bit in the register is set
to 1 upon completion of the switch to Power
Save mode. If the WBPSM bit is 1, the device
continues to operate in Active mode until the
next WAIT instruction, and then enters the
Power Save mode. In this case, the PSM bit is
set to 1 immediately, even if a WAIT instruction
has not yet been executed.
In the Active mode, the WBPSM bit must be set
in order to enter the Idle or Halt mode.
OHFC Oscillating High-Frequency Clock. This read-
only bit indicates the status of the high-frequen-
cy clock. If this bit is 1, the high-frequency clock
is available and stable. If this bit is 0, the high-
frequency clock is either disabled, not available
to the Power Management Module, or operat-
ing but not yet stable. The device can switch to
the Active mode only when this bit is 1.
OLFC Oscillating Low-Frequency Clock. This read-
only bit indicates the status of the low-frequen-
cy (slow) clock. If this bit is 1, it indicates that
the slow clock is running and stable. The slow
clock can be either the prescaled fast clock (the
default) or the external oscillator (if selected).
The Dual Clock module will not allow a transi-
tion to the slow crystal mode unless the slow
crystal is operating, so this bit should be 1 un-
der normal circumstances.
The OLFC bit is the multiplexed and sampled
output of the “Good Main Clk” and “Good Low
Speed Clk” indicator signals. These values are
determined at reset or power-up, and then se-
lected according to the programmed slow clock
source.
The device can switch from the Active mode to
the Power Save or Idle mode only if the OLFC
bit is 1. (There is no such restriction on switch-
ing to the Halt mode.)
10.5.2 Active to Power Save Mode
A transition from the Active mode to the Power Save mode is
accomplished by writing a 1 to the PMCSR.PSM bit. The
transition to Power Save mode is either initiated immediately
or upon execution of the next WAIT instruction, depending on
the PMCSR.WBPSM bit.
For an immediate transition to Power Save mode (PMC-
SR.WBPSM=0), the CPU continues to operate using the low-
frequency clock. The PMCSR.PSM bit is set to 1 when the
transition to the Power Save mode is completed.
For a transition upon the next WAIT instruction (PMC-
SR.WBPSM=1), the CPU continues to operate in the Active
mode until it executes a WAIT instruction. Upon execution of
the WAIT instruction, the device enters the Power Save
mode and the CPU waits for the next interrupt event. In this
case, the PMCSR.PSM bit is set to 1 when it is written, even
before the WAIT instruction is executed.
10.5.3 Entering the Idle Mode
Entry into the Idle mode is accomplished by writing a 1 to the
PMCSR.IDLE bit and then executing a WAIT instruction.
The Idle mode can be entered only from the Active or Power
Save mode. For entry from the Active mode, the PMC-
SR.WBPSM bit must be set before the WAIT instruction is
executed.
7 6 5 4 3 2 1 0
OLFC OHFC WBPSM Reserved HALT IDLE DHF PSM