
December 22, 2003
Document No. 38-12011 Rev. *E
75
12.
Sleep and Watchdog
This chapter discusses the Sleep and Watchdog operations and its associated registers.
The goal of sleep operation is to reduce average power con-
sumption as much as possible. The system has a sleep
state that can be initiated under firmware control. In this
state, the CPU is stopped at an instruction boundary and the
24/48 MHz oscillator, the Flash memory module, and band-
gap-voltage reference are powered down. The only blocks
that remain in operation are the 32 kHz oscillator (external
crystal or internal), PSoC blocks clocked from the 32 kHz
clock selection, and the supply voltage monitor circuit.
Analog PSoC blocks have individual power down settings
that are controlled by firmware, independently of the sleep
state. Continuous time analog blocks may remain in opera-
tion, since they do not require a clock source. Typically,
however, switched capacitor analog blocks will not operate
since the internal sources of clocking for these blocks are
stopped.
The system can only wake up from sleep as a result of an
interrupt or reset event. The Sleep timer can provide peri-
odic interrupts to allow the system to wake up, poll peripher-
als, or do real-time functions and then go to sleep again.
GPIO (pin) interrupts, supply monitor interrupt, analog col-
umn interrupts, and timers clocked externally or from the 32
kHz clock are examples of asynchronous interrupts that can
also be used to wake the system up.
The Watchdog Timer (WDT) circuit is designed to assert a
hardware reset to the device after a pre-programmed inter-
val, unless it is periodically serviced in firmware. This func-
tionality serves to reboot the system in the event of a CPU
crash. It can also restart the system from the CPU halt state.
Once the WDT is enabled, it can only be disabled by an
external reset (XRES) or a power on reset (POR). A WDT
reset will leave the WDT enabled. Therefore, if the WDT is
used in an application, all code (including initialization code)
must be written as though the WDT is enabled.
12.1
Architectural Description
Device components that are involved in sleep and watchdog
operation are the selected 32 kHz clock (external crystal or
internal), the Sleep timer, the sleep bit in the CPU_SCR0
register, the sleep circuit (to sequence going into and com-
ing out of sleep), the band gap refresh circuit (to periodically
refresh the reference voltage during sleep), and the Watch-
dog timer.
12.1.1
32 kHz Clock Selection
By default, the 32 kHz clock source is the Internal Low-
Speed Oscillator (ILO). Optionally, the External Crystal
Oscillator (ECO) may be activated. This selection is made in
bit 7 of the OSC_CR0 register. Selecting the ECO as the
active source for the 32 kHz clock allows the Sleep timer
and sleep interrupt to be used in real-time applications.
Regardless of the clock source selected, the 32 kHz clock
plays a key role in sleep functionality. It runs continuously
Table 12-1. Sleep and Watchdog Registers
Address
0,E0h
0,E3h
x,FEh
1,E0h
1,E9h
1,EBh
x,FFh
LEGEND
X: The value for power on reset is unknown.
x: An “x” before the comma in the address field indicates that this register can be accessed or written to no matter what bank is used.
*: This bit is read only.
Name
Bit 7
VC3
Bit 6
Sleep
Bit 5
GPIO
Bit 4
Bit 3
Bit 2
Analog 1
Bit 1
Analog 0
Bit 0
V Monitor
Access
RW : 00
W : 00
RW : 00
RW : 00
W : 00
W : 00
W : XX
INT_MSK0
RES_WDT
CPU_SCR1
OSC_CR0
ILO_TR
ECO_TR
CPU_SCR0
WDSL_Clear
ECO_EXW*
ECO_EX
IRAMDIS
32k Select
PLL Mode
No Buzz
Sleep[1:0]
CPU Speed[2:0]
Freq Trim[3:0]
Bias Trim[1:0]
PSSDC[1:0]
GIES
WDRS
PORS
Sleep
STOP