Skip to main content
PShar.0.294
Associate II
August 20, 2019
Question

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?

  • August 20, 2019
  • 6 replies
  • 1316 views

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)

This topic has been closed for replies.

6 replies

Jack Peacock_2
Associate II
August 20, 2019

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

PShar.0.294
Associate II
August 23, 2019

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

I am using STM32F030F4P6

Uwe Bonnes
Chief
August 20, 2019

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

PShar.0.294
Associate II
August 23, 2019

I am using STM32F030F4P6. This does not have LPTIM

Tesla DeLorean
Guru
August 20, 2019

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
PShar.0.294
Associate II
August 23, 2019

I am using STM32F030F4P6.

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