Nepedia
Back to Discover
Advanced Reader
💻

Real-time clock

technology Maturity 11-13 Next article →

A real-time clock, or RTC, is a specialized electronic device used to measure time in human units. Most often, these devices take the form of an integrated circuit, which is a tiny chip that holds many electronic parts. While many people associate RTCs with personal computers or servers, they are actually present in almost any electronic device that must maintain an accurate time of day. It is important to distinguish an RTC from ordinary hardware clocks. Standard hardware clocks only provide timing signals to govern digital electronics. They do not count time in units like minutes or hours. An RTC, however, provides a continuous and reliable record of time.

DS1307 1438A4 +102BN
DS1307 1438A4 +102BN

Using an RTC offers several technical advantages for a computer system. One primary benefit is reliability during disruptive system states. An RTC can maintain the current time during system hangs, reboots, or sleep modes. If the device is provided with sufficient backup power, the RTC can even keep time during a full hardware shutdown. This prevents the need for a user to reset the time every time the machine starts. RTCs are also designed for low power consumption. This makes them ideal for running on alternate power sources. Additionally, having a dedicated RTC frees up the main system processor to focus on time-critical tasks.

Types of RTC modules
Types of RTC modules

To keep time, most RTCs rely on a crystal oscillator. This component vibrates at a very specific and steady frequency. The most common frequency used is 32.768 kHz, which is the same rate used in quartz watches. This number is chosen because it is exactly 2 to the 15th power. This mathematical property makes it very convenient for simple binary counter circuits to process. The low frequency is efficient because it saves power while remaining above the range of human hearing. Most quartz crystals are used because their size does not change much with temperature. This stability ensures the frequency remains consistent. Some modern RTCs use a micromechanical resonator, or MEMS, built directly onto the silicon chip. While MEMS reduce cost and size, they are more sensitive to temperature changes.

Inside the Real-time clock IC vnutri u nei neonka
Inside the Real-time clock IC vnutri u nei neonka

Accuracy is a key specification for these devices. Typical crystal RTCs have an accuracy of ±100 to ±20 parts per million. In practical terms, this means they might gain or lose between 1.7 and 8.6 seconds per day. For even higher precision, temperature-compensated RTC ICs are available. These can be accurate to less than 5 parts per million, which is precise enough for celestial navigation. In 2011, a new level of precision arrived with chip-scale atomic clocks. These are much more expensive and power-hungry than standard crystals. While a standard RTC uses less than 1 microwatt of power, an atomic clock uses about 120 milliwatts. However, they are incredibly stable, keeping time within 50 parts per trillion.

The history of the RTC is closely tied to the evolution of the personal computer. The IBM PC/AT introduced the RTC to compatible computers in 1984. This specific model used a Motorola MC146818 RTC chip. Later, Dallas Semiconductor produced compatible versions that became very common. You can still find these on older motherboards today. They are easily identified by their distinctive black battery caps and silkscreened logos.

Realtimeclock Motherboard Baby AT crop
Realtimeclock Motherboard Baby AT crop

In modern computer architectures, the RTC is often integrated directly into the southbridge chip rather than being a separate component.

Some systems do not use a dedicated hardware chip at all. Instead, they use software-based RTCs. This is common in embedded systems that lack a built-in clock. Programmers can use the computer's existing hardware timers to mimic an RTC. These timers use quartz crystals to produce periodic interrupts, such as 50 Hz. Because these hardware timers can be slightly inaccurate, the software must perform complex math to adjust the time. The software tracks the rate of the clock and makes tiny adjustments, known as jitter, to maintain accuracy. This can involve using mathematical models like polynomials to compensate for temperature changes. For example, a 3rd-degree polynomial can characterize the rate changes in SC-cut crystals.

Finally, RTCs are part of a much larger global system for timekeeping. Many modern devices stay accurate by receiving time from external sources. For instance, cell phone protocols like LTE provide the current local time directly. Computers can also use the Network Time Protocol to sync with the internet. Some high-level local time servers use GPS or ultra-low frequency radio transmissions from national standards organizations. This connectivity ensures that even if a local clock drifts, the device can quickly return to the correct global time.

762 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (4)
File:Types of RTC modules.jpg
Types of RTC modules.jpg
File:Inside the Real-time clock IC vnutri u nei neonka.jpg
Inside the Real-time clock IC vnutri u...
File:Realtimeclock Motherboard Baby AT crop.jpg
Realtimeclock Motherboard Baby AT crop.jpg
File:DS1307 1438A4 +102BN.jpeg
DS1307 1438A4 +102BN.jpeg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.