1 Introduction
At present, the most widely used codec in China is the PT2262 encoding chip with 531441 (3 12 ) states produced by Princeton Company and the matching PT2272 decoding chip. However, one PT2272 can only decode 15 states of PT2262 with one address. For larger codec security and anti-theft control systems, multiple PT2272 combination decoders are often used, but this is still far from meeting the design requirements of large and medium-sized security systems. . Therefore, the AT89C2051 microcontroller is used to realize the large-capacity decoding function of PT2262. 2 Coding principle of PT2262 The working principle of PT2262 (please refer to http://www.princeton.com.tw) is shown in Figure 1. In the figure, K0~K7 are the address terminals, and their status should be preset; K8~K11 are data terminal, after pressing the button switches K8~K11, PT2262 will output a serial encoding pulse at pin 17. Switches K0~K11 are 12 bit code switches, and their status values of 0 or 1 are combined to produce different coding results. Each time a set of codes is transmitted, four codes are automatically sent in succession. The 4M7 resistor is the external oscillation resistor of PT2262. MPSH10 is a 315MHz high-frequency oscillating triode. Figures 2 to 5 show the coding principle of PT2262. Figure 2 is the word code structure of PT2262, Figure 3 is the bit code signal of PT2262, Figure 4 is the synchronization bit signal of PT2262, and Figure 5 is the frame code structure of PT2262.
3 Implementation of decoding 3.
Detection method of 1-bit encoded signal
According to the encoding principle of PT2262, each 0-bit or 1-bit encoded signal output by it consists of two sets of pulses, so a microcontroller can be used for decoding. This design uses the AT89C51 microcontroller produced by ATMEL Semiconductor Company, uses "Timing/Counter 0" to time the pulse width, and determines whether the high byte of the pulse width is the same. If they are the same, it is the 0 or 1 bit of PT2262 (this design only Considered "0" and "1" states, the two sets of pulses for each bit are the same). AT89C51 must make 12 judgments on 0 or 1-bit encoding signals. If all are correct, the PT2262 encoder is one of the signals of this system. 3.2 SYNC synchronization signal detection method The SYNC synchronization encoding signal of PT2262 is shown in Figure 4. The low level of this bit pulse is as long as 124 machine cycles, so it only needs to be judged whether its pulse width time is greater than 8 times the pulse width of the "0" bit or the "1" bit. 3.3 Processing of decoded signals Compare the high 8 bits of the 12-bit decoded data (see http://www.princeton.com.tw) with the address data of the address code table in the E2 PROM . If they are the same, then Output the corresponding room number, unit number, building number and other data in the E 2 PROM to the 16-bit 7-segment display screen through the P0, P1, and P2 ports. 4 Hardware Circuit The schematic diagram of the decoding and security alarm center circuit of this design is shown in Figure 6. The digital pulse signal processed by the high-frequency receiving module is sent to P3 of AT89C2051 (see http://www.atmel.com) .4 I/O port for decoding, and then output the data that meets the address code conditions in E 2 PROM to the computer through the RS232 interface. The numeric keyboard and alarm horn drive circuit parts are omitted in the figure.
5 Software Design
The software flow chart is shown in Figure 7. 5.1 Initialization Set the 16-bit timer/counter 0 of AT89C2051 [1] to the internal counter mode. 5.2 Collection of coding signals When the input signal is "1", the timer/counter 0 starts counting, and the high eight bits of the timer/counter 0 are stored in the memory buffer. When the input signal is "0", the timer/counter 0 also counts, and at the same time determines whether there is a value greater than 8 times the value in the memory buffer. If the conditions are not met, continue to collect pulse signals, otherwise the data in the 24 memory buffers will be processed.
5.3 Processing of decoded signals
Compare the data in the 24 memory buffers in pairs. If they are not equal, the encoded signal is not a signal in this system. If equal, set its value to "0" or "1". If the 12 sets of data are equal, you will get 8 "0" or "1" address bits and 4 "0" or "1" data bits. Compare
the high 8-bit address bits with the data in the address code table in the E 2 PROM. If they are not equal, the encoding signal is not the control signal of the transmitter in this system. If they are equal, the corresponding room number, unit number, building number and other data in the E 2 PROM will be output to the 16-bit 7-segment display screen through the segment control port P0 and the bit control port P1 and P2, and the alarm horn will sound at the same time. The numeric keyboard is used to enter coded address, room number, unit number, building number and other data into E 2
PROM. Assume that there are 32 types of PT2262 transmitters with addresses in a security and anti-theft system, and their addresses are 45H~64H. The value of the address code table is set in the AT89C2051 software to be 45H, 46H, 47H,..., 64H. If the K10 switch is pressed when the transmitter with address 50H, the value of the upper 8-bit address received by the decoding system is the same as the value of 50H in the address table in the software, then the corresponding 4-bit A, B, C, D will be output. The value is 0010B; if the transmitter with address 63H presses the K8 switch, the value of the upper 8-bit address received by the decoding system is the same as the value of 63H in the address table in the software, and the corresponding A, B, C are output , the value of D is 1000B;……. This design uses an AT89C2051 microcontroller to replace 32 PT2272 decoding chips.
Therefore, in practical applications, the address value of PT2262 can be selected from any combination of 256 00H to FFH, thus realizing a large-capacity decoding function of 256 PT2262s and at least 256×4=1024 states. If K8, K9, K10 and K11 of PT2262 are combined in any way, there can be 256×15=3840 states.
6 Computer Data Processing [2]
Delphi is a visual development tool launched by Borland. It provides a large number of components. Users can easily develop powerful applications, and the executable files compiled through it are quite efficient. high. Establish a user database, including the user's anti-theft host number, name, detailed address, telephone number, mobile phone, paging and other information. Use the SPCOMM serial port control to receive the serial port data sent by AT89C2051 - the number of the anti-theft host, compare the data one by one with all the anti-theft host numbers in the database, then display the user records with the same data on the screen, and call a sound to play at the same time Controls, alarm prompts. 7 Conclusion This design scheme has been applied to the alarm center of the security anti-theft system and is running in good condition. It is also suitable for other encoding systems, such as VD5026 of Huazhi-Mosilicon Company and HT12A/12E, HT6012/6014/6016 of HOLTEK Company and other encoding chips.
references
1 Zhang Yigang, wait. MCS-51 microcontroller application design. Harbin: Harbin Institute of Technology Press, 1990
2 Wu Xudong, et al. Delphi3.0/4.0 multimedia and database programming. Beijing: Tsinghua University Press, 2001
3 Translated by Wang Hui, et al. Delphi from entry to proficiency. Beijing: Electronic Industry Press, 2000
Previous article:Research on the setting and application of 80C51 reset flag bit
Next article:Multi-channel data acquisition range control system based on C8051F000
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Basic concepts of amplifier circuits and three basic connections
- Does the material of the transformer determine the operating frequency of the transformer?
- CV2880 simple datasheet
- Washing machine problems
- Problem with STM32F767 serial port 7
- Characteristics of DC Power Supply
- How to choose between JTAG protocol and SWD protocol for MCU programming and debugging?
- Learning Dynamics—Case Study Results Demonstration Sine Wave and Triangular Wave Signal Generator Design
- [MM32 eMiniBoard Review] ADC collects potentiometer data and sends it to the computer for display via USB-CDC
- Has anyone made a circuit that triggers a low level for 2ms and then maintains the low level for 80ms?