Abstract: In the video surveillance system, the main function of the alarm tap is to receive the alarm input signal sent by the alarm sensor, and transmit the alarm information to the monitoring system host according to a certain protocol and baud rate. This paper introduces the design method of the alarm tap in the video surveillance system, and discusses the performance characteristics and usage of the transmit-receive chip MAX483. Keywords: video surveillance; alarm tap; MAX483 CLC number: TN943.6 Document code: A Article ID: 1003-353X(2003)04-0068-04 |
1 Introduction In recent years, video surveillance systems have been widely used in industries, transportation, shopping malls, banks, public security and intelligent residential quarters. They are one of the important means of modern management and monitoring, which greatly improves management efficiency and automation. Generally speaking, the video surveillance system consists of the following components: control matrix, decoder, camera, pan/tilt, alarm tap, monitor; some systems also include hard disk recorders and multi-picture processors. Usually, the video surveillance system has to set a number of alarm points. Once an abnormal situation occurs at the alarm point, the monitoring system host can automatically switch the monitoring screen to the alarm point and store the alarm record. Since the alarm point is usually far away from the monitoring system host, and some monitoring systems need to set hundreds or even thousands of alarm points, it is unrealistic to use the alarm sensor directly connected to the monitoring system host. The middle must pass the alarm tap. . The main function of the alarm tap is to receive the alarm input signal from the alarm sensor, and transmit the alarm information and the address code of the alarm tap itself to the monitoring system host according to a certain protocol and baud rate. Usually an alarm tap controls several alarm points (such as 8 or 16), and many alarm taps can be connected in series to control many alarm points. Each alarm tap has a unique address code. The monitoring system host can know the specific location of the alarm point through the received address code, and the alarm tap itself does not alarm. The design method of the alarm tap is described in detail below. 2 alarm tap components and main functions 2.1 Composition 2.2 Main functions (3) Up to 64 alarm taps can be connected in series, and a total of 512 alarm points can be controlled; (4) The alarm tap can be connected to a control matrix, hard disk recorder or multi-picture processor. 3 hardware structure 3.1 CPU 3.2 Address Encoding Circuit 3.3 Transmit and Receive Circuit The interface circuit between the MAX483 and the CPU is shown in Figure 2. The PA0 pin of the CPU is set to the data receiving pin (RXD), the PA2 pin is set to the data transmitting pin (TXD), and PA1 is the control pin. When PA1 is low, the CPU is allowed to send data to the system host; when PA1 is high, the CPU can receive data from the system host. In order to ensure the correct transmission of data and prevent false alarms, in addition to parity, the accumulated sum of data is sent. After the system host receives the data, it must check whether the accumulated sum of the received data is equal to the accumulated sum of the sent, if not If they are equal, it indicates a transmission error. In addition, after the CPU sends all the data, it receives the response information of the system host. This response information is the accumulated sum of the data. Only when the summation of the transmission and reception is the same, the transmission is correct. The baud rate of the communication is set to 4800. 3.4 Optocoupler and alarm analog switch 3.5 switching power supply 4 software flow of the alarm tap work Figure 3 shows the software flow for the operation of the alarm tap. The software program is written in PIC16C57 assembly language. Pay attention to the preparation of the watchdog (WDT) program. The WDT has a basic overflow period of 18ms (no preset multiple). If a longer WDT period is required, Prescaler can be assigned to the WDT. The maximum division ratio is 1:128. At this time, the WDT overflow period is 2.5s. The division ratio of this design is chosen to be 1:16, that is, the overflow period is 288ms. Pay special attention to "Configuring EPROM (Configuration EPROM)" when programming the PIC16C57. The EPROM contains three items: program security fuse, watchdog timer setting, and oscillation type (RC/XT/HS/LP) settings. Since the PIC16C57 does not have a dedicated baud rate generator, a software delay subroutine must be programmed. Each time a bit delay is transmitted for about 0.2ms, the delay time can be adjusted by the oscilloscope to make the baud rate equal to 4800. Due to space limitations, a detailed list of programs is not listed here. Only subroutines that send and receive one byte are given as follows: STATUS EQU 03H RA EQU 05H DATA EQU 08H ODD EQU 09H ; parity flag DELAY EQU 0AH; drive delay flag CT EQU 0BH (1) PIC microcontroller receives a byte subroutine RECE BCF RA, 1 ; MAX483 is in receive state BTFSC RA,0 GOTO WORK CALL DLY_0.1MS; delay 1/2 BIT BTFSC RA, 0; Is it still low? GOTO RECE CALL DLY_0.2MS MOVLW 8 ; read in characters MOVWF CT CLRF ODD RECELO CALL DLY_0.2MS BCF STATUS, C BTFSC RA,0 BSF DATA, 7 MOVF DATA,0 XORWF ODD, 1 ; parity property DECFSZ CT, 1 GOTO RECELO CALL DLY_0.2MS CLRW BTFSC RA, 0; judge whether the check digit is 1 MOVLW 80H XORWF ODD, 1 BTFSS ODD, 7 GOTO RECE_OK GOTO REC_ERR ; does not match the parity attribute RECE_OK ; matches the parity attribute RETLW 0 RECE_ERR RETLW 0
BSF RA, 1 ; MAX483 is in the transmitting state CALL DLY_1MS MOVLW 8; send characters MOVWF CT CLRF ODD BCF RA, 2; send start bit SENDLO CALL DLY_0.2MS MOVF DATA,0 XORWF ODD, 1 ; parity property BCF STATUS, C RRF DATA, 1 BCF RA, 2 BCF STATUS, C BSF RA, 2 DECFSZ CT, 1 GOTO SENDLO CALL DLY_0.2MS MOVLW 01H XORWF ODD, 1 BTFSC ODD, 1 ; send parity flag BSF RA, 2 CALL DLY_0.2MS BSF RA, 2; send stop bit RETLW 0
MOVLW 250; delay 1 millisecond CALL DLY_LO RETLW 0 DLY_0.1MS MOVLW 24; delay 0.1 ms CALL DLY_LO RETLW 0 DLY_0.2MS MOVLW 48; delay 0.2 ms MOVWF DELAY DLY_LO NOP DECFSZ DELAY, 1 GOTO DLY_LO RETLW 0 5 Conclusion This paper introduces the design of the alarm tap in the video surveillance system. Since the working principle of the alarm tap is simple, no complicated hardware design and software programming are required. The alarm tap has stable performance during use, and no false alarm, crash and interference have been found.
|
[1]. MAX483 datasheet http://
[2]. PIC16C57 datasheet http://
[3]. PB5 datasheet http://
[4]. RS-485 datasheet http://
[5]. TTL datasheet http://
[6]. PIC16C5X datasheet http://
[7] Li Dongxing, Chen Xiaomu, Zhou Ligong. Application Design of PIC16C5X Series Single Chip Microcomputer. Electronic Industry Press, 1996.
[8] Wang Xingzhi, Wang Lei et al. Anti-jamming technology of single-chip application system. Beijing University of Aeronautics and Astronautics Press, 2001.
[9] Huang Zaiyin, Zong Jianhua. Design of 256×16 video matrix switching system. Electronic Engineer, 2001, (12).
:
Cemented Carbide Needle Rollers,Chrome Steel Needle Rollers,Stainless Steel Needle Rollers,Carbon Steel Needle Rollers
Qingdao Yukun Bearing Needle Roller Co.,Ltd. , https://www.ykneedleroller.com