Archive for the ‘Clocks’ Category

Checking clock accuracy

This T&T explains how to check the accuracy of a Real Time Clock (RTC). Lets make it a little bit harder and say that you do not have access to the Internet… Checking a RTC requires a highly accurate reference time base which can be read from a radio signal. Starting from there, two options […]

RTC Module (Part 7)

Part 1, 2, 3, 4, 5, 6, 7 Here are some new functions added to the PlainRTC libraries which drive the DS13x7, DS1306 and DS1394 series RTCs. These function are here to help in standardizing the date and time values to be recorded and read back by various applications for graphic reconstruction for example. Although I am getting more and more […]

RTC Module (Part 6)

Part 1, 2, 3, 4, 5, 6, 7 Here are some pieces of code which has been updated from my previous PlainRTC library. A new specific PlainRTC1394 has been created; this library is also compatible with the fully revamped PlainSPI. Firstly, lets have a look to the header file: /* PlainRTC1394 library, Real Time Clock driver library MAXIM DALLAS DS1394 driver Copyright […]

RTC Module (Part 5)

Part 1, 2, 3, 4, 5, 6, 7 In the previous posts, I described a MAXIM DALLAS DS1306 based module which proved to be easy to set up and to program. However, the DS1306 has one major drawback (and a minor one) which really puzzled me while wiring multiple SPI devices on the same port. Two from the four SPI modes are […]

RTC Module (Part 4)

Part 1, 2, 3, 4, 5, 6, 7 Encoder library + LCD libray + RTC library + some more code = MicroCLK! MicroCLK is a fancy little clock which displays time and date. It has a real basic (verybasic!) alarm function. The application is menu driven: hour, minute, seconds, day, month, year, alarm hour, alarm minute, alarm activation/deactivation. The hardware is limited […]

RTC Module (Part 3)

Part 1, 2, 3, 4, 5, 6, 7 Now that we have the hardware and the routines and functions ready, let’s apply them to a simple application. This one will print “tic”, wait half a second, print “tac” followed by the second index. (Real nutty stuff :-[) void loop() { int pinState = ((PINB >> oneHertzPin) & 0x01); if (lastPinState != pinState) […]

RTC Module (Part 2)

Part 1, 2, 3, 4, 5, 6, 7 After the hardware description of the module, I will describe here the code required for driving it with Arduino. Firstly, we need to establish a SPI communication between Arduino (the master) and DS1306 (the slave). And here is the initialization routine for the SPI void spi_init(void) { // Initialize SPI port // Input pin […]

RTC Module (Part 1)

Part 1, 2, 3, 4, 5, 6, 7 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 […]