2019-03-25 02:06 AM
Hi All,
I am working on the STM32F030 MCU and developing code for the low power consumption for my application.
I need to develop code for the sleep mode, in which after few minutes it goes to sleep mode to save power. But some how I am not getting that how do I get this into my code.
So, I could like to request you to kindly guide me through this sleep mode functionality that how do I develop.
Looking forward for the Kind supports and guidance.
Thanks
2019-03-25 03:02 AM
Hello,
You can develop your project based on both examlpes PWR_CurrentConsumption and RTC_Alarm. The RTC to program the MCU to enter sleep mode.
Best Regards,
Mohamed Aymen.
2019-03-25 04:14 AM
Hi,
I have develop a small code for my basic understanding for sleep mode.
In code I have used toggle led with every 1 sec and then write the HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI) to push MCU in sleep mode.
But still it blinks the led at every 1 sec, it doesn't goes into sleep mode, after changing it to the HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFE) it stop the led toggling and hold led in one state(ON/OFF state) after pressing interrupt button once again begin to toggle and goes to stop_mode.
Please let know that how do I make sleep mode or if I was wrong then please guide & correct me.
Thanks
2019-03-25 05:16 AM
Hi Mohamed,
I have gone through your suggested "RTC" and "PWR" example but I didn't found any such information in available example.
Can you have some other examples too for the same to go into sleep mode.
Thanks
2019-03-25 07:27 AM
Hello,
In Sleep mode, only the CPU is stopped. All peripherals continue to operate and can wake up the CPU when an interrupt/event occurs. In your case maybe you have a peripheral interrupt that force the MCU to wake-up from sleep mode but in stop mode several peripheral can be active, in this case the system work properly ( there is no unexpected interrupt ).
Best Regards,
Mohamed Aymen.
2019-03-26 02:25 AM
Hi Mohamed,
You are right but what I need is to stop all the peripheral as of my device is battery operated.
So I need to save power using the HAL APIs.
I have gone through the "Sleep mode", "Stop mode" and "Standby mode".
As I have tried with Sleep mode and stop mode but could not able to achieve the main goal( for example: goal stop LED blinking).
So can you let know which API may I use to completely closed or stop all the connected LED & peripherals to stop consuming power and save battery for long last.
In my condition I want to configure as input interrupt only one GPIO pin which can wake up MCU and continue with task.
In sleep mode all the peripherals and GPIO except wake up GPIO pin is active, So we can wake up the device.
Thanks
2019-03-26 03:39 AM
Hello,
To reduce power consumption you need to :
In this case you can save power and battery life.
Best Regards,
Mohamed Aymen.
2019-04-18 10:11 PM
Okay, I will check it & if I found any problem I will let you know and ask my concern for the same.
Thanks