Real-time clock
Clash Royale CLAN TAG#URR8PPP
A real-time clock (RTC) is a computer clock (most often in the form of an integrated circuit) that keeps track of the current time.
Although the term often refers to the devices in personal computers, servers and embedded systems, RTCs are present in almost any electronic device which needs to keep accurate time. A common RTC used in single-board computers is the Maxim Integrated DS1307.
Contents
1 Terminology
2 Purpose
3 Power source
4 Timing
5 Examples
5.1 Radio-based RTCs
5.2 Historic RTCs
6 Clockless CPUs
7 See also
8 References
9 External links
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,[1] using one has benefits:
- Low power consumption[2] (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.[3] If it has been less than a few hours, then the previous ephemeris is still usable.
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,[4][5] because they are rechargeable and can be soldered. The alternate power source can also supply power to battery backed RAM.[6]
Timing
Most RTCs use a crystal oscillator,[7][8] but some have the option of using the power line frequency.[9] In many cases, the oscillator's frequency is 32.768 kHz.[7] This is the same frequency used in quartz clocks and watches, and for the same reasons, namely that the frequency is exactly 215 cycles per second, is a convenient rate to use with simple binary counter circuits.
Many commercial RTC ICs are accurate to less than 5 parts per million.[10] In practical terms, this is good enough to perform celestial navigation, the classic task of a chronometer. In 2011, Chip-scale atomic clocks were invented. Although more expensive, they keep time within 100 nanoseconds.[11]
Examples
Many integrated circuit manufacturers make RTCs, including Epson, Intersil, IDT, Maxim, NXP Semiconductors, Texas Instruments, STMicroelectronics and Ricoh.
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.
In newer systems, the RTC is integrated into the southbridge chip.[12]
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[13] or ultra-low frequency radio transmissions broadcast by a national standards organization (i.e. a radio clock[14]).
Historic RTCs
Some older computer designs such as Novas and PDP-8s[15] used a real-time clock that was notable for its high accuracy, simplicity, flexibility and low cost. The computer's power supply produces a pulse at logic voltages for either each half-wave or each zero crossing of AC mains. A wire carries the pulse to an interrupt. The interrupt handler software counts cycles, seconds, etc. In this way, it can provide an entire clock and calendar.
The clock also usually formed the basis of computers' software timing chains; e.g. it was usually the timer used to switch tasks in an operating system. Counting timers used in modern computers provide similar features at lower precision, and may trace their requirements to this type of clock. (e.g. in the PDP-8, the mains-based clock, model DK8EA, came first, and was later followed by a crystal-based clock, DK8EC.)
A software-based clock must be set each time its computer is turned on. Originally this was done by computer operators. When the Internet became commonplace, network time protocols were used to automatically set clocks of this type.
In Europe, North America and some other grids, this RTC works because the frequency of the AC mains is adjusted to have a long-term frequency accuracy as good as the national standard clocks. That is, in those grids this RTC is superior to quartz clocks and less costly.
This design of RTC is not practical in portable computers or grids (e.g. in South Asia) that do not regulate the frequency of AC mains. Also it might be thought inconvenient without Internet access to set the clock.
Clockless CPUs
Some motherboards are made without real time clocks. The real time clock is omitted either out of the desire to save money (as in the Raspberry Pi system architecture) or because real time clocks may not be needed at all (as in the Arduino system architecture).
See also
- High Precision Event Timer
- IRQ 8
- Real-time clock alarm
- System time
- Timer
- Wall-clock time
- Time formatting and storage bugs
References
^ Ala-Paavola, Jaakko (2000-01-16). "Software interrupt based real time clock source code project for PIC microcontroller". Archived from the original on 2007-07-17. Retrieved 2007-08-23..mw-parser-output cite.citationfont-style:inherit.mw-parser-output .citation qquotes:"""""""'""'".mw-parser-output .citation .cs1-lock-free abackground:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration abackground:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center.mw-parser-output .citation .cs1-lock-subscription abackground:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registrationcolor:#555.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration spanborder-bottom:1px dotted;cursor:help.mw-parser-output .cs1-ws-icon abackground:url("//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png")no-repeat;background-position:right .1em center.mw-parser-output code.cs1-codecolor:inherit;background:inherit;border:inherit;padding:inherit.mw-parser-output .cs1-hidden-errordisplay:none;font-size:100%.mw-parser-output .cs1-visible-errorfont-size:100%.mw-parser-output .cs1-maintdisplay:none;color:#33aa33;margin-left:0.3em.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-formatfont-size:95%.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-leftpadding-left:0.2em.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-rightpadding-right:0.2em
^ Enabling Timekeeping Function and Prolonging Battery Life in Low Power Systems, NXP Semiconductors, 2011
^ US 5893044 Real time clock apparatus for fast acquisition or GPS signals
^ New PCF2123 Real Time Clock Sets New Record in Power Efficiency, futurle
^ Application Note 3816, Maxim/Dallas Semiconductor, 2006
^ Torres, Gabriel (24 November 2004). "Introduction and Lithium Battery". Replacing the Motherboard Battery. hardwaresecrets.com. Archived from the original on 24 December 2013. Retrieved June 20, 2013.
^ ab Application Note 10337, ST Microelectronics, 2004, p. 2
^ Application Note U-502, Texas Instruments, 2004, p. 13
^ Application Note 1994, Maxim/Dallas Semiconductor, 2003
^ "Highly Accurate Real-Time Clocks". Maxim Semiconductors. Retrieved 20 October 2017.
^ "Chip Scale Atomic Clock". Microsemi. Retrieved 20 October 2017.
^ "ULi M1573 Southbridge Specifications". AMDboard.com. Retrieved 2007-08-23.
^ "GPS Clock Synchronization". Spectracom. Retrieved 20 October 2017.
^ "Product: USB Radio Clock". Meinburg. Retrieved 20 October 2017.
^ Digital Equipment Corp. "PDP-8/E Small Computer Handbook, 19" (PDF). Gibson Research. pp. 7–25, the DK8EA. Retrieved 12 November 2016.
External links
Media related to Real-time clocks at Wikimedia Commons