Post Go back to editing

DS3231 alarm interrupt behavior upon update of RTC time

Thread Summary

The user asked if the DS3231 will generate a 1-minute interrupt for the skipped minute (11:00:00) when updating the time from 10:59:58 to 11:00:02. The final answer confirms that the 11:00:00 interrupt is skipped, and the Alarm 2 flag will not set until the next 59->00 transition. Two solutions are suggested: (1) immediately activate the user alarm if it falls between the current and updated times, or (2) store the times, wait for the next interrupt, and then adjust the local time, ensuring no duplicate alarms are issued.
AI Generated Content
Category: Hardware
Product Number: DS3231

I have an application for an alarm clock where a DS3231 is used to generate 1-minute interrupts with Alarm 2, at which time an attached microcontroller requests the current time from the DS3231 and compares the hours and minutes to registers internal to the microcontroller for a user-settable alarm. The date/time of the DS3231 is periodically updated to keep it synchronized with UTC, and these updates can happen at any time.

Suppose at UTC time 11:00:02 the microcontroller updates the time on the DS3231, which currently thinks the time is 10:59:58. During this update the DS3231 will skip right past 11:00:00. Will the DS3231 generate an interrupt for the minute 11:00:00, or will that interrupt be skipped since there was no 59->00 seconds transition?

Parents Reply Children
No Data