Applying MCU-based decoders to security systems

Publisher:创客1992Latest update time:2014-10-30 Source: 21icKeywords:MCU  Decoder Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
1 Introduction

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.

Decoder based on single chip microcomputer is applied in security system

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.

Decoder based on single chip microcomputer is applied in security system

5 Software Design

The software flow chart is shown in Figure 7.

Decoder based on single chip microcomputer is applied in security system

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.

Keywords:MCU  Decoder Reference address:Applying MCU-based decoders to security systems

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

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号