Getting started with PWR

Revision as of 14:40, 10 July 2020 by Registered User
Under construction.png Coming soon

This article explain what is sleep/stop and standby low power mode and provide code examples !

1. Low power mode

By default, the microcontroller is in Run mode after a system or a power-on reset. Several low-power modes are available to save power when the CPU does not need to be kept running, for example when waiting for an external event. It is up to the user to select the mode that gives the best compromise between low-power consumption, short startup time and available wakeup sources. The main three low-power modes:

  • Sleep mode (Cortex core stopped, peripherals kept running)
  • Stop mode (all clocks are stopped)
  • Standby mode (only backup domain is powered)

2. SLEEP Mode

File:sleep mode.png

2.1. Definition

2.1.1. Use SLEEP mode with EXTI​

2.1.1.1. Objective
  • We use the EXTI setup from EXTI_overview
  • Learn how to setup SLEEP in HAL​
  • Create simple project with SLEEP mode with wake up on pin press​
2.1.1.2. Goal
  • Use project from EXTI_overview
  • Learn how to setup the SLEEP in HAL, and which events can wake up MCU​
  • Verify the correct functionality by measuring consumption​
2.1.1.3. HAL Library workflow summary

File:Sleep HAL.png

2.1.1.4. Open the project from EXTI_overview
  • Open the main.c
  • Add function suspend the Systick ( as we wakeup on any interrupt)
  • Add function to enter in SLEEP mode
  • Add function to resume the Systick on wakeup

File:SleepCode v2.png

2.1.1.5. Compile and flash
2.1.1.6. Measure consumption
  • Stop any debug session and do a full power cycle
  • Use an ampermeter on IDD connector (JP5 on NucleoF446RE, for other board check User Manual)
  • Check consumption while in stop mode
  • Press the button of the Nucleo, you can see the consumption variation

3. STOP Mode

File:stop mode.png

3.1. Definition

3.1.1. Use STOP mode with EXTI​

3.1.1.1. Objective
3.1.1.2. Goal

4. STANBY Mode

File:standby mode.png

4.1. Definition

4.1.1. Use STANBY mode

4.1.1.1. Objective
4.1.1.2. Goal