A kind of Multi-serial port server and its implementationTechnical field
The present invention relates to field of communication technology more particularly to a kind of Multi-serial port server and its implementation.
Background technology
RS232/RS485/RS422 (American Electronics Industry Association EIA (Electronic IndustryAssociation) serial ports physical interface standards) it is one of major way of legacy device communications.Based on serial communication modeEquipment is also being widely used, and the wiring facilities based on serial communication mode also play use value, replaces new traffic modeCost is huge.But serial communication mode transmission range is short, transmission rate is low.With the development of technology, people need it is farther away fromData transmission from, bigger transmission rate, Ethernet disclosure satisfy that this requirement by special advantage.
Invention content
In view of presently, there are above-mentioned deficiency, the present invention provides a kind of Multi-serial port server and its implementation, can willMultiple serial equipments are connected into network simultaneously, the bridge as serial data and network data intercommunication.
In order to achieve the above objectives, the embodiment of the present invention adopts the following technical scheme that:
A kind of Multi-serial port server, the Multi-serial port server include MCU, USB turn serial port circuit, network processing circuitry,Storage chip, no less than 2 groups of serial port circuit and power supply, the MCU turn serial port circuit, network processes electricity with USB respectivelyRoad is connected with storage chip, and the power supply turns serial port circuit, network processing circuitry and serial port circuit with MCU, USB and is connected respectivelyIt connects, the USB turns serial port circuit and is connected with the serial port circuit.
According to one aspect of the present invention, the serial port circuit is to appoint in RS232 circuits, RS485 circuits and RS422 circuitsIt is one or more of.
According to one aspect of the present invention, it includes at least one USB interface and at least two strings that the USB, which turns serial port circuit,Mouth interface.
According to one aspect of the present invention, the MCU includes at least one USB interface and at least one network-side interface,The USB interface that the USB interface of the MCU turns serial port circuit with USB is connected.
According to one aspect of the present invention, the network processing circuitry is connected with the network-side interface of the MCU, willMCU accesses network.
According to one aspect of the present invention, the serial interface is connect simultaneously with no less than 2 groups of serial port circuits.
It is equipped with the USB that can be run in MCU according to one aspect of the present invention, in the storage chip and turns serial port circuitDriver.
According to one aspect of the present invention, the storage chip is connected by SPI interface with MCU.
A kind of implementation method of Multi-serial port server, the implementation method of the Multi-serial port server include the following steps:
Turn serial port circuit by USB and connects several groups serial port circuit;
It one MCU is set is separately connected USB and turn serial port circuit and network processing circuitry;
The another operating system for setting storage chip storage MCU operations and USB turn serial port circuit driver;
Be powered by power supply so that MCU operation corresponding operating system and load USB turn serial port circuit driver withAnd carry out network signal processing;
Turn the connection that serial port circuit driver realizes network signal and serial port circuit by the USB of operation.
According to one aspect of the present invention, the network processing circuitry peripheral hardware network interface is communicated with internet realization.
The advantages of present invention is implemented:Multi-serial port server of the present invention, including MCU, USB turn serial port circuit, networkProcessing circuit, storage chip, no less than 2 groups of serial port circuit and power supply, the MCU turn serial port circuit, net with USB respectivelyNetwork processing circuit is connected with storage chip, and the power supply turns serial port circuit, network processing circuitry and serial ports with MCU, USB respectivelyCircuit is connected, and the USB turns serial port circuit and is connected with the serial port circuit;As the bridge that serial ports is docked with network,Multiple serial equipments can be connected into a network simultaneously, traditional serial data is docked with network data, realizes and passesSystem equipment networking so that traditional equipment, traditional facility can be connected into network, continue to play use value;Use usb expansionSerial mode, compares serial ports expansion mode, this extended serial port can independently, stablize, the work of high speed.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to needed in the embodimentAttached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for abilityFor the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attachedFigure.
Fig. 1 is a kind of Multi-serial port server architecture schematic diagram of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based onEmbodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every otherEmbodiment shall fall within the protection scope of the present invention.
Embodiment one
As shown in Figure 1, a kind of Multi-serial port server, the Multi-serial port server includes that MCU, USB turn serial port circuit, networkProcessing circuit, storage chip, no less than 2 groups of serial port circuit and power supply, the MCU turn serial port circuit, net with USB respectivelyNetwork processing circuit is connected with storage chip, and the power supply turns serial port circuit, network processing circuitry and serial ports with MCU, USB respectivelyCircuit is connected, and the USB turns serial port circuit and is connected with the serial port circuit.
In practical applications, the serial port circuit is any or several in RS232 circuits, RS485 circuits and RS422 circuitsKind.
In practical applications, it includes at least one USB interface and at least two serial interfaces that the USB, which turns serial port circuit,.
In practical applications, the MCU includes at least one USB interface and at least one network-side interface, the MCU'sThe USB interface that USB interface turns serial port circuit with USB is connected.
In practical applications, the network processing circuitry is connected with the network-side interface of the MCU, and MCU is accessed netNetwork.
In practical applications, the serial interface is connect simultaneously with no less than 2 groups of serial port circuits.
In practical applications, the USB that being equipped in the storage chip can run in MCU turns the driving journey of serial port circuitSequence.
In practical applications, the storage chip is connected by SPI interface with MCU.
Specifically, there is following case study on implementation:
A kind of Multi-serial port server, the serial server include:MCU, USB turn serial port circuit, network processing circuitry, storageChip, N (N=2,3,4 ...) organize RS232 circuits/RS485 circuits/RS422 circuits and power supply;Wherein, the MCU differenceConnection USB turns serial port circuit and network processing circuitry, the bridge as rs 232 serial interface signal and network signal transmitted in both directions.The present invention is realThe serial server that Multi-serial port turns network is showed.
The MCU of selection is the microprocessor of Cortex M3 kernels.Selected MCU contains USB port, the network port, SPI etc.Abundant interface.The MCU internal operations Free-RTOS real time operating systems ensure that mass data processing and system are real-timeProperty.
The features such as storage chip of selection is NAND flash storages, has capacity big, long lifespan, stability is good.It depositsStorage chip interior contains USB and turns serial ports driver, and storage chip is connected by SPI interface and MCU, MCU load operatingsProgram inside storage chip.The storage chip is also used for storage system program and required data.
It includes 4 global functional serial ports that the USB used, which turns serial port circuit, and each serial ports works independently, can run simultaneously, mutually notIt influences.Selected USB turns serial port circuit and usb signal is converted to 4 road TTL rs 232 serial interface signals.Selected USB turns serial port circuit and meetsIndustrial standard, serial ports rate can reach 12MB/s.
Wherein, RS232 circuits select 232 processing chips, the Transistor-Transistor Logic level rs 232 serial interface signal that USB is turned to serial port circuit to be converted toRS232 level signals.The RS232 circuits contain electrical protection circuit, can resist the external disturbances such as electrostatic, surge.
In addition, RS485/RS422 circuits select 485 processing chips, USB is turned to the Transistor-Transistor Logic level rs 232 serial interface signal of serial port circuitBe converted to RS485/RS422 signals.The RS485/RS422 circuits contain electrical protection circuit, can resist electrostatic, surge etc.External disturbance.
The TTL signal end of the RS232 circuits, RS485 circuits and RS422 circuits is connected all the way by AND gate circuit synthesisTurn a serial ports of serial port circuit to USB.The serial ports that 4 USB turn serial port circuit corresponds to 4 groups of such circuits.Every group of circuit is mutualIt is mutually independent to work at the same time.
The network processes chip of the network processing circuitry is an Ethernet PHY chip, and a 10/100M network is adaptiveAnswer chip.The network processes chip is connected with the network-side interface of MCU, realizes network signal and the intercommunication of MCU.It is describedThe additional network transformer of network chip and RJ45 terminals constitute network processing circuitry, and RJ45 is inserted into cable and is connected into outer net.
The power supply of selection is the additional peripheral circuit of DCDC power supply chips.Selected power supply chip is 5-36V Width funtionsInput, output voltage is adjustable, and output current is up to 2A.
Embodiment two
A kind of implementation method of Multi-serial port server, the implementation method of the Multi-serial port server include the following steps:
Turn serial port circuit by USB and connects several groups serial port circuit;
It one MCU is set is separately connected USB and turn serial port circuit and network processing circuitry;
The another operating system for setting storage chip storage MCU operations and USB turn serial port circuit driver;
Be powered by power supply so that MCU operation corresponding operating system and load USB turn serial port circuit driver withAnd carry out network signal processing;
Turn the connection that serial port circuit driver realizes network signal and serial port circuit by the USB of operation.
Wherein, the network processing circuitry peripheral hardware network interface is communicated with internet realization.
The advantages of present invention is implemented:Multi-serial port server of the present invention, including MCU, USB turn serial port circuit, networkProcessing circuit, storage chip, no less than 2 groups of serial port circuit and power supply, the MCU turn serial port circuit, net with USB respectivelyNetwork processing circuit is connected with storage chip, and the power supply turns serial port circuit, network processing circuitry and serial ports with MCU, USB respectivelyCircuit is connected, and the USB turns serial port circuit and is connected with the serial port circuit;As the bridge that serial ports is docked with network,Multiple serial equipments can be connected into a network simultaneously, traditional serial data is docked with network data, realizes and passesSystem equipment networking so that traditional equipment, traditional facility can be connected into network, continue to play use value;Use usb expansionSerial mode, compares serial ports expansion mode, this extended serial port can independently, stablize, the work of high speed.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, anyThose skilled in the art in technical scope disclosed by the invention, all answer by the change or replacement that can be readily occurred inIt is included within the scope of the present invention.Therefore, protection scope of the present invention should be with the scope of the claimsIt is accurate.