Skip to main content
Barry Richards
Associate III
March 6, 2021
Solved

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

  • March 6, 2021
  • 1 reply
  • 1474 views

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)

This topic has been closed for replies.
Best answer by waclawek.jan

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

1 reply

waclawek.jan
waclawek.janBest answer
Super User
March 6, 2021

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

Barry Richards
Associate III
March 6, 2021

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.