What Is a Real-Time Clock (RTC)?
An RTC (Real-Time Clock) is a special timer chip that lets a device keep the date and time accurately even when power is lost.
How Does It Work?
Inside it there's usually a 32.768 kHz crystal; this frequency is divided down to count exact seconds. The RTC keeps the seconds-minutes-hours-day-month-year information in separate counters.
Why Is a Backup Battery a Must?
The clock must not stop even when the device is off. The RTC is powered by a small coin cell (e.g. a CR2032); when the main power goes, it keeps working for years on very little current.
| Property | Value |
|---|---|
| Crystal | 32.768 kHz |
| Backup | Coin cell |
| Interface | Usually I2C |
Connection to the MCU
An RTC mostly connects to the microcontroller over I2C. The MCU reads/sets the time; most RTCs also offer an alarm and a small persistent memory (EEPROM).
Where Is It Used?
Computers, data loggers, smart meters, clocks, alarm systems and every device that needs a timestamp.
Temperature Compensation and Accuracy
An ordinary RTC can drift by a few seconds a month because the crystal shifts with temperature. When high accuracy is needed, RTCs with a temperature-compensated crystal (TCXO) inside are used; these keep time far more precisely even over a wide temperature range.
Common Mistakes
- Skipping the backup battery: a battery-less RTC resets the clock when power is lost.
- Crystal load: a wrong load capacitance makes the clock run fast/slow.
- Temperature: for accuracy a temperature-compensated (TCXO) RTC can be chosen.
Frequently Asked Questions
Doesn't the MCU already keep time?+
Why 32.768 kHz?+
Search parts related to "What Is a Real-Time Clock (RTC)?"
Find the right part by comparing price, stock and distributors.