| With the gradual popularization of computer technology and network communication technology in production and life,the networking and IP of various devices have become the main development trend.However,in many fields such as industrial production and automatic control,there are still a large number of devices still using the traditional RS-232/485/422 serial port communication.If the serial port device is replaced in a short time,it will cause great pressure on the current production and life,The birth of embedded serial port servers provides a practical solution for serial port device networking.In order to meet the urgent need for networked data transmission of various serial port devices in complex instruments,this paper builds a hardware platform with Cortex-M3 series processor GD32 as the core,embeds a real-time operating system,and combines TCP/IP protocol to design a low-cost multi-channel serial port server.The specific design content is as follows:(1)This paper introduces the research status of serial port servers at home and abroad,compares and analyzes different design schemes,completes the selection of system software and hardware,analyzes the main issues in the design process,and proposes solutions.(2)The overall scheme of the system hardware is divided into various functional modules,and the corresponding circuit design is completed,The main circuit includes the main control module circuit,Ethernet communication module circuit,serial expansion module circuit,serial interface module circuit and power supply circuit.(3)In order to achieve the mutual conversion between network data and serial port data,an Ethernet communication program and a serial port communication program were written,and an embedded operating system was transplanted into GD32 to assist in the scheduling of data transmission across various channels.Finally,a parameter configuration module was designed using the http protocol to build a Web server,allowing users to remotely configure the parameters of the serial port server through a Web page.(4)By building a system testing platform,testing and analyzing the functional modules of the serial server and the overall performance of the system,the feasibility of the overall design has been proven.The multi-channel serial port server designed in this article can enable 4-way serial port devices to communicate with computers,and each serial port channel supports three serial port communication modes: RS-232/485/422.At the same time,it can set multiple working modes such as TCP,Modbus TCP,UDP,etc.The experimental results show that the overall delay of the system is controlled within 1.5 seconds,and the packet loss rate during multi-channel data transmission is less than 2.5%. |