Comparison of four real-time clocks

SwitchDoc Note

These graphs were generated using MatPlotLib on the Raspberry Pi. If you want to see another example of how to do this using a MySQL database using time as the x axis, check out the SwitchDoc site [3]; you can also see how to put these graphs on your control panel using RasPiConnect [4].

After looking at all the data and creating the graphs, I can generate a table of the accuracy results (Table 2). Note that with RTCEval.py, I can only detect 1/3 of a ppm at 3 million seconds. Hence, the DS3231 is rated at <0.3ppm. It could be better than that. The MCP79400 was 4ppm, but rock solid. It could be trimmed by the use of the internal trimming register to do better.

Table 2

The ppm Error Table

Device

Test Length (seconds)

Measured ppm

Specification ppm

DS1307

292,869

15

23

DS3231

3,432,851

<0.3

2

PCF8563

3,432,851

24

29

MCP79400

3,432,851

4

Not given directly

Comments on Each Device

The most accurate device out of the box was clearly the DS3231. It is the only one that is temperature compensated. This is the device that I have chosen to replace the flaky DS1307 in the Project Curacao box. Based on my charts, if you are willing to apply a trim to the device, you could improve the MCP79400 substantially. Because the line for the PCF8563 was virtually straight in Figure  5, you could provide a time adjustment, for example, every 24 or 48 hours by software to keep it in line.

All of these devices are definitely usable. Each has different features that may prove to be important, such as interrupts, additional storage, or trim registers.

Buy this article as PDF

Express-Checkout as PDF

Pages: 6

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content