cancel
Showing results for 
Search instead for 
Did you mean: 

Low power mode for STM32F101

markaren1
Associate II

Posted on July 12, 2011 at 19:22

Hi All,

I need to put a unit into a low power mode (< 300uA), then be able to periodically wake it using either a 1Hz tick from the 32.768kHz crystal, or from a transition on any of the pins PC4 through PC7.

The system nominally runs at 16MHz using an HSE crystal with (no PLL).

It looks like I can attach PC4..7 to an EXTI line but I am unclear if EXTI needs to be processed by the NVIC.

I need to hold the latched state of several output pins when in the low power mode, although they won't be any significant current flow out of these pins.

I also need to hold the state of SRAM and the registers, so resuming code execution is possible.

Debug modes are not required.

It looks like CPU in Stop mode with regulator in Run is required to get current below 300uA. The issue seems to be if EXTI (from RC4..7, or RTC) can be configured to wake the system from this mode,

Pointers and comments appreciated, I am finding relevant ST documentation hard work at the moment.

Thanks,

Mark

5 REPLIES 5
Posted on July 12, 2011 at 20:18

My experience with STOP on one of my system was I could get total consumption to about 1mA, in STANDBY 180uA. The exit from STANDBY is a reset, but realistically you need to handle different types of reset, and to get to the point of using the RTC effectively it's the way to go. At 1 Hz I probably wouldn't bother, but assuming you want to go to sleep for minutes/hours/days, you'd seriously want to consider STANDBY, and not assume your SRAM is preserved. Use the BKP registers to hold state information, if it's large enough.

If I was reworking that design I'd probably look at the STM32L152 series. A lot more options in terms of clocking, and power saving.

I handled NVIC interrupts for the EXTI and RTC Alarm, not least because I was monitoring buttons and alarms, and you need to be handle all possible states the system might be in, or transitioning between.

The example code however is awfully over simplified, demonstrating one feature at a time, and a real system is substantially more complicated with a lot of interplay.

I see many hours of head scratching in your future.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Md Mubdiul Hasan
Associate III
Posted on October 11, 2016 at 06:09

Dear Sir,

Could you kindly explain how NVIC interrupts for the EXTI and RTC Alarm.Mention a code here please.

In case of push button reading, should I use EXTI or input capture by TIM?

Walid FTITI_O
Senior II
Posted on October 11, 2016 at 16:54

Hi ather.m, 

Yes. First, for the stop mode regulator in run mode has just 35 uA typical current consumption value for STM21F101xC/xD/xE.

For External wakeup source, you should configure one GPIO of 112 GPIOs to be connected to one of 16 EXTI lines and to be capable of waking up device from low power mode (Sleep, stop) . You set the priority of EXTI line by configuring the NVIC.

I recommend that you check the example ''GPIO_EXTI'' in 

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef1.html

to see how to code that, at this path: STM32Cube_FW_F1_V1.4.0\Projects\STM32VL-Discovery\Examples\GPIO\GPIO_EXTI

For the standby mode you have to just enable the Wake-up pin by setting the EWUP in PWR_CSR register,  just before entering the standby without configuring the GPIO.

-> refer to ''PWR-Standby'' example at this path: STM32Cube_FW_F1_V1.4.0\Projects\STM32F103RB-Nucleo\Examples\PWR\PWR_STANDBY

-Hannibal-

Posted on October 11, 2016 at 17:23

This thread is from *2011* assume the OP isn't here.

Power consumption from the core is often hard to measure in real systems, and ultimately what the board, and the circuitry attached to the core do, are what is important, and measurable at the battery or supply inputs.

I use the SPL, the lower power code I built for my boards probably isn't hugely relevant to others, and is complex and proprietary. The examples are often simplistic and single issue, the real world involves more complex interacting systems. You need to learn the basics and how they apply to your system and your board.

Why Input Capture? Are you interested in time-stamping the make/break events? If you are looking at PWM signals, then Input Capture makes sense, for user key presses then EXTI will almost certainly suffice.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Md Mubdiul Hasan
Associate III
Posted on October 12, 2016 at 06:57

Dear Sir Clive,

Thank you for respond in this post.

Here I would like to inform you some issues...

 I understand for the press button EXTI can be use, but in case of generating pwm and switching the transistor press key, how would I proceed?

Now in case of low PWR mode sleep /wakeup/stand by case, people are using  System Clock source from HSI, because it needs PLL with HSI as source, in case of bypass oscillator mode, can I apply the example code ,C:\STM32Cube_FW_F0_V1.6.0\Projects\STM32F070RB-Nucleo\Examples\PWR\PWR_CurrentConsumption\Src?

Kindly let me know.

Thank you.