cancel
Showing results for 
Search instead for 
Did you mean: 

In my application, I need to awake up with in 2 seconds regular intervals when it goes in stop mode. can you share sample code for RTC's calender and using its internal Alarm A for waking up?

PShar.0.294
Associate II

I am using STM32F030F4P6

I am just looking for an example code where RTC gives a periodic alarm every 1 second (or any other time period)

6 REPLIES 6
Jack Peacock_2
Senior III

Unfortunately the RTC alarm isn't designed for that type of periodic wake up. The alarm mask works on decade rollovers: 1 second, 10 seconds, 1 minute, 10 minutes etc, but not 2 seconds, 5 minutes, anything like that. You might want to look at the WUT wakeup timer instead.

Jack Peacock

Uwe Bonnes
Principal III

Do you have a MCU with LPTIM. That may be another option.

You could perhaps change the timebase, or advance the alarm after each event.

Generally the assorted examples are under the Cube HAL example trees in the repository for your specific model of STM32, which you fail to mention.

Expect you'll need to understand chip functionality, and code your own app.

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

Dear Jack - can you please share a code snipped for RTC periodic wake up @ 1 Sec.

I am using STM32F030F4P6

I am using STM32F030F4P6. This does not have LPTIM

I am using STM32F030F4P6.

Possible for you to share code snippet for 1 second periodic wake in RTC.