Modified Arduino DS1307RTC library that also works for MCP7940N

in Arduino, code, components by the machinegeek | 6 comments

IMG_3832-300x225
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 in Arduino, code, components and tagged , , .

Comments

  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.

    [1] http://ww1.microchip.com/downloads/en/DeviceDoc/25010E.pdf

    • @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 Comment

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

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