cancel
Showing results for 
Search instead for 
Did you mean: 

RTC, set an alarm for 1 hour in the future.

Barry Richards
Associate II

I want to set a RTC alarm to trigger 1 hour from now but there doesn't seem to be a built-in function (using HAL) to add time. Of course 1 hour in the future is easy unless it happens to be almost midnight or worse almost midnight at the end of the month.

Hopefully I have overlooked a simple way to do this

(this is on a STM32L0)

1 ACCEPTED SOLUTION

Accepted Solutions

If you set RTC_ALRMxR.MSK4, date/day does not enter the alarm comparison. Read Programmable alarms subchapter of RTC chapter in RM, and description of the RTC_ALRMxR registers.

JW

View solution in original post

2 REPLIES 2

If you set RTC_ALRMxR.MSK4, date/day does not enter the alarm comparison. Read Programmable alarms subchapter of RTC chapter in RM, and description of the RTC_ALRMxR registers.

JW

I had read through that section but the line

Each calendar field can be independently selected through the MSKx bits
of the RTC_ALRMAR register, and through the MASKSSx bits of the RTC_ALRMASSR
register.

part went over my head.

Thanks a lot.