2011-07-12 10:22 AM
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
2011-07-12 11:18 AM
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.2016-10-10 09:09 PM
2016-10-11 07:54 AM
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 to see how to code that, at this path: STM32Cube_FW_F1_V1.4.0\Projects\STM32VL-Discovery\Examples\GPIO\GPIO_EXTIFor 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-2016-10-11 08:23 AM
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.2016-10-11 09:57 PM