Program and read IBM AT real-time clock/calendar with Arduino.

Real-time clock (RTC) Module is a direct clock/calendar replacement for AT-compatible computers and other applications. It has internal lithium cell for external power failure and crystal. No external components required. The unit can be found on some motherboards or just ordered as a free sample from Texas Instruments website.

12/24 time formats with daylight saving, alarm features and 100-year calendar and programmable square output. On top of that 114 bytes of nonvolatile storage are available for general purpose.

I've built it on single plated PCB as an Adruino shield. Work with 8-bit bidirectional bus requires 11 digital pins from Arduino in this primary design. Anyway when module is set up you can put it aside (up to 10 years, internal cell will take care of internal operations and memory:) and develop serial bus interface. I hope that'll be my next project.

Time, data, registers can be read/written with simple commands through Serial port, directly from Arduino IDE serial monitor.

After upload to Arduino flash:
- send 't' to display current module time
- send 'r' to display registers
- send 'h/m/s/M/D/Y' to adjust time and date

If you are using new module first step is to run the oscillator. Instruction included in datasheet archive. Write 010x pattern to register A. writebyte(regA,0x2A) function will help to run newly shipped module at start-up.

2 Buttons on my prototype are optional.