Document # 001-20559 Rev. *D
31
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 32
. For a quick reference of all PSoC
registers in address order, refer to the
Register Details chapter on page 47
.
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 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 (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, since they do not require a clock source. Typically,
switched capacitor analog blocks do 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 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 also
restarts the system from the CPU halt state.
Once the WDT is enabled, it is only disabled by a Power On
Reset (POR) or an External Reset (XRES). A WDT reset
leaves 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 wake up. 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 oscilla-
tor.
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 does 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 PSoC CY8C23533
Page 4: ...Contents Overview 4 Document 001 20559 Rev D Section G Glossary 385 Index 401 ...
Page 16: ...Contents Overview 16 Document 001 20559 Rev D ...
Page 24: ...24 Document 001 20559 Rev D Section A Overview ...
Page 30: ...30 Document 001 20559 Rev D Pin Information ...
Page 54: ...54 Document 001 20559 Rev D Supervisory ROM SROM ...
Page 60: ...60 Document 001 20559 Rev D RAM Paging ...
Page 68: ...68 Document 001 20559 Rev D Interrupt Controller ...
Page 76: ...12 Document 001 20559 Rev D General Purpose IO GPIO ...
Page 82: ...18 Document 001 20559 Rev D Internal Main Oscillator IMO ...
Page 84: ...20 Document 001 20559 Rev D Internal Low Speed Oscillator ILO ...
Page 90: ...26 Document 001 20559 Rev D External Crystal Oscillator ECO ...
Page 94: ...30 Document 001 20559 Rev D Phase Locked Loop PLL ...
Page 106: ...42 Document 001 20559 Rev D Sleep and Watchdog ...
Page 228: ...164 Document 001 20559 Rev D Section D Digital System ...
Page 234: ...170 Document 001 20559 Rev D Array Digital Interconnect ADI ...
Page 278: ...214 Document 001 20559 Rev D Digital Blocks ...
Page 296: ...232 Document 001 20559 Rev D Analog Interface ...
Page 304: ...240 Document 001 20559 Rev D Analog Array ...
Page 308: ...244 Document 001 20559 Rev D Analog Input Configuration ...
Page 312: ...248 Document 001 20559 Rev D Analog Reference ...
Page 338: ...274 Document 001 20559 Rev D Section F System Resources ...
Page 354: ...290 Document 001 20559 Rev D Multiply Accumulate MAC ...
Page 374: ...310 Document 001 20559 Rev D I2C ...
Page 400: ...336 Document 001 20559 Rev D Section G Glossary ...