Skip to main content
The MCP79412 from Microchip Technology is a low-power, I²C-based real-time clock/calendar (RTCC) with integrated EEPROM, SRAM, and a unique ID. It provides highly accurate timekeeping (seconds, minutes, hours, day, date, month, year) and includes alarm functions, power-fail timestamping, and battery backup support, making it ideal for applications that require reliable time and date tracking.
Check the back of the RTC module: modules marked “M” use the MCP79412, while those marked “P” use the PCF8563.

Pin Configuration

  • VCC → VCC
  • GND → GND
  • CLK → SCK / Any GPIO
  • SDA → SDA
  • SCL → SCL
  • B → No connection / Internally connected to the 3V battery
Install a 3V Lithium Cell (CR1220) on the RTC module to retain time when the main circuit is powered off. The module can also operate without a battery if the circuit remains powered.

Key Features

  • I²C Interface (400 kHz Fast Mode)
  • Timekeeping: seconds, minutes, hours, day, date, month, year with leap year compensation
  • Two Alarms with programmable match options
  • Battery Backup with automatic switchover
  • Power-Fail Timestamp (records time of power loss)
  • 64 Bytes SRAM + 1 Kbit EEPROM (non-volatile storage)
  • Unique 64-bit ID (factory-programmed)
  • Digital Trimming for oscillator accuracy adjustment
  • Operating Voltage: 1.8V – 5.5V
  • Temperature Range: −40 °C to +85 °C (industrial)

Applications

  • Data loggers and metering systems
  • Security and access control devices
  • Consumer electronics (appliances, clocks, timers)
  • Automotive time-stamping and scheduling
  • Embedded systems requiring alarms, scheduling, or backup timekeeping

Step 1: Hardware Required

  1. Glyph Boards
  2. GMOD MCP79412 RTC

Step 2: Circuit Diagram

MCP79412-CIRCUIT-DIAGRAM

Step 3: Code Setup

  1. Open Arduino IDE.
  2. Make sure to install the library
  3. Copy and paste the following code into the Arduino IDE:

Step 4: Upload the Code

  1. Connect the Board
  • Connect your GLYPH board to your computer
  1. Select the Board and Port
Do the following settings in your Arduino IDE,
  • Tools > Board > esp32 > Pcbcupid GLYPH C3
For the Pcbcupid Glyph C3 to appear under Tools > Board > esp32, the esp32 board version installed in the Arduino IDE should be greater or equal to 3.1.0.
  • Tools > Port and select the port connected to your GLYPH.
  • Tools > USB CDC on Boot > Enabled
If USB CDC on BOOT not enabled, you won’t be seeing any serial data on Arduino IDE.
  1. Upload the Code
    • Click the upload button (➡️ icon) or use the shortcut CRTL + U in Arduino IDE to upload the code to the board.

Step 5: Observe the Output

The RTC module tracks time independently. With the onboard 3V Lithium Cell (CR1220), it continues timekeeping even when the GLYPH is powered off. MCP79412-result