Design and implementation of single chip caller display
[Copy link]
Abstract: This paper introduces a caller ID display that uses the AT89C52 single-chip microcomputer to receive and display the caller ID of a phone. The display receives the caller ID information transmitted by frequency shift keying (FSK) when the called party is on-hook, and can display the caller ID number, call date, time and other information, and can store up to 120 caller ID information. Users can easily view or delete the caller ID information by using the up and down keys and the delete key. Keywords: Caller ID MCU AT89C52 FSK MC145447 introduction Calling Identity Delivery (CID) is a service provided to the user's phone. The method is that the originating switch transmits the caller number and other information to the terminating switch, and the terminating switch then transmits the information to the called user's terminal, as shown in Figure 1. screen.width-460)this.width=screen.width-460" vspace=10 border=0> The calling number information is often transmitted in the frequency shift keying (FSK) mode when the called party is on-hook or off-hook. The transmission method in the on-hook state is that the terminal switch transmits the calling information to the called user during the first ring and the second ring. There are corresponding protocol standards for this, such as Bell 202 and CCITT V.23 1200 baud rate FSK data transmission standards. There are two data formats for calling information transmission: single data message format and multiple data message format. The calling number display introduced in this article adopts the former. The single message frame format received in the on-hook state is shown in Figure 2. In Figure 2: ① The channel occupancy signal consists of a group of 300 consecutive alternating "0" and "1" bits, with the first bit being "0" and the last bit being "1". ② The flag signal consists of 80 flag bits. ③ The flag bit consists of 0 to 10 logical "1s". ④ For the data words such as message type, message length, message word, and check word, a "0" bit is added before each data word as the start bit, and a "1" bit is added after the data word as the end bit (i.e., each word occupies 10 bits). When transmitting data, the channel occupancy signal is sent first, and the low bit of each data word is sent first. 1 Hardware Design and Implementation The caller ID display uses the MC145447 chip of Amotrola as the caller ID information demodulation device, and the single chip microcomputer uses AT89C52. The principle block diagram of the whole circuit is shown in Figure 3. CM145447 meets Bell 202, CCITT V.23 1200 baud rate FSK data transmission standards. It contains a ring current detection circuit. The ring current detection output signal (low level pulse) is connected to the MCU reset pin "RST". MC145447 demodulates the FSK signal with logic "1" = 1200±12Hz, logic "0" = 2200±22Hz and a transmission rate of 1200bps into serial asynchronous binary data and inputs it to the serial receiving port of the MCU. The external EEPROM is used to store up to 120 caller identification information. The LCD display module is used to display the caller number, date, time and other information. There are 3 buttons: "DEL", "UP" and "DOWN" are used to delete and check the caller information respectively. The MCU works in three states: power-off, idle, and normal operation. Usually, the MCU works in the power-down state, and the power consumption is very low. When the first ring current signal arrives, the ring current detection circuit in the MC145447 outputs a low-level reset pulse to the MCU, and the reset pulse causes the MCU to enter the normal working state from the power-off state. During the first and second rings, the binary data demodulated by the MC145447 is sent to the serial receiving port of the MCU. The MCU receives and stores the caller information data and displays it on the liquid crystal display module (LCD), and then the MCU enters the idle state. After the MCU enters the idle state for 1 minute, if no button is pressed, it enters the power-down state. At this time, the total number of new calls (that is, calls that the user has not viewed) will be displayed on the LCD. 2 Software Design and Implementation The caller ID display software is written in assembly language and cooperates with the hardware to complete the functions of receiving, viewing and deleting caller information. The assembly language program mainly consists of the main program, serial interrupt handler and timer interrupt handler. When powered on, the MCU enters the main program to set the receiving baud rate and other parameters of the serial port register, initializes the LCD display module and displays the total number of new calls, sets the timer parameters with a timing length of 0.2s, initializes the relevant program variables, and then enters the power-off state. The main program flowchart is shown in Figure 4. Figure 5 is the serial port interrupt receiving processing program. When the serial port interrupt comes, the MCU will temporarily store the received serial data in the internal RAM. If the received information has errors, "ERROR" will be displayed on the LCD; if the information format sent by the switch is "date + time + P + ..", "PRIVATE" will be displayed on the LCD, indicating that the calling user requires that his number not be transmitted to the called user during this call; if the information format sent by the switch is "date + time + O + ..", "OUT OF AREA" will be displayed on the LCD, indicating that the calling user's current call is beyond the caller ID service range. If the received caller information is normal, it will be stored in the EEPROM in the order of reception. When the caller identification information is repeated, the latest call will overwrite the previous call; when the storage space is full, the first stored caller information will be automatically deleted according to the "first in, first out" principle.
Figure 6 is a timer interrupt handler that implements the caller display key processing function with a timing length of 0.2s. When the timer interrupt arrives, first check whether there is a key pressed. When a key is pressed, the MCU recovers from the power-off state to the idle state. If the "DEL" key is pressed twice within 1.5s, the information currently displayed on the LCD will be deleted from the EEPROM; if the "DEL" key is pressed continuously for more than 6s, all stored information in the EEPROM will be deleted. Press the "UP" key to call out and display the caller information received once. Press the "DOWN" key to call out and display the caller information received next time from the EEPROM. screen.width-460)this.width=screen.width-460" vspace=10 border=0> Conclusion The caller ID function is now widely used. The caller ID introduced in this article makes full use of the three working states of the MCU in the software and hardware design to reduce power consumption as much as possible; it is equipped with EEPROM as a storage device, which greatly increases the service life of this product compared with similar products (when powered by batteries).
|