Sleep mode is activated by the Wait For Interrupt instruction (WFI). The Idle bits in the Sleep Mode register (SLEEP.IDLE) and the SLEEPDEEP bit of the System Control register of the CPU should be used as argument to select the level of the sleep mode.
There are two main types of sleep mode:
Mode | Level | Mode Entry | Wake-Up Sources |
---|---|---|---|
IDLE | 0 | SCR.SLEEPDEEP = 0 SLEEP.IDLE=Level WFI | Synchronous(2) (APB, AHB), asynchronous(1) |
1 | Synchronous (APB), asynchronous | ||
2 | Asynchronous | ||
STANDBY | SCR.SLEEPDEEP = 1 WFI | Asynchronous |
Sleep Mode | CPU Clock | AHB Clock | APB Clock | Oscillators | Main Clock | Regulator Mode | RAM Mode | |||
---|---|---|---|---|---|---|---|---|---|---|
ONDEMAND = 0 | ONDEMAND = 1 | |||||||||
RUNSTDBY=0 | RUNSTDBY=1 | RUNSTDBY=0 | RUNSTDBY=1 | |||||||
Idle 0 | Stop | Run | Run | Run | Run | Run if requested | Run if requested | Run | Normal | Normal |
Idle 1 | Stop | Stop | Run | Run | Run | Run if requested | Run if requested | Run | Normal | Normal |
Idle 2 | Stop | Stop | Stop | Run | Run | Run if requested | Run if requested | Run | Normal | Normal |
Standby | Stop | Stop | Stop | Stop | Run | Stop | Run if requested | Stop | Low power | Low power |