You are here


Sensor Type: 
Real Time Clock
1-5.5V, backup 275nA@3V, highly configurable countdown timer

The RTC8564 is my favorite clock IC. What makes it particularly exceptional for wireless sensors is the highly configurable countdown timer (although the alarm unit is exceptional as well).
The datasheet may be found here.

My extensive Arduino library my be found on my GitHub.

The countdown timer (which can be routed to the external interrupt) can be configured as a single shot countdown or continuous periodic timer. The later mode is of interest to us, as we can use this mode to set up automatic wakeup calls to read sensors or transmit data.
In addition to several control bits, there are two registers we want to pay attention to:
The first two bits of 0x0E set the interval period. options are 4096Hz, 64Hz, 1Hz (1 second) and 1/60Hz (1 minute).
On it's own, those last two options are pretty useful. Most clocks offer one, if not both of those options.
What stands the RTC8564 apart from many other real time clocks is the second timer register, 0x0F, which acts as a counter to the interval period. I can be set from 0-255.
let's say you want the Arduino to wake up every 30 minutes to take readings and transmit:

  1. Set the TI/TP bit in the control2 register (address 01) to a 1 to enable continuous timer
  2. Set the AIE bit in the control2 register to a 1 to route the timer to the external interrupt pin
  3. Set TD0 & TD1 in register 0E to 1, to set the interval to 1 minute
  4. Load the value "30" into the 0F register. This will cause the timer to count out 30 one minute intervals before triggering the interrupt.
  5. Start the timer with the TE bit in the 0E register.

The clock's alarms are equally powerful, but function in a way that may not be initially intuitive (at least if you are thinking like your typical bedside alarm clock). Each alarm type functions independantly of the others. Therefore, you can't just set an alarm for 10:45. Doing so would actually create TWO independant alarms. The first would go off every day, at 10:00. The second would go off EVERY HOUR, at the 45 minute mark. This is where it is important that your software interperet the meaning of a given alarm, match the two types together, and only sound at the appropriate time. Available alarms are:

  • Minute: As described above. Setting this to 18 would trigger the alarm on every hour's 18th minute.
  • Hour: Setting this to 21 would trigger an alarm on every day's 21st hour.
  • Day: Setting this alarm to 14 would trigger an alarm on every month's 14th day, just after midnight (12:00:01).
  • Weekday: Setting this alarm to 2 would trigger an alarm on every week's Tuesday, just after midnight. (0-7, 0 being Sunday).

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer