Realize the hardware design of control and management equipment based on serial data stream transmission

The serial server makes it possible to transmit the serial data stream based on TCP/IP. It can connect multiple serial devices and select and process the serial data stream, and convert the data of the existing RS 232 interface into an IP port. Data, and then IP-based management, IP-based data access, so that traditional serial data can be sent to the popular IP channel, without prematurely eliminating the original equipment, thereby improving the utilization of existing equipment Rate, save investment, and simplify wiring complexity on the basis of existing networks.

Authors: Mao Qijian, Ding Jie, Yu Qi

With the widespread popularity of the Internet, “Let all devices connect to the Internet” has become the consensus of enterprises all over the world. In order to keep up with the trend of network automation and not lose its competitive advantage, it is necessary to establish a networked system of high-grade data collection, production monitoring, and real-time cost management. Using the realization of TCP/IP-based serial data stream transmission to control the managed equipment hardware, there is no need to invest a lot of manpower and material resources to manage, replace or upgrade.

The serial server makes it possible to transmit the serial data stream based on TCP/IP. It can connect multiple serial devices and select and process the serial data stream, and convert the data of the existing RS 232 interface into an IP port. Data, and then IP-based management, IP-based data access, so that traditional serial data can be sent to the popular IP channel, without prematurely eliminating the original equipment, thereby improving the utilization of existing equipment Rate, save investment, and simplify wiring complexity on the basis of existing networks. The serial server completes the storage control of a connection-oriented RS 232 link and a connection-oriented Ethernet communication data. The system processes various data, processes the serial data stream from the serial device, and performs format conversion. Make it a data frame that can be propagated in the Ethernet; judge the data frame from the Ethernet and convert it into serial data and send it to the serial device that responds.

Realize the hardware design of control and management equipment based on serial data stream transmission

1 hardware system

The hardware system is the basis for the realization of the entire system function and the key to the realization of the entire design.

The key to the entire serial server is the conversion between serial data packets and TCP/IP datagrams and the rate matching problem of the two parties’ data due to different rates. In the process of implementing the serial server, we must also focus on the design and Whether the selected device can perform these functions.

1.1 The components of the hardware system

The technical difficulty encountered when formulating design schemes and selecting devices is how to use the processor to perform TCP/IP protocol processing on the serial port data information, making it an IP data packet that can be transmitted on the Internet. At present, 32-bit MCU + RTOS solutions are often used to solve this problem. This solution uses 32-bit high-end single-chip microcomputers to develop software on the RTOS (Real-time Multitasking Operating System) platform and implement TCP/IP in the embedded system. Agreement processing. Its shortcomings are: the price of single-chip computers is relatively high, and the development cycle is relatively long; the need to purchase expensive RTOS development software requires high development capabilities for developers.

Realize the hardware design of control and management equipment based on serial data stream transmission

Drawing lessons from the advantages and disadvantages of the above solutions, we decided to divide the hardware part of the serial server into several module designs, which are the main processing module, serial data processing module, Ethernet interface and control module and other major modules to jointly complete the functions of the serial server .

In the selection of devices, Intel’s 801086 chip is selected as the processor chip of the main processing module. It is a high-performance, highly integrated 16-bit microprocessor that is very suitable for embedded applications and has low power consumption. Considering that the serial port data rate is low and the Ethernet data transmission rate is high, the rate of the two sides does not match the problem, we decided to use a large-capacity memory that conforms to the bus specification as the data memory; because the main processing module also involves the data line /Address line multiplexing, serial-to-parallel conversion, device interrupt signal decoding, clock signal generation, control signal access and other functions. If different devices are used to complete it, it will inevitably cause many problems such as uneven delay. We chose one Large-capacity high-performance programmable logic devices to complete the above-mentioned functions, the advantage of this is that we ensure stability and high reliability, and the programmable function of programmable logic devices makes the space for signal processing more Large, and has the advantage of upgrading.

The Ethernet interface and control module play a very important role in the hardware of the serial server. What it deals with is the IP data packet from the Ethernet. Considering the principle of versatility, we use a piece of Ethernet control chip to complete these Function, and add a slice of AT24C01 to the main processing module to store the status of the Ethernet control chip. Through the main processing module to read/write data and registers of the Ethernet control chip, we can complete the analysis and decompression of IP data packets.

Realize the hardware design of control and management equipment based on serial data stream transmission

The advantages of this modular solution are: the use of a high-speed 16-bit microcontroller, fewer peripheral components, and low system cost; and the use of Intel’s development platform, which can greatly shorten the development cycle and reduce development costs.

1.2 Hardware workflow and application architecture

The main processor first initializes the network and serial devices. When data is transmitted from the Ethernet, the processor analyzes the datagram. If it is an ARP (Physical Address Resolution) packet, the program transfers to the ARP processing program; if it is IP data The packet and transport layer uses UDP and the port is correct, then the datagram is considered correct. After the data is unpacked, the data part is output through the serial port corresponding to the port. Conversely, if data is received from the serial port, the data will be packaged in UDP format and sent to the Ethernet control chip, which will then output the data to the Ethernet. It can be known that the main processing module mainly deals with the network layer and transport layer of TCP/IP, and the link layer is partially completed by the Ethernet control chip. The application layer is delivered to the software system for processing, and users can process the received data according to their needs.

Realize the hardware design of control and management equipment based on serial data stream transmission

2 Hardware system module

According to the specific structure and different functions of the hardware system, we can divide the hardware system into the following major modules.

2.1 Main processor module

This module is the core part of the serial server, mainly composed of main processor, programmable logic device, data and program memory and other devices.

The main functions performed by the main processing module include: establishing a data link between serial data and Ethernet IP data; realizing the receiving and sending of IP data packets by controlling the reading and writing of the Ethernet control chip; judging the serial data stream Format, complete the selection of the serial device and the specification of the serial data stream format; control the rate control between the serial data stream and the IP data packet, buffer the data; read the registers of the UART and Ethernet control chip Write operation and store and forward device status; complete serial-to-parallel conversion of 16-bit bus data; complete bus address latch function; complete chip selection function for each serial port and each storage device; complete status judgment of the interrupt port of each serial port, etc. Features.

2.2 Ethernet interface and control module

This module is mainly composed of an Ethernet interface part and an Ethernet control part.

The Ethernet interface part completes the functions of the serial port server and the Ethernet interface circuit. The controller has a control effect on all modules, so that the entire interface circuit can coordinate the subsequent circuits to complete the Ethernet transceiver function.

The Ethernet control part is composed of the receiving end and the sending end. Between them, there are the Ethernet status detection and control unit, as well as the transceiver coordination controller, as shown in Figure 5. Since the Ethernet works in half-duplex, this part must monitor the status of the Ethernet at any time, and control the Ethernet as needed, and at the same time coordinate the working status of the internal transceiver circuit. The Ethernet detection unit and the transceiver coordination controller accomplish this function. The Ethernet status detection unit and the controller interface of the Ethernet interface send the status of the interface to the transceiver coordination controller, and at the same time process the control signal of the coordination controller and send it to the controller of the Ethernet interface to control the interface state.

At the receiving end, the received serial data stream signal is serial-to-parallel converted and encoded through the main processing module, and the Ethernet control unit controls the coordination of various parts, and sends the generated address, data, and write signals to the RAM read-write control unit for processing . Correspondingly, the working process of the originating end is opposite to that of the receiving end.

2.3 Serial data processing module

This module mainly completes the status collection of serial devices, the reception of serial data streams, and the unpacking/packaging of data formats. It is composed of 8 UARTs and corresponding serial ports. We have explained the addressing mode of each port. When the main processing module addresses a port, the main processing module reads and writes the corresponding UART register, determines the idle state of the connected serial device, and establishes a communication connection with it. , Send back the control data frame to the main processor. After the main processor receives the control signal, it then decides whether to send and receive the data stream.

3 hardware system flow

In the serial server, the hardware part is combined with the software part to complete the functions of the entire system. The user completes the control and management of the serial device through the visual interface of the software part and the monitoring mode of the C/S architecture; the hardware part completes the serial data and Format conversion between IP data packets and control signal processing.

Shows the internal data flow diagram of the serial server hardware in the system process. Because in the entire serial server system, the hardware completes the main functions of data format conversion and control signal processing. The software system and the hardware system follow a standard interface, on which data signals and control signals, and the status information of the serial server are transmitted. It is mainly processed and collected by the central server. Since the server only completes some state storage and forwarding, it is very different from the original serial device-front-end machine mode, and the central server does not need to bear too much work.

Realize the hardware design of control and management equipment based on serial data stream transmission

The following is a process description of the specific implementation of the serial server hardware, so that you will have a deeper understanding of the serial server. Due to space limitations, only the main process is analyzed and introduced.

3.1 TCP/IP data packets are transmitted to the serial device

(1) Power on and initialize the Ethernet control chip, and read the status word from the status memory and write it into the corresponding register;

(2) Use an interrupt mechanism instead of a polling mechanism to process data from the Ethernet. When the RTL8019AS receives an IP packet, it judges the packet format and writes the corresponding register, and sends an interrupt INT0 to the 80C186 processor to request system processing;

(3) 80C186 receives the interrupt, saves the current working state to respond to the interrupt, and then determines the bus idle state, if it is busy, set AEN high bit, if idle, set AEN low bit. At the same time, set some control pin states to enable the RTL8019AS address;

(4) Since the data lines AD0~AD15 of 80C186 are in line with the address lines A0~A15, they must be latched by the EPM7128S programmable logic device address, 80C 186 sends out the address signal and sets the ALE address latch enable;

(5) 80C186 reads the register information of RTL8019AS through the data bus to determine the current status of RTL8019AS;

(6) Read the data packet through AD0~AD15, set A19 to 1, enable the data memory, and send the data to the data memory buffer;

(7) Obtain the destination port number of the IP data packet to determine the corresponding device for the strobe. Here we believe that the port number selected is a MAX3110E and corresponds to the corresponding port address;

(8) Set A19 to 0, and send out the port address signal through A18~A16 to select the MAX3110E. Here we first assume that the MAX3110E is idle;

(9) After strobing, first send out 10000010××××××××, request to establish a connection with the serial device, and judge whether the connection is established by reading the 9th bit of the sent 16-bit information;

(10) Pass the data part of the IP data packet through A0~A7, and A8~A15 will be added to the status word by the system according to the system state (in this process, we set the added value as 10000010), and send them to the EPM7128S programmable logic. The device is converted into a serial data stream through its internal serial-parallel and sent to the MAX3110E;

(11) The MAX3110E converts the serial data stream into standard asynchronous serial data and transmits it to the serial device. So far, a brief process of transferring IP data packets to the serial device is basically the same. Due to space limitations, we will only introduce A one-way path situation is presented, and the situation of each side branch is not introduced.

Realize the hardware design of control and management equipment based on serial data stream transmission

3.2 Data transfer from serial device to Ethernet

Since some steps are basically similar to the previous process, they are omitted here.

(1) The system receives the interrupt IRQx sent by a MAX3110E, determines the current system status, and responds to the interrupt;

(2) Send a control word to MAX3110E to establish a connection;

(3) Read AD0~AD15, and judge the size, format, parity and other information of the data stream from A8~A15. Receive data from A0~A7 and send it to the data access device;

(4) Strobe RTL8019AS, pack the current data, add the TCP header and IP header to send in, and send it out by the Ethernet interface module.

Realize the hardware design of control and management equipment based on serial data stream transmission

3.3 Programmable logic device circuit

EPM7128S completes very important functions in the entire system, mainly completes 16-bit address latch, 16-bit data serial-to-parallel conversion, interrupt response to MAX3110E chip through INT1 ~ INT3, and functions such as the work of AT24C01.

4 Application areas

The serial server can connect the serial devices of various enterprises and institutions to the Ethernet LAN to realize resource sharing. It has a wide range of uses in communications, transportation, schools, finance, taxation, insurance and other industries. The system has a good market prospect, low cost, quick results, and can produce certain economic benefits.

This design work won the special prize of Chongqing Division of the 8th “Challenge Cup” National College Students Extracurricular Academic Technology Work Competition, and has entered the finals of the 8th “Challenge Cup” National College Students Extracurricular Academic Technology Work Competition held at South China University of Technology.

The Links:   BSM300GA12DN2S STK621-728S-E MY-IGBT

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *