JChristensen / DS3232RTC

Arduino Library for Maxim Integrated DS3232 and DS3231 Real-Time Clocks
GNU General Public License v3.0
392 stars 135 forks source link

What does this mean? #55

Closed cyberlink1 closed 6 years ago

cyberlink1 commented 6 years ago

To use this signal as an actual interrupt to a microcontroller, it will need to be connected properly and programmed in the application firmware. on the RTC.

Im reading through the docs and the examples (While I wait on a DS3232RTC in the mail) and am a bit confused by the statement.

Are you saying that you have to change the firmware on the RTC or are do you mean that you need to set the alarm and Square wave to NONE before you call RTC.alarmInterrupt ?

So far, it looks great and looks to have all the functions I was looking for. Thank you

JChristensen commented 6 years ago

Greetings, it means I have a typo! The words "on the RTC." should be deleted. I'll get that fixed, thanks. (There is no firmware that can be modified on the RTC.) I take a bit of exception to the pin on the RTC being referred to as an "interrupt" because it's really just a logic signal output. Whether the signal is used to generate an interrupt on (for example) a microcontroller is a separate issue. If an interrupt is to be generated, the RTC "interrupt" pin has to be connected to the MCU and the MCU firmware must properly configure the interrupt and also provide for handling it. Hope that helps.

cyberlink1 commented 6 years ago

That helps a lot! Thank you

When the logic signal from the RTC is set will it remain high tell a new alarm is set in the RTC?

Im thinking with a Mosfet and a few minor parts I could have that power up an ESP8266 and when the ESP sets the next alarm it would loose power. None of this deep sleep stuff, it would be off. lol

JChristensen commented 6 years ago

That sounds like it could work. The RTC's alarm flag (A1F or A2F) remains asserted until cleared (via the alarm() function.) If "interrupts" are also enabled (via the alarmInterrupt() function), then the INT/SQW pin will reflect the state of the alarm flag. I do not believe that just setting a new alarm time will reset the alarm flag.

JChristensen commented 6 years ago

Also see the alarm primer for more info on alarms.

JChristensen commented 6 years ago

Also note that the INT signal from the RTC is active low. So it will normally be a high logic level, and will go low when an alarm occurs.