CY8C28xxx PSoC Programmable System-on-Chip TRM, Document No. 001-52594 Rev. *G
97
12. Sleep and Watchdog
This chapter discusses the Sleep and Watchdog operations and their associated registers. For a complete table of the Sleep
and Watchdog registers, refer to the
“Summary Table of the Core Registers” on page 36
. For a quick reference of all PSoC
®
registers in address order, refer to the
Register Details chapter on page 125
12.1
Architectural Description
Device components that are involved in Sleep and Watch-
dog 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 bandgap refresh circuit (to periodically
refresh the reference voltage during sleep), and the
.
The goal of Sleep operation is to reduce average power
consumption 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 (IMO), the Flash memory module, and
bandgap voltage reference are powered down. The only
blocks that remain in operation are the 32 kHz oscillator
(external crystal or internal),
clocked from the
32 kHz clock selection, and the supply voltage monitor cir-
cuit.
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, because they do not require a clock source. Typically,
switched capacitor analog blocks will not operate, because
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 periodic
interrupts to allow the system to wake up, poll peripherals,
or do real-time functions, and then go to sleep again. The
GPIO (pin) interrupt, supply monitor interrupt, analog col-
umn interrupts, and timers clocked externally or from the 32
kHz clock are examples of
interrupts that
can also be used to wake the system up.
The Watchdog Timer (WDT) circuit is designed to assert a
to the device after a pre-programmed inter-
val, unless it is periodically serviced in firmware. In the event
that an unexpected execution path is taken through the
code, this functionality serves to reboot the system. It can
also restart the system from the CPU halt state.
When 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.1
32 kHz Clock Selection
By default, the 32 kHz clock source is the Internal Low
Speed Oscillator (ILO). Optionally, the 32.768 kHz External
Crystal Oscillator (ECO) may be activated. This selection is
made in bit 7 of the OSC_CR0 register. Selecting the ECO
as the source for the 32 kHz clock allows the sleep timer
and sleep interrupt to be used in real-time clock applica-
tions. Regardless of the clock source selected, the 32 kHz
clock plays a key role in sleep functionality. It runs continu-
ously and is used to sequence system wakeup. It is also
used to periodically refresh the bandgap voltage during
sleep.
Refer to the
External Crystal Oscillator (ECO) chapter on
, for details on activating an external crystal
oscillator.
12.1.2
Sleep Timer
The sleep timer is a 15-bit up counter clocked by the cur-
rently selected 32 kHz clock source, either the ILO or ECO.
This timer is always enabled. The exception to this is within
an
mode and when
the Stop bit in the CPU_SCR0 is set; the sleep timer is dis-
abled, so that the user will not get continual watchdog resets
when a breakpoint is hit in the debugger environment.
If the associated sleep timer interrupt is enabled, a periodic
interrupt to the CPU is generated based on the sleep inter-
val selected from the OSC_CR0 register. The sleep timer
functionality does not need to be directly associated with the
sleep state. It can be used as a general purpose timer inter-
rupt regardless of sleep state.
Summary of Contents for CY8C28 series
Page 65: ...64 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G RAM Paging ...
Page 125: ...124 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 311: ...310 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G IDAC_CR0 1 FDh ...
Page 317: ...316 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 393: ...392 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Page 477: ...476 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Digital Clocks ...
Page 561: ...560 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...