DateTime now = RTC.now();
I looked at using a watchdog timer, but it only goes up to 8 seconds and is reportedly unreliable.
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
QuoteThe 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 interruptI 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
Which RTC are you using?
The DS1307 that is mounted on the Data Logging Shield from Adafruit: http:
It would be a simple matter to set to DS1307 to provide a 1 Hz pulse stream. Then count the pulses.
17.3 External Clock SourceAn external clock source applied to the T1/T0 pin can be used as Timer/Counter clock (clkT1/clkT0). The T1/T0 pin is sampled once every system clock cycle by the pin synchronization logic.
14.3.3 Alternate Functions of Port DPD5 T1 (Timer/Counter 1 External Counter Input) OC0B (Timer/Counter0 Output Compare Match B Output) PCINT21 (Pin Change Interrupt 21)
• T1/OC0B/PCINT21 - Port D, Bit 5T1, Timer/Counter1 counter source.OC0B, Output Compare Match output: The PD5 pin can serve as an external output for the Timer/Counter0 Compare Match B. The PD5 pin has to be configured as an output (DDD5 set (one)) to serve this function. The OC0B pin is also the output pin for the PWM mode timer function.PCINT21: Pin Change Interrupt source 21. The PD5 pin can serve as an external interrupt source.
16.11.2 TCCR1B - Timer/Counter1 Control Register B• Bit 2:0 - CS12:0: Clock SelectThe three Clock Select bits select the clock source to be used by the Timer/Counter, see Figure 16-10 and Figure 16-11.
I don't know which pin that is on the Arduino.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16