cancel
Showing results for 
Search instead for 
Did you mean: 

Please share your thoughts - ultra low power scheme

Clonimus74
Senior II
Posted on October 17, 2017 at 14:13

Hi all, 

I'll appreciate your thoughts on the subject.

I use STM32L476.

Due to high current consumption during run mode, in order to minimize power consumption, I was thinking of using Stop Mode 2 instead of the 'regular' sleep mode. Since systick is not active in this mode I'm thinking of setting the LPTIM for 10msec interval (I don't need more frequent interval), and use it as my application tick. HAL tick will stay the regular systick 1msec that will be active only in run mode.

I'm still debating with myself if to work in 80Mhz to further minimize the run mode duration or just raise the clock to 80MHz only when my algorithm executes (once every 1 second).

In the case where the 80Mhz will be used only for the algorithm, the system clock will be MSI 48Mhz.

The thing is that if I use 80Mhz as a constant system clock, I will have to run a function that restores the clock and systick (for the HAL) in every IRQ handler that might wake me from the Stop Mode 2. I assume the power save in 48Mhz and longer execution time is close to the power penalty in 80Mhz and low execution time.

The wake sources from Stop Mode 2 will be EXTI, LPUART and LPTIM.

What do you think?

Edit:

Another option, since LPTIM using LSE will not be accurate, is to set LPTIM for one shot interrupt prior to entering Stop Mode 2, to wake according to how long is needed for the next systick interrupt. In this case the systick will be set for 10msec, and override the HAL_IncTick function is needed to make sure tha HAL timeouts are working correctly.

#stop-mode-2 #lptim #systick #low-power-modes.
3 REPLIES 3
Posted on October 17, 2017 at 19:23

I read all these before.

The difference is I don't want to use Stop Mode 2 simply when the system is idle/Not in use. I want to use Stop Mode 2 in between active tasks, when normally you'll use 'regular' sleep.

In this case the systick is inactive and so it won't wake the MCU for the next scheduled task etc. that is why I'm pondering about this suggested method, and wanted to hear if there are some reservations, e.g. if there's a risk with frequent transitions between run mode and stop mode 2, the 

efficiency etc.

 
Sven Krauss
Associate II
Posted on November 13, 2017 at 09:16

Hi,

I use the RTC Wakeup interrupt for this issue. This interrupt driven by LSE clock wakes the controller from stop mode. After wakeup the controller processes the ISR and in my case the context switch of the FreeRTOS will be called. I use the 'trace_taskSwitchOut' function to enable the PLL. In the result the ISR functions can run ether with 16MHz or 80Mhz. This must be respected. All tasks are executed with full speed at 80Mhz. This works fine but I didn't measure the difference of the current consumption to any other implementations.

I hope it helps.

Sven