ArticleslgStudy

engineering

Real-time clock

Real-time clock is a engineering topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Real-time clock rather than just read about it. In short: A real-time clock (RTC) is an electronic timekeeping device, most often in the form of an integrated circuit (IC). Although the term often refers to the devices in personal computers, servers and embedded systems, RTCs are present in almost any electronic device that needs to keep accurate time of day.

Real-time clock — main illustration
Real-time clock — illustration

Key takeaways

  • Real-time clock belongs to engineering; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Real-time clock to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Real-time clock from memory before moving on to harder problems.

Reference excerpt

A real-time clock (RTC) is an electronic timekeeping device, most often in the form of an integrated circuit (IC). Although the term often refers to the devices in personal computers, servers and embedded systems, RTCs are present in almost any electronic device that needs to keep accurate time of day.

Terminology The term real-time clock is used to avoid confusion with ordinary hardware clocks, which are only signals that govern digital electronics, and do not count time in human units. RTC should not be confused with real-time computing, which shares its three-letter acronym but does not directly relate to time of day.

Purpose Although keeping time can be done without an RTC, using one has benefits:

Reliably maintains and provides current time through disruptive system states such as hangs, sleep, reboots, or if given sufficient backup power, full shutdown and hardware reassembly, without the need to have its time set again. Low power consumption (important when running from alternate power) Frees the main system for time-critical tasks Sometimes more accurate than other methods A GPS receiver can shorten its startup time by comparing the current time, according to its RTC, with the time at which it last had a valid signal. If it has been less than a few hours, then the previous ephemeris is still usable. Some motherboards are made without RTCs. The RTC may be omitted out of a desire to save money or reduce possible sources of hardware failure.

Power source

RTCs often have an alternate source of power, so they can continue to keep time while the primary source of power is off or unavailable. This alternate source of power is normally a lithium battery in older systems, but some newer systems use a supercapacitor, because they are rechargeable and can be soldered. The alternate power source can also supply power to battery backed RAM.

Timing Most RTCs use a crystal oscillator, but some have the option of using the power line frequency. The crystal frequency is usually 32.768 kHz, the same frequency used in quartz clocks and watches. Being exactly 215 cycles per second, it is a convenient rate to use with simple binary counter circuits. The low frequency saves power, while remaining above human hearing range. The quartz tuning fork of these crystals does not change size much with temperature, so temperature does not change its frequency much. Some RTCs use a micromechanical resonator on the silicon chip of the RTC. This reduces the size and cost of an RTC by reducing its parts count. Micromechanical resonators are much more sensitive to temperature than quartz resonators. So, these compensate for temperature changes using an electronic thermometer and electronic logic. Typical crystal RTC accuracy specifications are from ±100 to ±20 parts per million (8.6 to 1.7 seconds per day), but temperature-compensated RTC ICs are available accurate to less than 5 parts per million. In practical terms, this is good enough to perform celestial navigation, the classic task of a chronometer. In 2011, chip-scale atomic clocks became available. Although vastly more expensive and power-hungry (120 mW vs. <1 μW), they keep time within 50 parts per trillion (5×10−11).

Examples

Many integrated circuit manufacturers make RTCs, including Epson, Intersil, IDT, Maxim, NXP Semiconductors, Texas Instruments, STMicroelectronics and Ricoh. A common RTC used in single-board computers is the Maxim Integrated DS1307. The RTC was introduced to PC compatibles by the IBM PC/AT in 1984, which used a Motorola MC146818 RTC. Later, Dallas Semiconductor made compatible RTCs, which were often used in older personal computers, and are easily found on motherboards because of their distinctive black battery cap and silkscreened logo. A standard CMOS interface is available for the PC RTC. In newer computer systems, the RTC is integrated into the southbridge chip. Some microcontrollers have a real-time clock built in, generally only the ones with many other features and peripherals.

Radio-based RTCs Some modern computers receive clock information by digital radio and use it to promote time standards. There are two common methods: Most cell phone protocols (e.g., LTE) directly provide the current local time. If an internet radio is available, a computer may use the network time protocol. Computers used as local time servers occasionally use GPS or ultra-low frequency radio transmissions broadcast by a national standards organization (i.e. a radio clock).

Software-based RTCs

The following system is well-known to embedded systems programmers, who sometimes must construct RTCs in systems that lack them. Most computers have one or more hardware timers that use timing signals from quartz crystals or ceramic resonators. These have inaccurate absolute timing (more than 100 parts per million) that is yet very repeatable (often less than 1 ppm). Software can do the math to make these into accurate RTCs. The hardware timer can produce a periodic interrupt, e.g., 50 Hz, to mimic a historic RTC (see below). However, it uses math to adjust the timing chain for accuracy:

t i m e = t i m e + r a t e {\displaystyle time=time+rate}

… excerpt ends here. Continue reading the full article.

Illustrations

Real-time clock: Dallas Semiconductor DS1287 real-time clock manufactured in 1988
Dallas Semiconductor DS1287 real-time clock manufactured in 1988
Real-time clock: Types of hobbyist RTC modules commercially available from China
Types of hobbyist RTC modules commercially available from China
Real-time clock: Lithium battery inside the real-time clock IC
Lithium battery inside the real-time clock IC
Real-time clock: Dallas Semiconductor (DS1387) real-time clock from an older PC. This version also contains a battery-backed SRAM.
Dallas Semiconductor (DS1387) real-time clock from an older PC. This version also contains a battery-backed SRAM.
Real-time clock: Dallas DS1307 RTC chip in DIP-8 package
Dallas DS1307 RTC chip in DIP-8 package

Worked examples

Example 1 — a first encounter with Real-time clock

Start with the simplest possible case. Write down what Real-time clock claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In engineering, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Real-time clock before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Real-time clock ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Real-time clock

In research
Real-time clock appears in engineering research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Real-time clock in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Real-time clock is common in secondary-school and first-year university syllabi. It links to neighbouring topics Clocks, Integrated circuits, Real-time clocks, so understanding it makes those chapters shorter.
In everyday life
Look for Real-time clock outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Real-time clock in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Real-time clock means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Real-time clock out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Real-time clock in simple terms?

A real-time clock (RTC) is an electronic timekeeping device, most often in the form of an integrated circuit (IC). Although the term often refers to the devices in personal computers, servers and embedded systems, RTCs are present in almost any electronic device that needs to keep accurate time of…

Why does Real-time clock matter?

Because it connects several engineering ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Real-time clock?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Real-time clock.

Tags

  • Clocks
  • Integrated circuits
  • Real-time clocks

Keep exploring