A Real-Time Clock (RTC) is an electronic device, typically in the form of an integrated circuit, that measures the passage of time and maintains accurate timekeeping even when the power supply to the device it's connected to is turned off or interrupted. RTCs are crucial for a variety of electronic devices, including personal computers, servers, embedded systems, and almost any device that requires keeping an accurate track of time.
The primary function of an RTC is to keep track of the current time and date, which it does by using a controller, oscillator, and an embedded quartz crystal resonator. This allows the RTC to maintain time with high accuracy and reliability, often required for applications where precise timekeeping is essential, such as in embedded systems, industrial automation, and computing.
RTCs differ from ordinary hardware clocks, which are merely signals governing digital electronics without counting time in human-readable units. They should not be confused with real-time computing, despite sharing the acronym RTC. Real-time clocks are designed to continue timekeeping through disruptive system states like hangs, sleep, reboots, or even full shutdowns, provided they have sufficient backup power.
Real-time clocks (RTCs) are integral components of many systems requiring timekeeping, even when power is off. They are engineered as all-in-one devices to provide better performance than discrete components, simplify integration in new designs, and accelerate time to market. An RTC often has its own internal oscillator with an external crystal and an option to use an external frequency reference, running at 32,768 Hz. This allows the use of very accurate and stable devices such as temperature-compensated crystal oscillators (TCXOs).
In terms of accuracy, typical crystal RTCs have specifications ranging from ±100 to ±20 parts per million. However, more advanced temperature-compensated RTC ICs can achieve accuracies of less than 5 parts per million. An RTC typically includes a backup battery or power source to ensure continuous operation and timekeeping during power outages. It interfaces with the system through low-level communication protocols like I2C or SPI, providing precise time and date information. Additional features of RTCs may include alarms, timers, and temperature sensors, which can be useful in various applications.
In modern computing, RTCs are indispensable as they serve as a reference point for other system tasks, ensuring synchronized operation and maintaining precise time even when the main power is off. They also contribute to energy savings by allowing devices to enter low-power modes while still keeping accurate time.