Giter VIP home page Giter VIP logo

mcp7940's Introduction

License: GPL v3 Build Format Wiki Doxygen arduino-library-badge

MCP7940 library

Arduino library for accessing the Microchip MCP7940 real time clock. There are two versions of the RTC, MCP7940M and MCP7940N, which differ only in that the MCP7940N has a battery backup supply pin and keeps the clock running on power failure. The MCP7940N also has additional registers which store the timepoint of power failure and point in time when power was restored. In addition there are 3 more RTC chips, the MCP79400, MCP79401 and MCP79402 which are backwards compatible but include a special EEPROM storage for EUI address and these are also supported by this library

Overview

The MCP7940M, MCP7940N and MCP7940x datasheets describe the chip in detail. While there is no breakout board available for this RTC at the present time, it is not difficult to build into a project. The MCP7940 is available as a PDIP 8 pin which allows for easy use on a breadboard and the only additional parts necessary are a 32.768kHz crystal with 2 small capacitors (~6pF, depends upon circuit capacitance) and some pull-up resistors for the I2C data lines as well as for the multifunction pin, if that is to be used.

Features

Apart from performing as a real-time clock, the MCP4790 has 64 Bytes of SRAM storage available and features 2 separate alarms that can be set to be recurring or a single use. The alarm state can be checked using library functions or can pull down the the MFP (multi-function pin) for a hardware interrupt or other action. The MCP7940 allows for software trimming and the library has functions which support fine-tuning the RTC to increase accuracy.

Description

A detailed library description along with further details are available at the GitHub MCP7940 Wiki. This includes wiring information and sample sketches that illustrate the library and it's functionality.





Examples

Several example sketches exist and are documented on the Wiki pages

Example Program Description
SetAndCalibrate Set and Calibrate the RTC using various methods
SetAlarms Set Alarm 0 and Alarm 1
SquareWave Output a Square Wave
TestBatteryBackup Show how the battery backup can be used
AccessMemory Read and Write to the MCP7940 memory
RegressionTests Run regression test after changing library code

Documentation

The library and example programs have Doxygen documentation, whose output can be found at Doxygen Documentation

Supported Hardware

The following configurations have been compiled and/or tested. Travis-CI is used for automated continuous integration and testing.

Name Tested CPU Comments
Arduino UNO Yes ATMega328P
Arduino Mega Yes ATMega 2560
Arduino Micro Yes ATMega32U4
Arduino 1280 Yes ATMega1280
Arduino 328 Yes ATMega328
Arduino 168 Yes ATMega168

Zanshin Logo

mcp7940's People

Contributors

sv-zanshin avatar davidlehrian avatar per1234 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.