Video 16 picture splitter based on AM-209M chip

This article refers to the address: http://

Abstract: This paper introduces the system composition of 16-screen splitter based on AM-209M chip. The design schemes of each part of real-time monitoring of 16 video input screens by AT89C55 single-chip microcomputer are given, and the hardware components and software implementation programs are given.

Keywords: AM-209M 16 picture splitter AT89C55

At present, in the television stations, banks, shopping malls, warehouses and other places often need to monitor and process multiple video signals in real time. The video picture splitter can synthesize and display multiple video signals on one screen, which is the core part of the video monitoring system.

The video multi-screen splitter based on AM-209M chip introduced in this paper has the following characteristics:

· Can monitor 16 channels of video signals at the same time;

·With multi-picture and picture-in-picture, picture-out-picture display function;

· With screen blind detection function;

·With time, bitmap and caption display function;

· It can be controlled by button on-site or remote RS-485 interface;

· The system configuration can be updated and saved at any time, and system functions and technical parameters can be changed;

·The system is stable and reliable, real-time processing, and has a reset function for abnormal phenomena such as power failure and crash.

The whole system consists of hardware and software, including hardware, encoding, digital video processing, decoding and microcontroller control.

1 system composition

The 16-picture splitter consists of 16 channels of video decoding, multi-picture processing, video encoding, and AT89C55 system control and human-machine interface. Figure 1 shows the block diagram of a 16-screen splitter. In the figure, video inputs 1 to 16 are the system's composite video input signal (CVBS) or separate video S-VIDEO signals, which can be converted to standard CCIR656 YUV by video decoder SAA7113 (A/D) 4:2:2 Format data. The video multi-picture processor AM-209M is mainly used to mix and output the output signal of the video decoder SAA7113, and send the processed signal to the video encoder SAA7121 (D/A) to restore it to the video analog signal CVBS. Send the monitor output.

2 video signal processing

2.1 Video coding

The SAA7113 digital video decoder is used to decode the composite video input signal CVBS or the separated video signal S-VIDEO into 8-bit data in the standard ITU 656 YUV 4:2:2 format. The SAA7113 supports NTSC and PAL systems and can automatically monitor 50Hz and 60Hz fields. Frequency signal, and can be automatically converted in PAL and NTSC systems. The chip has brightness, color tone, color saturation control circuit and I2C bus interface. The system configures SAA7113 through I2C bus.

    The system consists of 16 SAA7113 16 video input channels. Connect the P1[0:7] of the AT89C55 MCU to the SDA pin of 16 SAA7113, and connect two SAA7113 to each IO line. (The SAA7113 chip has two I2C total device addresses. When the 26 pin is floating, the address is 0x48. When the 26 pin is pulled up to 3.3V through a 3.3kΩ resistor, the device address is 0x4A). The decoded data output terminal VPO[7:0] is connected to the Camera_n_vdin [7:0] data line of the video picture segmentation chip AM-209M, n∈(1,2...,8), and the channels 1-8 are solved at the same time. The data output is connected to the master, and the decoded data output of channels 9-16 is connected to the slave.

2.2 Multi-picture processing chip AM-209M

The AM-209M is a multi-screen real-time processing chip with functions such as recording, motion detection and playback. Its main features are as follows:

· Support CCIR 656YUV 4:2:2 codec data format;

· Support multi-picture, picture-in-picture, and off-picture processing modes;

·Characteristic display of characters and bitmaps;

· Support NTSC, PAL, SECAM video signals;

· One-chip real-time display of 9 channels (30 桢 / sec), two chips can be connected to 16 channels and real-time display (30 桢 / sec);

    · Two independent data output channels: monitoring and recording channels;

· There is a screen object movement detection function;

External fonts can be programmed via embedded font RAM (64 characters);

· Monitor input blind detection function;

• Access and control of channel information is achieved through an 8-bit parallel data interface.

The AT89C55 MCU sends control commands to the AM-209M through the parallel port to change the current output state. The AM-209M chip has two 16Mbit SDRAM chip interfaces, one for display data buffer and one for record buffer. At the same time, there is SDRAM read and write operation control logic inside the chip, so no external control is needed. There are two encoding chip interfaces, each chip interface contains 8 data lines and 1 bit clock signal line, and the output is CCIR 656 format data after multiple video input mixing processes. Its internal structure block diagram is shown in Figure 2.

b. Master-slave structure based on two AM-209M

When the 16-picture splitter is implemented by AM-209M, 16 input channels can be composed of two chips to form a master-slave structure. The slave pin of the main chip is grounded, and the slave channel is connected to VCC, and the recording channel signal of the main slice is used. The line rec_vdout[7:0] is connected to the slave monitor signal line mon_vdout[7:0], the monitor output channel mon_vdout[7:0] of the main slice 1 is used as the monitor output of the video picture splitter, and the slave record output channel rec_vdout [7:0] is the record output of the splitter. The motion detection signal motion_intr of the master-slave chip can be connected to the P3.2 pin of the AT89C55 microcontroller as an external interrupt INT0 input. The field sync interrupt signal mpout can be connected in common to P3.3 as an external interrupt INT1 input. The connection method of other signal lines is shown in Figure 3. Two AM-208Ms can form up to 16 frames. The speed is 30 frames/second, which basically meets the real-time playback requirements.

    2.3 Video coding

The SAA7121 is a video encoding chip whose main function is to encode standard YCbCr (CCIR 656) or MPEG format data into a composite video input signal (CVBS) or a separate video signal S-VIDEO. The SAA7121 supports NTSC-M, PAL B/G, and sub-standards, and has a digital-to-analog converter with three signals of Y, C, and CVBS. The basic encoding function consists of subcarrier generation, color modulation, and synchronization signal interpolation. The SAA7121 provides an I2C bus interface that can operate in either active or slave mode. The system channel I2C interface is used to configure the SAA7121.

3 single chip control circuit

The control circuit based on single chip microcomputer is shown as in Fig. 4. The circuit mainly performs the following functions: serial communication with PC to complete command and data transmission; reading and writing AM-209M through 8-bit parallel interface; reading and writing SAA7113 and SAA7121 through I2C bus; saving and updating system configuration data; Function and keyboard commands switch the current state of the system.

The AT89C55 selected for this system is an 8-bit CMOS microcontroller from Atmel Corporation. The chip is compatible with MCS-51 series MCUs and has 20K bytes of on-chip Flash program memory and 256 bytes of internal data memory and three 16-bit timing. Device.

The system interface circuit is mainly composed of MAX488 (RS-485 transceiver). Therefore, the RS-485 standard is not only compatible with RS-232, but also suitable for long-distance data transmission.

The system keyboard has 8 buttons, which are connected to the AT89C55 microcontroller through the serial shift 74LS164 chip. P2.4 is the button LED indication signal, P2.5 is the 74LS164 serial shift clock signal, P2.6 is the keyboard output signal, and P2.7 is the keyboard input judgment signal. When the system is initialized, P2.4 is 1, the LED is off, P2.5 and P2.6 are both 0, QA-QH is 0, and the input state of P2.7 is 1. The system keying schematic is shown in Figure 5.

Figure 5

4 software design

According to the requirements of the control function of the single-chip microcomputer, the system software consists of two parts: the main program and the serial port interrupt subroutine. The main program flow chart is shown in Figure 6. The programming focus of the software is: video codec and picture segmentation processing initialization; key control and menu display program; PC command judgment and execution; update system configuration and data storage.

4.1 Accessing AM-209M

The signal connection relationship between the AT89C55 and AM-209M chips of the single chip microcomputer is: P0.0~P0.7 of the single chip microcomputer is connected with the 8-bit parallel data interface mdata[0:7] of AM-209M; P2.0 and AM-209M chip select signals Connected; P2.1 is connected to the write enable signal line wren; P2.2 is connected to the address enable signal line adem; P2.3 is connected to the read enable signal line rden; INT1 is connected to the field sync interrupt signal mpout. Figure 4 shows the connection method of these signal lines. The following is a byte write program for AM-209M (C program for parallel port control):

#define AM209_NOP(); _nop_();_nop_();

#define MDATA_BUS P0 //AM-209M data bus

Sbit MCSB_AM209=P2^0; //AM-209M chip select

Sbit WREN_AM209=P2^1; //write enable

Sbit ADEN_AM209=P2^2; //address latch enable

Sbit RDEN_AM209=P2^3; //Read enable

Void Byte_wr_am209(unsigned char am209_addr,unsigned char am209_data)

{

EA=0;

MDATA_BUS=0xff;

ADEN_AM209=0;

WREN_AM209=1;

AM209_NOP();

MCSB_AM209=0; //AM209M chip enable

MDATA_BUS=am209 addr; //send address

AM209_NOP();

ADEN_AM209=1;

AM209_NOP();

ADEN_AM209=0;

AM209_NOP();

MDTA_BUS=am209 data; //Write data

AM209_NOP();

WREN_AM209=0;

AM209_NOP();

WREN_AM209=1;

AM209_NOP();

MCSB_AM209=1;

AM209_NOP();

EA=1;

}

4.2 Serial communication with PC

The data format for communication between the PC and the MCU is video screen command format and time adjustment command format. The video screen command format is: gimmick + command word + command address + checksum; time adjustment command data format is: gimmick + command word + second + minute + hour + day + week + month + year + checksum. All data is in hexadecimal, where the time is displayed in 24-hour format with a two-byte BCD code. SUM is the cumulative sum of all bytes before the SUM byte, which is a single byte, excluding overflow.

In the serial port interrupt subroutine of the MCU, it can be judged according to the length of the received command to receive a complete command format. Receive a complete command format and set the serial port receive flag to 1. According to this flag bit, the PC command processing program in the main program is entered, and the received command number is used to identify various commands sent by the PC. For example, if the command word in the video screen command format is 0X16, the output 16 screen is displayed on the monitor. In addition, based on the received checksum, it is possible to judge the correctness of the received PC data and prevent erroneous operation on the splitter. The baud rate of the system is 9600 bps, and the timer 2 of the MCU is set in the automatic reload mode 2.

4.3 keying program

When a key is pressed, P2.7 becomes 0. P2.6 sends serial data 0XFE to 74LS164. If the P2.7 input is still 0 at this time, it means that the SW1 key has been pressed (see Figure 5); otherwise 0XFE is shifted to the left by 1 bit (ie 0xFD), if P2.7 If the input is still 0, it means that the SW2 key has been pressed; and so on... Otherwise, 0XFE is shifted to the left by 7 bits (ie 0X7F). If the P2.7 input is 0 at this time, it means the SW8 key is pressed. After reading the key value left and releasing the button, the system will light the LED to indicate the key press. For example, when SW1 is pressed and released, P2.6 sends data 0XFE. At this time, P2.4 is set to 0, and D501 will be illuminated to indicate that SW1 is pressed. The keyboard scanning subroutine is as follows:

/ / Keyboard scan subroutine, key values ​​are stored in key_value

Sbit led_on=P2^4; //LED is lit, low effective

Sbit key_clk=P2^5; //serial shift clock

Sbit shift_data=P2^6; //Shift data input

Sbit scan_data=P2^7; //key scan data input

Void Key_read_service()

{

Uchar temp, temp1, temp2;

Uchar i,j;

Key_flag=0; //key flag is cleared

Scandata=1;

Led_on=1; //turn off the LED

For(i=0;i<8;i++) //74LS164 parallel output is set to 0

{

Shift_data=0;

_nop_();

Key_clk=0;

_nop_();

Key_clk=1;

}

If(scandata= =0)

{ // There is a key press

Temp=0xfe;

For(j=0;j<8;j++) //Send 8 data bytes

{

Temp1=temp;

Temp2=~temp;

For=(i=0;i<8;i++)// serial shift 1 byte

{

If(temp1 & 0x80==0x80)

Shift_data=1;

Else

Shift_data=0;

_nop_();

Key_clk=0;

_nop_();

Key_clk=1;

}

Delay_10ms();//delay 10ms debounce

If (scandata==0) / / again judge whether the button?

{ //The key is valid

Key_value=temp2;//stored value

Key_flag=1; / / set the valid flag

Break;

}

Temp2=temp2<<1;//Not the current key press

Temp=~temp2; Press, move one bit to the left to judge the next key

}

}

}

Electronic Components

Electronic components are components of electronic components and small machines and instruments. They are often composed of several parts and can be used in similar products; often refer to certain parts of electrical appliances, radios, instruments and other industries, including capacitors, transistors, General term for electronic devices such as hairspring and spring

Components Sourcing,ADS8168IRHBT,10M50DAF484C8G,Chip,Components Supplier

Huizhou Liandajin Electronic Co., Ltd , https://www.ldjcircuitboard.com

Posted on