Electronics Design AU
ComponentsFirmware

What Is an External Real-Time Clock (RTC) IC, and When Do You Need One?

Last updated 7 July 2026 · 8 min read

Direct Answer

An external RTC (real-time clock) IC is a dedicated timekeeping chip — such as the Maxim/Analog Devices DS3231 or NXP PCF8563 — that maintains the current date and time, continues counting through a system power-down on a small backup battery, and reports the time to a host MCU over I2C (or SPI, on some parts). You need one instead of relying on an MCU's internal RTC peripheral when: the MCU has no internal RTC (many mid-range and simpler MCUs don't); the product needs to keep accurate time across a period where the main MCU is fully unpowered and its own battery-backup domain isn't practical to design; or the application needs better long-term accuracy than a bare 32.768 kHz crystal on the MCU's RTC input provides — the DS3231 in particular integrates a temperature-compensated crystal oscillator (TCXO) giving typically ±2 ppm accuracy, versus the tens of ppm typical of an uncompensated crystal, without any extra design effort.

Detailed Explanation

Real-time clocks are referenced constantly across this site's MCU power-management pages — STM32's backup domain, ESP32's RTC memory and RTC GPIOs, the 32.768 kHz "watch crystal" every crystal-selection guide mentions — but all of that coverage is about the RTC peripheral built into the MCU itself. A dedicated external RTC IC is a different, complementary component: a standalone chip whose entire job is timekeeping, backed by its own small battery, that a host MCU reads over a bus. This page covers that component category directly: how it works, the two mainstream parts that anchor most designs, the backup-battery circuit that makes it useful, and when it's the right choice over the MCU's own RTC peripheral.

How an External RTC IC Works

An RTC IC contains a crystal oscillator (either built in, or driven by an external 32.768 kHz crystal), a chain of counters that convert oscillator ticks into seconds, minutes, hours, day-of-week, date, month, and year, and a register interface — almost always I2C, sometimes SPI — that a host MCU reads and writes those values through. A separate backup-supply pin (commonly labelled VBAT) lets a coin cell or supercapacitor power just the oscillator and counters when the chip's main supply is removed, so the clock keeps running and the current time survives even through a full power-down or battery-swap of the host system. Most parts also include one or two programmable alarm registers and an interrupt output pin, letting the RTC wake a sleeping MCU at a specific time or interval without the MCU's own timer needing to run continuously.

Two Anchor Parts: DS3231 and PCF8563

DS3231 (Analog Devices, formerly Maxim): Integrates its own crystal and a temperature-compensated crystal oscillator (TCXO) circuit inside the package, so no external crystal is needed and no board-level compensation design is required. Per the manufacturer's datasheet, typical accuracy is ±2 ppm from 0°C to +40°C, widening to typically ±3.5 ppm across the full −40°C to +85°C range — meaningfully better than an uncompensated 32.768 kHz crystal, whose typical ±20 ppm tolerance corresponds to roughly a minute of drift per month. This accuracy comes at the cost of higher quiescent current on VBAT than simpler parts, which matters for very long coin-cell battery life targets.

PCF8563 (NXP): A lower-cost, lower-power RTC that requires its own external 32.768 kHz crystal (typically a small tuning-fork crystal, similar to the ones covered in crystal oscillator selection) and has no built-in temperature compensation — its long-term accuracy is set entirely by that crystal's own tolerance and the board's temperature environment. It draws meaningfully less current on backup power than the DS3231, which suits coin-cell-powered products where multi-year backup life matters more than absolute timekeeping accuracy.

Other common parts follow the same two archetypes: the MCP7940 (Microchip) is a PCF8563-class external-crystal part with a particularly well-documented battery-switchover circuit in its own datasheet; the DS1307 (an older, lower-accuracy predecessor to the DS3231 family) still appears in legacy designs and hobbyist modules but has no temperature compensation and a comparatively higher backup current draw than current-generation parts.

The I2C Interface and Register Map

RTC ICs in this class present the time and date as a small block of registers, almost universally encoded in BCD (binary-coded decimal) rather than plain binary — a "37 seconds" value is stored as the byte 0x37, not 0x25 — a detail worth checking against the specific datasheet before writing conversion code, since getting this wrong produces a time reading that looks superficially plausible but is wrong by a consistent, confusing offset. Reading the time is a straightforward I2C register-block read; setting it is the same block written once at commissioning (or after any backup-battery replacement that resets the chip, on parts without a backup supply already installed). Alarm registers on both parts support matching against seconds, minutes, hours, and day, letting firmware arm a "wake at this time" or "wake every day at this time" condition and take an interrupt on the dedicated INT/SQW output pin — commonly wired to an EXTI-capable GPIO so the host MCU can stay in a deep sleep mode (see STM32 low-power modes and ESP32 deep sleep and power management for the MCU-side wake-source handling this pairs with) until the RTC actually needs it awake.

The Coin-Cell Backup Circuit

The backup-battery circuit is the part of an RTC IC design most likely to go wrong, and most datasheets dedicate a full application-circuit section to it for exactly that reason:

  • Do not enable trickle charging into a non-rechargeable coin cell. Parts like the DS3231 include an optional internal trickle-charge circuit intended for a rechargeable backup cell or supercapacitor — leaving it disabled (the typical default state) is the correct choice for a standard CR2032-class non-rechargeable coin cell. Attempting to charge a non-rechargeable cell is unsafe and can cause venting or leakage.
  • Add a series diode between the coin cell and the backup pin on designs that don't rely on the IC's own internal switchover logic, so the main supply can never back-feed current into the battery, and so a discharged main supply can't pull current out of the backup cell through an unintended path.
  • Size the expected backup current against the datasheet's VBAT current spec, not the chip's active-mode current. The current draw while running from backup power on VBAT alone is typically orders of magnitude lower than the IC's active supply current, but it's the number that actually determines coin-cell life — a DS3231's higher backup current relative to a PCF8563's translates directly into a shorter achievable backup-battery life for the same cell capacity, which matters when the backup power is expected to last years rather than months.

Design Considerations

  • Match the part's accuracy to what the product actually needs. A data logger that resynchronises from an NTP server, a GNSS fix (see GNSS/GPS module integration), or a cellular network on every boot only needs the RTC to hold a plausible time between resyncs — a PCF8563-class part is adequate. A standalone device that must keep correct time for weeks or months between any external time reference needs the DS3231's integrated temperature compensation.
  • Decide backup power source deliberately. A CR2032 coin cell gives the longest calendar life for the lowest board area at the cost of being a non-rechargeable, user-serviceable part; a supercapacitor charged from the main supply avoids a serviceable battery entirely but only bridges outages measured in days to weeks, not years, and needs its own charge-time budget accounted for at first power-up.
  • Confirm the RTC IC's I2C address doesn't collide with another device already on the same bus — most parts in this class use a fixed, non-configurable I2C address, so an address conflict can only be resolved with an I2C bus multiplexer or by moving the RTC to a second bus, not by reconfiguring the RTC itself.
  • Pull up the INT/SQW output correctly. This pin is typically open-drain on both the DS3231 and PCF8563, requiring an external pull-up resistor to the MCU's I/O supply rail — a design that omits this pull-up sees an interrupt line that never actually asserts.

Common Mistakes

  • Forgetting to set the initial time at first power-up. A brand-new RTC IC (or one whose backup battery was fully depleted or never installed) does not know the current date and time — firmware must explicitly write a valid initial time during first commissioning, typically detected by checking the chip's oscillator-stop or power-fail flag rather than assuming the time register contents are meaningful.
  • Assuming an uncompensated RTC (PCF8563-class) will hold accurate time indefinitely without resync. Without temperature compensation, real-world drift is dominated by the crystal's own tolerance and the ambient temperature it actually experiences — a part that tests accurately on the bench at room temperature can drift noticeably once deployed in a hot enclosure or outdoor environment.
  • Enabling a trickle-charge feature against the wrong battery type. Reviewing the schematic against the actual installed battery — rechargeable or not — before enabling any trickle-charge configuration bit is a simple check that prevents a real safety issue.
  • Treating the RTC IC as a substitute for the MCU's own internal RTC peripheral in every design. Where the MCU already has an adequate internal RTC and backup domain, and the accuracy of a plain crystal is sufficient for the application, adding an external RTC IC is unnecessary board cost and complexity — the two options solve overlapping but not identical problems, and the better choice depends on the accuracy, backup-power, and MCU-availability factors covered above, not a default assumption either way.

Zeus Design's embedded engineering team designs timekeeping and battery-backup circuits — RTC selection, coin-cell trickle-charge protection, and low-power wake-source integration — as part of complete embedded product development.

Frequently Asked Questions

Do I still need an external RTC IC if my MCU has a built-in RTC peripheral?
Often not — an MCU's internal RTC peripheral, driven by an external 32.768 kHz crystal and kept alive through a backup domain (VBAT pin plus a coin cell or supercap), does the same job with one fewer I2C device on the board. Where an external RTC IC still earns its place: the accuracy of a bare crystal is typically tens of ppm (drifting minutes per month) unless the design adds its own temperature compensation, which a TCXO-integrated part like the DS3231 provides out of the box; the MCU's backup-domain design (VBAT sequencing, brownout behaviour while running from the coin cell alone) is itself nontrivial engineering that an external RTC IC, designed specifically for this role, has already solved; and some product architectures fully power down or even physically remove the main MCU (a swappable compute module, a board that gets reprogrammed with a different MCU across product revisions) where timekeeping needs to survive independent of whichever MCU is present.
What is the difference between the DS3231 and PCF8563?
The DS3231 integrates its own 32.768 kHz crystal and a temperature-compensated oscillator circuit inside the package, giving typically ±2 ppm accuracy from 0°C to +40°C (widening to typically ±3.5 ppm across the full industrial temperature range, per the manufacturer's datasheet) with no external crystal and no compensation design work required — at the cost of higher quiescent current and unit price than a simpler part. The PCF8563 is a lower-cost, lower-power RTC that requires its own external 32.768 kHz crystal and has no built-in temperature compensation, so its accuracy is set by that crystal's own tolerance (commonly ±20 ppm or worse, drifting on the order of a minute or more per month) — acceptable for applications like data-logging timestamps or a display clock where occasional resynchronisation (e.g. from a network time source) corrects any drift, but not for applications needing standalone long-term accuracy.
Can I connect a rechargeable battery or supercapacitor directly to an RTC IC's backup pin?
Only if the specific IC's trickle-charge feature is intentionally enabled for that purpose, and only with a battery or supercap the manufacturer's trickle-charge circuit is rated for — check the datasheet before connecting anything rechargeable. Connecting a non-rechargeable coin cell (a standard CR2032) to a backup pin with trickle-charging enabled will attempt to charge it, which is unsafe and can vent or leak the cell. Most designs using a non-rechargeable coin cell should leave any trickle-charge feature disabled (the default state on parts like the DS3231) and add a series diode from the cell to the backup pin, both to prevent any reverse current path and to block the main supply from ever back-feeding into the cell during normal operation.

References

Related Questions

Related Forum Discussions