
...the world's most energy friendly microcontrollers
2011-02-04 - d0002_Rev1.00
31
www.energymicro.com
if the register is 0 the processor stops executing instructions and enters sleep mode
if the register is 1 the processor clears the register to 0 and continues executing instructions without
entering sleep mode.
If the event register is 1, this indicate that the processor must not enter sleep mode on execution
of a WFE instruction. Typically, this is because the processor has executed an SEV instruction, see
2.5.1.3 Sleep-on-exit
If the SLEEPONEXIT bit of the SCR is set to 1, when the processor completes the execution of an
exception handler it returns to Thread mode and immediately enters sleep mode. Use this mechanism
in applications that only require the processor to run when an exception occurs.
2.5.2 Wakeup from sleep mode
The conditions for the processor to wakeup depend on the mechanism that cause it to enter sleep mode.
2.5.2.1 Wakeup from WFI or sleep-on-exit
Normally, the processor wakes up only when it detects an exception with sufficient priority to cause
exception entry.
Some embedded systems might have to execute system restore tasks after the processor wakes up, and
before it executes an interrupt handler. To achieve this set the PRIMASK bit to 1 and the FAULTMASK
bit to 0. If an interrupt arrives that is enabled and has a higher priority than current exception priority,
the processor wakes up but does not execute the interrupt handler until the processor sets PRIMASK
2.5.2.2 Wakeup from WFE
The processor wakes up if:
it detects an exception with sufficient priority to cause exception entry
in a multiprocessor system, another processor in the system executes an SEV instruction.
In addition, if the SEVONPEND bit in the SCR is set to 1, any new pending interrupt triggers an event and
wakes up the processor, even if the interrupt is disabled or has insufficient priority to cause exception
2.5.3 The Wakeup Interrupt Controller
The Wakeup Interrupt Controller (WIC) is a peripheral that can detect an interrupt and wake the
processor from deep sleep mode. The WIC is enabled only when the DEEPSLEEP bit in the SCR is
The WIC is not programmable, and does not have any registers or user interface. It operates entirely
from hardware signals.
When the WIC is enabled and the processor enters deep sleep mode, the power management unit
in the system can power down most of the Cortex-M3 processor. This has the side effect of stopping
the SysTick timer. When the WIC receives an interrupt, it takes a number of clock cycles to wakeup
the processor and restore its state, before it can process the interrupt. This means interrupt latency is
increased in deep sleep mode.
Note