RTC Module (Part 1)
Let’s introduce today a new hardware module for Arduino, based on the very popular Maxim-Dallas DS1306 RTC. The choice of this RTC amongst the long list of available chips is driven by multiple reasons.
Firstly, it’s free. Well, almost free. You can get it for free as a sample from Maxim-Dallas. Second it is SPI (or 3 wires) compatible, which makes it compatible with my SD card module, as an additional module on a SPI bus. Third reason, it has versatile backup battery configurability, with a built in switch and memory protection. And at last, it has multiple convenient outputs such as complementary interrupts, 32 kHz and 1 Hz signals. Datasheet here.
Note: The jumper allows SPI/3 wire configuration (SERMODE)
Here is the schematic of the module: it is as basic as a schematic can be, with one chip (DS1306), one crystal (32768 Hz) and a 3 V Lithium Battery.
I did not have a battery holder in my scrap box, so that I made one with nickel wire. Isn’t it cute?
And here is the module attached to an Arduino Diecimila
Coming next: RTC module driver
Hello,
Great work! I’m working on a datalogging application and your posts are saving my life.
But I have a question: in case I have more than the DS1306 on my SPI bus, how can I select the slave? and how should I change the code?
Thanks and keep the good work!
SunnyBoy
Data logging is one pf my primary interest thus the content of the posts so far!
Selecting the DS1306 is piece of cake: turn the CE mline ON (+5V) before talking to the RTC and relaseit to OFF (GND) on completion of the exchange of data.
Problem is that most of my other SPI devices use CS(bar) which is ground true logic. This is the reason why I moved to the DS1394 RTC…
Another question: you design is quite different thatn the reference design my maxim: http://www.maxim-ic.com/images/qv/2687.gif
See pins 5, 7, 9, 10, 12, 13.
ok I found answers for 5 and 7, but not the others…
sorry for polluting this post with my comments, I’m a beginner :p
Q: “ok I found answers for 5 and 7, but not the others…”
R: Your picture shows the DS1306 wired in 3 wires SPI configuration, where data flow in both ways. The configuraton that I am using is 4 wires with separate Data In and Data Out. Pin 9 (SERMODE) must be biased accordingly to this configuration.
Read my previous comment on RTC and seriously consider the choice for DS1394 RTC which shall be much easier to implement in a multi SPI devices configuration.
HTH