Modified Arduino DS1307RTC library that also works for MCP7940N

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.

Join the Conversation


    1. 32KHz crystals normally need a load cap of like only 12pF, that is probably already taken care of in the chip….

    1. 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” :)

    1. 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 comment

Leave a Reply to @matseng Cancel reply

Your email address will not be published. Required fields are marked *

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