Real time clock

from Wikipedia, the free encyclopedia

A real-time clock ( English real-time clock , RTC ) or physical clock is a clock which the physical time measures. In contrast, a logical clock measures a relative time that does not correspond to the current time. In the field of electrical engineering or technical IT , a real-time clock is part of a computer-controlled device or the operating system and keeps the time. Precautions are taken so that the time is available again when the device is switched on again. In particular, a real-time clock is a circuit which can update the time (by means of its own energy storage device, such as a battery) even when the device is switched off.

Types

Hardware clock

Real-time clock type OEC12C887A from ODIN with integrated quartz in the housing and integrated battery (on a circuit board in a PC)
typical Dallas chip DS12887

The functionality is basically similar to a digital - quartz circuit. A counter is running, clocked by a quartz crystal. A connected microprocessor or controller then reads out the register statuses in order to process them further.

A hardware clock is a chip that essentially contains counter registers and a clock crystal as a clock . The counter is increased with every cycle of the frequency generator. To keep the counters simple, a clock frequency of 32,768 Hz is often chosen. In this way, a frequency of 1 Hz can be generated as a second cycle in a simple manner by repeatedly halving . So that the clock does not stop when the device is switched off, the chip is constantly supplied by an energy store, i.e. a battery or a rechargeable battery. The oscillating crystals required are often clock crystals and are produced in very large numbers and are therefore particularly inexpensive. In addition, CMOS circuits are particularly power-saving at such low frequencies, which is important for the service life of the battery or the battery charge.

Software clock

With a software clock , the clock signal comes from the hardware via an interrupt request , the counter is managed by the operating system (i.e. the software ) and converted into date and time. The condition that the clock continues to run when the device is switched off is therefore not given. The software clock must first be synchronized after switching on. It is synchronized with the hardware clock or continuously with a  time server  .

In a PC, the operating system continues to work exclusively with the software clock after booting. If the time is changed in the operating system by the user or by a time server, the hardware clock, often referred to as the BIOS clock, is also changed by the operating system. The  time of  the real-time clock initially only consists of a counter reading (mostly in seconds since the  Unix era ). The conversion into a form understandable for humans, as well as the inclusion of  time zones  and  leap years  is done by the operating system. However, many clock chips contain registers that update the time in the format that people are used to (seconds, minutes, hours, day, month, year (often only two digits), day of the week). Simple microcontroller systems can work directly with these values. In more complex systems (such as operating systems), however, the read-out values ​​are usually converted into a seconds format (such as the Unix time), which is only converted back into a human-understandable format when it is output.

There are different approaches to synchronize the real-time clock of a computer or a microcontroller system with the actual time. If access to the Internet is available, the most common method is to request the time from one or more time servers and, in addition, to compensate for the delay caused by the transmission time through skillful conversions. See Cristian's Algorithm , Berkeley Algorithm and the Network Time Protocol . Other possibilities are to evaluate the signal of a time signal transmitter (e.g. DCF77 ) or to let the user set the clock manually.

Alternative circuit

In some devices, in order to save the crystal and the battery, the frequency of the mains voltage is used as a time reference. It is capacitively decoupled between the transformer and the rectifier and divided every second (/ 50 or / 60 depending on the mains frequency ). Here, too, the clock usually does not continue to run when the device is switched off. Possibly. power failures are bridged by an imprecise and drifting RC oscillator, provided this sub-circuit is implemented.

Applications

The most common and well-known application is the PC. This is the combination of software clock and hardware clock described above. The first home computers in the 1980s did not have a real-time clock, just a logical clock .

Other applications are various electronic household appliances such as radio alarm clocks , microwave ovens , control units for heating systems .

Other features of the internal PC clock

In PCs, the battery backup is usually carried out with button cells in the form of a replaceable lithium cell (3 V) of the CR2032 type in a socket on the main board . In older motherboards, batteries consisting of three nickel-cadmium cells (3.6 V) were used for this purpose . Depending on the application, the supply is also made from a double-layer or supercapacitor.

A so-called NVRAM is also housed on the current clock chips , which is also constantly fed (“buffered”) from the power source. In PCs, this NVRAM is used to maintain the basic firmware settings ( called BIOS settings on older devices and the clock is therefore also called the BIOS clock ). For a while, a clock module with an integrated battery was also installed (" Dallas chip "), which made replacement difficult or impossible.

If the clock does not continue to run when the PC is switched off or if it is even set back to the past, the battery on the mainboard is often empty. In a notebook , this only occurs when the battery is discharged or removed, since the battery also buffers the NVRAM. Occasionally, the BIOS battery in the notebook is also designed as a rechargeable battery .

Part of the year 2000 problem with PCs was caused by the fact that the clock module still used in older devices could not automatically change the date to the century, which was not automatically corrected by the BIOS , MS-DOS or Windows 98 .

Web links

Commons : real-time clock  - collection of pictures, videos and audio files

Individual evidence

  1. Synonyms in thesaurus. Retrieved August 12, 2017 .
  2. Real-time clock / ELVjournal. ELV Elektronik AG, accessed on August 12, 2017 .
  3. The hardware clock. Technical University of Braunschweig, accessed on August 12, 2017 .
  4. DS12885 / 87. Maxim Integrated, April 2010, accessed August 12, 2017 .
  5. Time FAQ. beagle software, March 19, 2008, accessed August 6, 2017 (English, wwwwwwd).
  6. Forum. March 8, 2013, accessed August 6, 2017 .
  7. Benedikt Wirmer: Digital clock with standard logic ICs. 2006, accessed August 12, 2017 .
  8. Terry Stewart: Fixing a Flat Dallas DS1287 Real Time Clock Chip. October 11, 2009, accessed August 12, 2017 .
  9. Windows 7: Wrong time - what to do? Chip.de, September 11, 2013, accessed on August 6, 2017 .
  10. CMOS rechargeable battery or battery. www.computerhilfe.de, March 22, 2012, accessed on August 6, 2017 .
  11. The year 2000 problem is taking shape. In: c't magazine. Heise Verlag, January 1, 1999, accessed on August 12, 2017 .