The AT89C2051 single-chip microcomputer is used to realize the large-capacity decoding function of PT2262. This design can solve the problem that one PT2272 can only decode 15 states of PT2262 with one address. For larger codec security and anti-theft control systems, multiple PT2272 chips are often used for combined decoding, which cannot meet the design requirements of large and medium-sized security systems.
2 PT2262 Coding Principle
The working principle of PT2262 is shown in Figure 1. In the figure, K0~K7 are address terminals, and their states should be preset; K8~K11 are data terminals. After pressing the button switches K8~K11, PT2262 outputs a serial coding pulse at the 17th pin. Switches K0~K11 are 12 bit code switches, and their state values of 0 or 1 combine different coding results. Each group of codes is automatically sent four times in a row. The 4M7 resistor is the external oscillation resistor of PT2262. MPSH10 is a 315MHz high-frequency oscillation transistor. 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 Decoding Implementation
3.1 Detection method of bit-coded signal
According to the coding principle of PT2262, each 0-bit or 1-bit coded signal it outputs is composed of two groups of pulses, so it can be decoded using a single-chip microcomputer. This design uses the AT89C51 single-chip microcomputer produced by ATMEL Semiconductor Company, uses "Timer/Counter 0" to time the pulse width, and determines whether the high byte of the pulse width is the same. If it is the same, it is the 0 or 1 bit of PT2262 (this design only considers the "0" and "1" states, and the two groups of pulses for each bit are the same). AT89C51 must make 12 judgments on the 0 or 1-bit coded signal. If all are correct, the PT2262 encoder is one of the signals of this system.
3.2 SYNC signal detection method
The SYNC synchronous 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 is only necessary to determine whether its pulse width time is greater than 8 times the pulse width of the "0" bit or the "1" bit. [page]
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 in the address code table in the E2PROM. If they are the same, the corresponding room number, unit number, building number and other data in the E2PROM will be output to the 16-bit 7-segment display 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 the P3.4 I/O port of AT89C2051 (see http://www.atmel.com) for decoding, and then the data that meets the address code conditions in E2PROM is output to the computer through the RS232 interface. The digital keyboard and alarm speaker drive circuit 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 internal counter mode.
5.2 Collection of coded signals
When the input signal is "1", timer/counter 0 starts counting and stores the high eight bits of timer/counter 0 in the memory buffer. When the input signal is "0", timer/counter 0 also counts and determines whether there is a value in the memory buffer greater than 8 times. If the condition is not met, the pulse signal continues to be collected, otherwise the data in the 24 memory buffers are processed.
5.3 Processing of Decoded Signals
The data in the 24 memory buffers are compared in pairs. If they are not equal, the coded signal is not the signal in this system. If they are equal, their values are set to "0" or "1". If all 12 groups of data are equal, 8 address bits of "0" or "1" and 4 data bits of "0" or "1" are obtained.
Compare the high 8-bit address bit with the data in the address code table in E2PROM. If they are not equal, the coded 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 E2PROM are output to the 16-bit 7-segment display screen through the segment control P0 port and the bit control P1 and P2 ports, and the alarm horn sounds at the same time. The numeric keyboard is used to enter the coded address, room number, unit number, building number and other data into E2PROM.
Assume that there are 32 PT2262 transmitters with addresses of 45H to 64H in a security anti-theft system. In the AT89C2051 software, the address code table is set to 45H, 46H, 47H, ..., 64H. If the K10 switch is pressed for the transmitter with address 50H, the value of the high 8-bit address received by the decoding system is the same as the value of 50H in the address table in the software, and the corresponding 4-bit A, B, C, D value 0010B is output; if the K8 switch is pressed for the transmitter with address 63H, the value of the high 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, D value 1000B is output; ... 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 addresses from 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 arbitrarily, there can be 256×15=3840 states.
6 Data processing by computer
Delphi is a visual development tool launched by Borland. It provides a large number of components, allowing users to easily develop powerful applications, and the executable files compiled by it are quite efficient.
Establish a user database, including the user's anti-theft host number, name, detailed address, telephone, mobile phone, pager 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 with all the anti-theft host numbers in the database one by one, and then display the user records with the same data on the screen. At the same time, call a sound playback control to issue an alarm prompt.
7 Conclusion
This design has been applied to the alarm center of the security and anti-theft system and is in good working condition. It is also applicable to other coding systems, such as VD5026 of Huazhi-Mosel and HT12A/12E, HT6012/6014/6016 and other coding chips of HOLTEK.
Previous article:Design of a New Multi-rate Single-phase Watt-hour Meter Based on AT89S52 Single-chip Microcomputer
Next article:Doppler blood flow meter system based on 51 single chip microcomputer
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- How to generate .lib file for atmel atudio and call it in other projects
- LPC1768 UCOSII is ported to IAR8.3 environment. There is no problem in compiling, but it is stuck when creating the first task function...
- This module can meet the "high current" required for 3C lithium battery pack testing. You should know about it?
- Fluke 17b is broken, do you know how to repair it?
- Data first: ST's latest STML5 product development board NUCLEO-L552ZE-Q (Cortex-M33 core)
- FPGA development process.
- RISC-V RVB2601 First Experience
- What voltage is suitable for TL431?
- Principle of pyroelectric infrared sensor
- Importing an old MPLAB IDE V8.9 project into MPLAB X IDE shows 'other' has different root