The importance of chips is self-evident and doesn't need much explanation here; just look at the chip market to understand its significance. To enhance your understanding of chips, this article will introduce the working principle, wiring, and function of clock chips. If you are interested in chips, please continue reading.
I. Chips
There are many ways to classify integrated circuits. Based on whether the circuit is analog or digital, they can be divided into: analog integrated circuits, digital integrated circuits, and mixed-signal integrated circuits (analog and digital on the same chip).
Digital integrated circuits can contain anything, ranging from thousands to millions of logic gates, flip-flops, multiplexers, and other circuits within a few square millimeters. The small size of these circuits allows for higher speeds, lower power consumption (see Low Power Design), and reduced manufacturing costs compared to board-level integration. These digital ICs, exemplified by microprocessors, digital signal processors, and microcontrollers, operate using binary and process 1 and 0 signals.
Analog integrated circuits, such as those used in sensors, power control circuits, and operational amplifiers, process analog signals. They perform functions such as amplification, filtering, demodulation, and mixing. By using expert-designed analog integrated circuits with excellent characteristics, the burden on circuit designers is reduced, eliminating the need to design everything from basic transistors.
Integrated circuits can combine analog and digital circuitry onto a single chip to create devices such as analog-to-digital converters and digital-to-analog converters. These circuits offer smaller size and lower cost, but care must be taken regarding signal interference.
Many serial clock circuits are currently popular, such as the DS1302, DS1307, and PCF8485. These circuits are widely used due to their simple interfaces, low cost, and ease of use. This article introduces the DS1302 real-time clock circuit from Dallas Semiconductor, which features trickle-current charging capability. Its main characteristics are serial data transmission, programmable charging functionality for power-down protection, and the ability to disable the charging function. It uses a standard 32.768kHz crystal oscillator.
II. Working principle of clock chips (taking DS1302 as an example)
1. Control Byte
The control characters of the DS1302 are represented as follows: The most significant bit (bit 7) of the control byte must be logic 1. If it is 0, data cannot be written to the DS1302. If bit 6 is 0, it indicates access to calendar clock data; if it is 1, it indicates access to RAM data. Bits 5 to 1 indicate the address of the operation unit. If the least significant bit (bit 0) is 0, it indicates a write operation; if it is 1, it indicates a read operation. The control byte is always output starting from the least significant bit.
2. Input/Output
Data is written to the DS1302 on the rising edge of the next SCLK clock after the control instruction word input, with data input starting from the least significant bit, i.e., bit 0. Similarly, data is read from the DS1302 on the falling edge of the next SCLK pulse immediately following the 8-bit control instruction word, reading data from the least significant bit 0 to the most significant bit 7.
3. Registers
The DS1302 has 12 registers, 7 of which are related to the calendar and clock, and store data in BCD format.
In addition, the DS1302 also includes a year register, control register, charge register, clock burst register, and RAM-related registers. The clock burst register can sequentially read and write the contents of all registers except the charge register at once. The RAM-related registers of the DS1302 are divided into two categories: one category consists of individual RAM cells, totaling 31, each configured as an 8-bit byte, with command control words C0H to FDH, where odd numbers are for read operations and even numbers are for write operations; the other category consists of RAM registers in burst mode, which can read and write all 31 bytes of RAM at once, with command control words FEH (write) and FFH (read).
III. Clock Chip Wiring
1. Place the crystal oscillator as close as possible to the X1 and X2 pins. Keep the distance between the RTC and the crystal oscillator as small as possible to reduce antenna length and thus reduce noise reception.
2. Keep the linewidth of the crystal oscillator pad and connections 1 and 2 as small as possible. Larger pads and linewidths make it easier to receive nearby noise signals.
3. Install a guard ring (grounded) around the crystal oscillator. This will protect the crystal oscillator independently from noise signals.
4. Avoid allowing signals from other layers to pass directly through the crystal oscillator or the signal lines connecting X1 and X2. The more independent the crystal oscillator is from other signals on the board, the less likely it is to receive noise signals. Any signal lines between X1 and X2 must maintain a minimum distance of 0.200 inches. The RTC should be isolated from any components that generate electromagnetic interference (EMR), especially discrete and modular RTCs.
5. Placing a ground plane on the layer directly below the crystal oscillator is very helpful. It helps isolate the crystal from other layers. Note that the ground plane should only be placed around the crystal oscillator and not cover the entire board, and it is best not to extend beyond the guard ring.
IV. The function of clock chips
First, the clock chip has the functions of displaying and recording time.
Second, the clock chip has an alarm function.
Third, the clock chip has a data recording function.
Fourth, the clock chip has data power failure protection.
Fifth, the clock chip has excellent detection capabilities.
V. Introduction to Clock Chip Selection
1. For the interface, the 2C method is recommended, as it saves MCU I/O compared to the SP method.
2. Power consumption: PCF8563 is recommended, with a power consumption of only 250nA.
3. Packaging: The ultra-small MSoP8 has the same thickness as FLASH, making it suitable for small-sized digital products.
4. Battery and VBAT ensure that data is not lost during backup power switching.
5. High integration of functions such as interrupts, RAM, and frequency output places high cost requirements on the system.