0

Program DS3231 to clear alarms
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Program DS3231 to clear alarms

by Zauberkugel on Mon Mar 18, 2019 4:18 pm

I'm using the DS3231 alarm function. I can program it so that the SQW pin goes to LOW at any pre-specified time or interval. So far so good.

But now, I would like to get that pin to go back to high (i.e. "turn the alarm off") a few seconds later. Many libraries provide functionality to do that. But they all require a command to be sent from Arduino via I2C exactly at the time I want to turn the alarm off. I don't want that. Instead I want to program the clock to set the SQW pin back to high by itself, some time after its alarm went off.

Would anybody know of a way to do that?

Zauberkugel
 
Posts: 3
Joined: Thu Aug 20, 2015 9:12 pm

Re: Program DS3231 to clear alarms

by adafruit_support_mike on Tue Mar 19, 2019 4:36 am

The DS3231 doesn't provide any way to control the length of an alarm signal.

According to the datasheet, the alarm conditions are tested once per second, and I'd assume the alarm will only last for the second when the test is true.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Re: Program DS3231 to clear alarms

by Zauberkugel on Tue Mar 19, 2019 9:27 pm

Hmm, mine actually stays alarmed (SQW = Low) forever. I think this is consistent with what I'm reading elsewhere on the net. I don't technically need to control the duration. As long as I could set it to any value other than forever, that would be great :)

Zauberkugel
 
Posts: 3
Joined: Thu Aug 20, 2015 9:12 pm

Re: Program DS3231 to clear alarms

by adafruit_support_mike on Wed Mar 20, 2019 1:21 am

Hmm.. it must be tied to the interrupt flag bits then.

I'm afraid the only way to reset those is with an I2C command.

adafruit_support_mike
 
Posts: 58856
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.