Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Triggering Interrupts with Real Time Clock on: April 06, 2012, 03:59:24 pm
Which RTC are you using?

The DS1307 that is mounted on the Data Logging Shield from Adafruit: http://www.adafruit.com/products/243
2  Using Arduino / Programming Questions / Re: Triggering Interrupts with Real Time Clock on: April 06, 2012, 03:14:43 pm
Quote
The RTC chip has it's own power source (coin battery) so I think I'll just set an alarm and use that to trigger an interrupt
I don't think the coin battery (3V) can be used to drive the clock output (TTL is nominally 5V). It only keeps the clock running when the normal supply voltage disappears.

Pete

 

Hmmmm that's a good point. The problem right now is that I'm trying to write code while my parts are ordered. I think the best solution is to wake every 8 seconds and check the clock, as suggested by Nick Gammon.
3  Using Arduino / Programming Questions / Re: Triggering Interrupts with Real Time Clock on: April 06, 2012, 02:45:07 pm
Your only real issue is knowing the time accurately, right? So use the watchdog, and when you wake, power up the RTC chip, read the time, and see if your hour is up.

The RTC chip has it's own power source (coin battery) so I think I'll just set an alarm and use that to trigger an interrupt. Thanks for the responses and I'll try to remember to post code here once I get it working.
4  Using Arduino / Programming Questions / Triggering Interrupts with Real Time Clock on: April 02, 2012, 03:47:20 pm
How would I use a RTC (such as the DS1307) to trigger an interrupt? The overall goal is to put the processor to sleep and then wake it after an hour or so. I looked at using a watchdog timer, but it only goes up to 8 seconds and is reportedly unreliable.

Other info:
Data logging kit w/ RTC - http://www.adafruit.com/products/243
Fourm post that alludes to using an RTC as an interrupt - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1291420085
Watchdog tutorial - http://interface.khm.de/index.php/lab/experiments/sleep_watchdog_battery/
RTClib - https://github.com/adafruit/RTClib

To clarify, I understand how interrupts work; I just don't know how to implement one using the RTC. I don't get how the interrupt is supposed to trigger if the RTC has to be called to get the time (The code uses
Code:
DateTime now = RTC.now();
to get a snapshot of the current time).

tl;dr How do you trigger an interrupt using an RTC such as the DS1307?
Pages: [1]