What Are Real-Time Clocks?
The abbreviation of real-time clock is RTC (Real_Time Clock). RTC is an integrated circuit, often called a clock chip.
- The abbreviation of real-time clock is RTC (Real_Time Clock). RTC is an integrated circuit, often called a clock chip.
- The real-time clock chip is one of the most widely used consumer electronics in daily life. It provides accurate real-time time for people, or accurate time reference for electronic systems. At present, most real-time clock chips use crystal oscillators with higher accuracy as the clock source. Some clock chips require an external battery in order to work when the main power supply is powered off.
Real-time clock development history
- 1). Early RTC products
- Early RTC products were essentially a frequency divider with a computer communication port. It divides and accumulates the oscillation frequency generated by the crystal to obtain time information such as year, month, day, hour, minute, and second, and sends it to the processor for processing through the computer communication port.
- The characteristics of RTC during this period are as follows: parallel port on the control port line; large power consumption; common CMOS process; dual in-line package; chips generally do not have the perpetual calendar and automatic leap year and month switching functions of modern RTC And cannot handle the 2000 issue. It has now been eliminated.
- 2). Mid-term RTC products
- A new generation of RTC appeared in the mid-1990s. It uses a special CMOS process; power consumption has been greatly reduced, typically less than about 0.5 A; the power supply voltage is only less than 1.4 V; and the computer communication port has also become serial. Appears such as three-wire SIO / four-wire SPI, some products use 2-wire I2C bus; the package uses SOP / SSOP package, the size is greatly reduced;
- Functionally: the on-chip intelligence has been greatly improved, with a perpetual calendar function, and the output control has become flexible and diverse. Among them, the RTC introduced by Japan RICOH has even appeared the time base software adjustment function (TTF) and automatic detection of oscillator stop and the price of the chip is extremely low. At present, these chips have been widely used by customers.
- 3). The latest generation of RTC products
- In the latest generation of RTC products, in addition to all the functions of the second generation products, composite functions have been added, such as low voltage detection, main battery backup switching function, resistance to printed board leakage, and a smaller package (height 0.85) mm, the area is only 2mm * 2mm).
Real-time clock hardware structure
- 1) Crystal
- A crystal oscillator is generally called a crystal resonator, which is an electromechanical device. The crystal oscillator is an abbreviation of quartz oscillator. The English name Crystal is made of quartz crystal with very little electrical loss, which is precision cut and ground, plated with electrodes and welded with leads.
- The role of the crystal: provides the reference frequency.
- RTC crystal:
- The core of any real-time clock is a crystal oscillator with a frequency of 32768 Hz. It provides accurate and low power real-based signals for the frequency division counter. It can be used to generate information such as seconds, minutes, hours, and days. In order to ensure the long-term accuracy of the clock, the crystal must work normally and cannot receive interference. RTC crystal is divided into: external crystal and built-in crystal.
- Why is the crystal frequency of RTC 32768Hz?
- RTC time is calculated by the oscillation frequency. So it is not a timer but a counter. The general counter is 16-bit. And because the accuracy of time is important, the lower the number of shocks, the lower the accuracy of time. So it must be a high number. 215 = 32768.
- 32768 Hz = 215, that is, 1 Hz after 15 divisions, and the period = 1 s.
- After the engineer's experience, the 32768 Hz is the most accurate clock.
- Standardization and unification.
Real-time clock bus interface
- Commonly used clock chips are divided into two categories: parallel interfaces and serial interfaces (parallel clock chips have faster data transfer rates and more connections, which is not conducive to reducing the size of the product and occupies more CPU port resources. Serial clock chips only require Occupying 2-3 I / O port lines of the CPU can greatly reduce the product volume line interface.
Real-time clock clock error
- In real time [1] , the time error of the clock chip mainly comes from the frequency error of the crystal in the clock chip, and the frequency error of the crystal is mainly caused by the temperature change. Therefore, the temperature can effectively compensate the error caused by the crystal resonance frequency. It is the key to improve the accuracy of the clock. The quartz crystal resonance frequency error compensation method is a method of accurately compensating the frequency division counter that generates a frequency of 1 Hz based on the known error of the crystal resonance frequency with temperature.
- The most important function of RTC is to provide the calendar function until 2099. Regarding time, whether it is fast or slow is an error, and the matching capacitor plays a very important role on the peripheral device of RTC. It can properly correct the relationship between the crystal and RTC. Matching issues.