Modified Arduino DS1307RTC library that also works for MCP7940N

Posted on Monday, December 23rd, 2013 in Arduino, code, components by the machinegeek

Ray writes, “When your project needs a real-time clock (RTC), don’t you hate that the popular DS1307 costs several dollars? I recently came across Microchip’s MCP7940N, which is an inexpensive alternative to DS1307. On the hardware side it is pretty much a drop-in replacement (although Microchip recommends adding several extra elements). The software requires a few modifications. In this blog post I describe how to modify an existing Arduino DS1307RTC library to provide support for both chips.”

For more information as well as the code download link, visit Ray Hobby blog.

Via the contact form.

This entry was posted on Monday, December 23rd, 2013 at 12:34 am and is filed under Arduino, code, components. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

6 Responses to “Modified Arduino DS1307RTC library that also works for MCP7940N”

  1. Oliver says:

    no caps near the crystal?

  2. Oliver says:

    Nope, the datasheet [1] on page 2? suggests to put 2 caps there.

    Page 16 has a recommended board layout also placing them appropriately. Values are left for the reader to find in the ‘text’, but 10pF + 12pF (or + 8pF depending on the crystal cap.) is recommended.


    • @matseng says:

      You are right according to the 2011-2013 datasheet. I was looking at the 2011 datasheet that was the first hit Google returned for me. (Can be found at the same url but named 25010A instead of 25010E)

      In that there was no mentions of external caps or example schematics/layouts.

      So the morale of this is “Don’t trust Google to return the newest datasheet” :)

  3. Oliver says:

    Heh, I didn’t even realiase there where multiple versions :p

    So where’s the caps! :p

    • Ray Wang says:

      The picture shown is a circuit that originally had a DS1307 RTC installed, which does not need load capacitor. As I described in the post, I used MCP7940N as a quick drop-in replacement, so you won’t see the caps. For reliability the caps should probably be added.

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Recent Comments

  • KH: Well, I'm sure the HDD can handle a little vibration *cough*. What I am more interested in is this: the fan appears to be placed...
  • Alan: The Si5351 runs on 3.3V, and several FPGA dev boards now include "Arduino compatible" headers [if you stick to 3.3V logic levels]. Maybe it's time...
  • hli: Sunday++
  • JB: Hi
  • Peter: Sunday