cancel
Showing results for 
Search instead for 
Did you mean: 

The efficient way to wake-up every 15ms

Kuikui
Associate III
Posted on September 11, 2010 at 11:27

The efficient way to wake-up every 15ms

4 REPLIES 4
Posted on May 17, 2011 at 14:06

>>As far as I understand, the µC can only be waken up from STOP mode by the RTC through an EXTI line, is this right ?

Correct, that or any EXTI (external pin). The 1.8V clocks are down, but the 3.3V pins should still be functional. If you have an external time base, poke it with that. The ST example code uses PB.08 and PG.08 as secondary sources.

 

>>Then I would need to re-arm an RTC alarm ?

Yes, it's a one-shot, you'd need to advance the alarm point, or wait for it to wrap. The RTC is a 32-bit counter. I've only used it with the 1 second time base, but you should be able to alter the prescaler to get finer granularity.

>>Can't just the µC be waken from STOP mode by a timer overflow or something that does not need to be re-armed ?

What's the real issue with re-arming it? You have to clear the alarm as part of the interrupt handling, advancing and re-arming it don't appear to be overwhelmingly difficult, and all the other peripherals are going to be stopped/frozen.

If you can afford it use SLEEP, run the processor/peripherals slowing and interrupt infrequently. If you're not doing a whole lot and can do your work at reset, then STANDBY should consume significantly less power than STOP. In my experiments STOP was pulling a several mA, and STANDBY a few uA, although YMMV.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gregstm
Senior III
Posted on May 17, 2011 at 14:06

The RTC_Second interrupt can wake you up from Stop without having to continually fiddle with the RTC - but unfortunately it can't wake you from Standby.

domen23
Associate II
Posted on May 17, 2011 at 14:06

Not what you asked, but... maybe you can get away by only reducing the MCU clock. That should get you into <3 mA range without much hassle.

Posted on May 17, 2011 at 14:06

>>The RTC_Second interrupt can wake you up from Stop without having to continually fiddle with the RTC - but unfortunately it can't wake you from Standby.

A prescaler of 491 or 492 would give you ''Seconds'' of about 15 ms.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..