..

Low Power Design with ARM Cortex M

Sleep vs Deep Sleep

From Cortex-M0 Devices Generic User Guide1,

  • a sleep mode that stops the processor clock
  • a deep sleep mode that stops the system clock and switches off the PLL and flash memory.1

Within the SCB register there is a SLEEPDEEP bit that if set to 1 will put the processor into a deep sleep mode.

WFE vs WFI

The sleep modes are invoked by Wait-For-Interrupt (WFI) or Wait-For-Event (WFE) instructions.2

WFI vs WFE

Typically, for interrupt-driven applications, the WFI instruction is used.

However, if there are interactions between the interrupt handlers and the main program, the WFE instruction should be used. In this case there the processor would go to sleep in the main program context. When the WFE instruction is executed, it checks the value of the event bit in the System Control Block (SCB). If the bit is set, the system will not enter sleep.

The Sleep-On-Exit feature is ideal for interrupt-driven applications. When it is enabled, the processor can enter sleep as soon as it completes an exception handler and returns to thread mode.