IBM RTC on Arduino

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.

Cheers!

By smoltis
Created on December 4, 2009, 13:24

Category: Digital

Difficulty: amateurs

License:  Creative Commons Attribution-Share Alike 3.0 Unported License

Tags: rtc, arduino, shield

Images

Files

Links

Comments

  1. Stas Smoltis # Dec. 4, 2009, 9:31 a.m.

    Images and schematic http://picasaweb.google.ru/domain.smoltis/ArduinoWithIBMATRTC?feat=directlink Code and description: http://arduinoaboveandbeyond.blogspot.com/2009/12/arduino-with-ibm-at-rtc-module.html
  2. Chunkyhomestyle # June 10, 2010, 7:48 a.m.

    I'm having trouble setting the RTC up. What's the exact code you would use? I'm assuming it would be in the setup section... Thanks!
  3. wildblue # June 28, 2010, 5:32 p.m.

    To Display the Registervalues you have to send 'R' (uppercase r). The white and red cable have to be one position higher on the chip, The command 'i' will initialize the RTC. There are two errors in the Layout! -> The white cable must be on pin 17 on the RTC. -> The red cable must be on pin 18 on the RTC.
  4. wildblue # June 28, 2010, 5:47 p.m.

    A possibility to set the Weekday with command 'W' is missing here the missing case for the code: case 'W': if (adjust(6)) Serial.println("Weekday updated"); break;

Login to post a comment...
  • Print this
© 2007 - 2011 University of Applied Sciences Potsdam