2014-03-03 08:40 AM
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 advance2014-03-03 09:03 AM
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.2014-03-03 09:03 AM
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);
2014-03-03 10:05 AM
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?2014-03-03 10:22 AM
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?2014-03-04 05:38 AM
So I cannot use the standby mode without using an EXTI line?
2014-03-04 05:59 AM
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.2014-03-05 01:34 AM
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.2014-03-05 02:21 AM
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.
2014-03-05 03:14 AM
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.