What low-power modes do MCUs have?
Short answer: Names differ by vendor, but there are usually three levels. Sleep: the CPU clock stops (WFI/WFE), peripherals keep running, and any interrupt wakes it within a few cycles. Stop/deep sleep: most clocks and the PLL stop, RAM and registers are kept, wake-up comes from external interrupts, the RTC or a few low-power peripherals in microseconds, and clocks must be reconfigured afterwards. Standby/shutdown: almost everything is powered off, RAM is lost (except a small backup domain), wake-up is from a few pins or the RTC, and the MCU restarts through reset.
| Mode | CPU | Clocks | RAM | Wake sources | Wake time | Typical current |
|---|---|---|---|---|---|---|
| Run | on | all | kept | – | – | mA (e.g. 100 µA/MHz) |
| Sleep | off | peripherals on | kept | any interrupt | ~cycles | ~half of run |
| Stop / deep sleep | off | HF clocks off, LSE/LSI on | kept | EXTI, RTC, LPUART, LPTIM, comparators | µs | µA |
| Standby / shutdown | off | almost all off | lost (backup regs kept) | wake-up pins, RTC, reset | ms (reboot) | < 1 µA |
Entering sleep on Cortex-M
SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; /* light sleep */
__DSB();
__WFI();
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; /* deep sleep (vendor registers select Stop vs Standby) */
__DSB();
__WFI();
SLEEPONEXIT: set SCB_SCR_SLEEPONEXIT_Msk in fully interrupt-driven designs: the core goes back to sleep automatically after each ISR, without returning to the main loop.
Getting really low current
- Configure unused pins as analog or output low; disconnect pull resistors that conduct.
- Disable peripheral clocks and power-hungry analogue blocks (ADC, comparators, voltage reference) when not used.
- Lower the core voltage/frequency when awake (run modes).
- Turn off external components (sensors, radios, LEDs) via load switches.
- Make sure the debugger is disconnected: debug logic keeps clocks running (
DBGMCUsettings). - Measure with a power analyser or a current probe over a full duty cycle (Nordic PPK2, Otii, Joulescope), not a multimeter.
Battery life estimate: average current = (active current × active time + sleep current × sleep time) / period. A device that wakes for 5 ms every second at 5 mA and sleeps at 2 µA averages ~27 µA, so a 220 mAh coin cell lasts roughly 8,000 hours (about 11 months), before self-discharge and peak-current limits.