cancel
Showing results for 
Search instead for 
Did you mean: 

Hello everyone. I wanted to know how can I put the stm32f4xx in sleep mode and wake it with internal interrupt. i want it to go in sleep mode for 2ms and be awake for 2ms.

Fghas.1
Associate
 
4 REPLIES 4

Read the "Low power modes" subchapter of PWR chapter in RM.

You can simply use the __WFI(); intrinsic go to to sleep, any interrupt will wake up.

JW

Fghas.1
Associate

thank you so much, but is it possible to use timers to wake the micro?

Of course!

Any interrupt can wake up from WFI. If you configure the timer to generate an interrupt, it will wake up the MCU.

ChahinezC
Lead

Hello @Fghas.1​,

You can refer to the examples provides by the STM32CubeF4 package.

As an example, the project under the "STM32Cube_FW_F4_V.XX\Projects\STM32F411E-Discovery\Examples\PWR\PWR_CurrentConsumption" path can help you configure the sleep mode and use the RTC configuration to set the timer to wake up from the low power mode.

Chahinez.