cancel
Showing results for 
Search instead for 
Did you mean: 

Using Standby Mode with the RTC

emilio
Associate II
Posted on March 03, 2014 at 17:40

Hello everybody.

I am developing some test firmwares on a STM32F103 based board.

After some working programs using the sleep mode, now I need to do some experience with the much more powerful standby mode.

I need to set a fixed timer using the RTC in order to wake up the system periodically to perform some tasks. I want to use the RTC, no external interrupts.

Can anybody help me with a code example?

Thanks in advance
18 REPLIES 18
chen
Associate II
Posted on March 03, 2014 at 18:03

Hi

Here is a link to the 'Standard Perpheral Drivers' for the STM32F103 series of processors.

http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/PF257890

It might have some example code for you to look at.

stm322399
Senior
Posted on March 03, 2014 at 18:03

Emilio,

help yourself with this code i used in STM32L150 (beware of possible differences with your F103):

RTC_WakeUpCmd(DISABLE);
RTC_WakeUpClockConfig(RTC_WakeUpClock_RTCCLK_Div2);
RTC_SetWakeUpCounter(period/2);
RTC_ITConfig(RTC_IT_WUT,ENABLE);
RTC_WakeUpCmd(ENABLE);

emilio
Associate II
Posted on March 03, 2014 at 19:05

I would like to use the RTC alarm to wake up from standby mode. Unfortunately I don't have a LSE on my board.

Where can I find some examples about the alarm configuration and use?
Posted on March 03, 2014 at 19:22

Unfortunately I don't have a LSE on my board.

That's going to represent a significant problem when the power domain the LSI is in goes down, isn't it?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
emilio
Associate II
Posted on March 04, 2014 at 14:38

So I cannot use the standby mode without using an EXTI line?

stm322399
Senior
Posted on March 04, 2014 at 14:59

You can wake up the CPU with RTC clocked by LSI.

LSI can run in stand-by mode if you configure it to do so, and as long as Vdd is powered.

the manual says:

40 kHz low speed internal RC (LSI RC) which drives the independent watchdog and optionally the RTC used for Auto-wakeup from Stop/Standby mode.

emilio
Associate II
Posted on March 05, 2014 at 10:34

Thanks for answering.

Can you advise me about what code I have to use in order to configure the LSI properly?

I am trying but I have some problems.

emilio
Associate II
Posted on March 05, 2014 at 11:21

I would like using the LSI for auto wake-up my system from standby but I am not finding any example code and I am not very good using the RTC, I usually use ''normal'' timer.

stm322399
Senior
Posted on March 05, 2014 at 12:14

Have you got a look to the PWR/STDBY example ?

It looks very close to what you try to do, excepted that you have to configure LSI instead of LSE.

The Ref manual says:

To wakeup from Stop mode with an RTC alarm event, it is necessary to:

�? Configure the EXTI Line 17 to be sensitive to rising edge

�? Configure the RTC to generate the RTC alarm

To wakeup from Standby mode, there is no need to configure the EXTI Line 17.