CN102035532A - Software switching circuit for communication serial port - Google Patents

Software switching circuit for communication serial port Download PDF

Info

Publication number
CN102035532A
CN102035532A CN2009101966297A CN200910196629A CN102035532A CN 102035532 A CN102035532 A CN 102035532A CN 2009101966297 A CN2009101966297 A CN 2009101966297A CN 200910196629 A CN200910196629 A CN 200910196629A CN 102035532 A CN102035532 A CN 102035532A
Authority
CN
China
Prior art keywords
serial port
communication serial
gate array
programmable gate
field programmable
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2009101966297A
Other languages
Chinese (zh)
Inventor
丁晨
胡夕祝
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Airui Science & Technology Development Co Ltd
Original Assignee
Shanghai Airui Science & Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Airui Science & Technology Development Co Ltd filed Critical Shanghai Airui Science & Technology Development Co Ltd
Priority to CN2009101966297A priority Critical patent/CN102035532A/en
Publication of CN102035532A publication Critical patent/CN102035532A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Logic Circuits (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)

Abstract

The invention discloses a software switching circuit for a communication serial port. The software switching circuit comprises an I/O (input/output) expansion chip connected with an external bus, a field programmable gate array (FPGA) device connected with I/O expansion chip pins, communication serial modules and voltage conversion modules, wherein, the voltage conversion module is equipped with a serial port, and a serial signal subjected to voltage conversion is connected with a field device via the serial port; the I/O expansion chip is equipped with an even number of channels, a programmable control mode is employed for the channels, and the channels in pairs are respectively connected to the FPGA device to be taken as control signals for controlling switchover among the communication serial modules; and a low-end device with less gates is selected to serve as the FPGA device so as to lower the cost. The software switching circuit is simple in design, and different serial ports are switched to work through application software, thus being stable and reliable, and avoiding damage to the device caused by improper manual operation.

Description

Communication serial port software commutation circuit
Technical field:
The present invention relates to compunication serial ports field, particularly a kind of software commutation circuit that is applied to communication serial port.
Background technology:
The communication serial port of extensive use now has RS422, RS485, RS232 etc., and usually need the mode of operation of conversion communication serial port to satisfy actual needs at the serial interface circuit of practical communication application, changing method all is manually operated mechanical switching mode, has faults such as mistake and contact point inefficacy.And the switching of the serial ports mode of operation in conventional the application must realize by wire jumper or with the outside commutation circuit of driver binding control, must be provided by serial ports controller chip manufacturer, is difficult for realizing.
Communication serial port RS232/485 interface conversion for example commonly used adopts wire jumper or toggle switch to realize, moves towards to realize switching by the Artificial Control signal, and there are faults such as mistake and contact point inefficacy in this mode of operation.
Summary of the invention:
In order to solve the problem that above-mentioned prior art exists, the invention provides a kind of communication serial port software commutation circuit, adopt the I/O extended chip to be connected communication serial port with Field Programmable Gate Array FPGA, and realize handoff functionality between the different communication serial ports, accurately and reliably, effectively avoided mistake or because of improper artificial improper operation produces infringement to equipment, fail safe is good.
The present invention is achieved through the following technical solutions:
Communication serial port software commutation circuit comprises the I/O extended chip that is connected with external bus, with the Field Programmable Gate Array that I/O extended chip pin is connected, communication serial port module and voltage transformation module.
Described voltage transformation module is provided with serial port, and rs 232 serial interface signal is connected with field apparatus by serial port through after the voltage transitions;
Described I/O extended chip is provided with the even number passage, and described passage is controlled by programming, and one group in per two passages are connected respectively to described Field Programmable Gate Array as control signal, control the switching between the described communication serial port module.
The method of described programming Control grouping passage is summarized as follows:
(1) obtains the current state of the outside bus that connects by the address/data register of the external bus that is connected with the I/O extended chip, then wait for busy as state, up to the free time; If state is idle, then carry out next step program;
(2) initialization I/O extended chip makes the individual IO mouth passage of n (n is an even number) be divided into the n/2 group.
Described Field Programmable Gate Array selects for use the less low side devices impose of a number reducing cost, and is provided with the functional block that several realize rs 232 serial interface signals trend that serial ports controllers are drawn in described, is equipped with the serial port corresponding with described functional block outward.
Described functional block is to realize that rs 232 serial interface signal that serial ports controller is drawn moves towards the function of which communication serial port module, for example moves towards RS232 interface or RS485 interface.
Described communication serial port module comprises the some group communication serial port module that are made of two kinds of different communication serial ports, per two different communication serial ports constitute one group, the corresponding connection of output of every group communication serial port module and the functional block of described Field Programmable Gate Array, the corresponding every group of passage that connects described I/O extended chip of the input of described functional block.
The relevant pin of described Field Programmable Gate Array is connected respectively to the signal of the serial ports that serial ports controller draws, the signal of each serial ports is at piece of interior formation, the output state that belongs to the rs 232 serial interface signal of this piece is controlled by the signal value output of described I/O extended chip, and this output valve realizes by programming.For example, switch to example with communication serial port RS232/RS485 interface, when supposing first group RS232 channel control signals unlatching, then Field Programmable Gate Array is exported the required corresponding signal of RS232, and closes the RS485 passage.Otherwise, open the RS485 passage, then the RS232 pathway closure.
The invention has the beneficial effects as follows: adopt programmable gate array device and I/O extended chip to realize that serial ports software switches, it is the software switching interface circuit that is independent of driver, reliable and stable, safe, avoid that manual operation is improper or wrong to bring infringement to equipment.
Description of drawings:
Fig. 1 is a schematic flow sheet of the present invention.
Fig. 2 is applied to the structural representation of communication serial port RS232/485 commutation circuit commonly used for the present invention.
Embodiment:
Further specify the present invention below in conjunction with the drawings and specific embodiments;
Referring to Fig. 1, a kind of communication serial port software of the present invention commutation circuit comprises the I/O extended chip 1, Field Programmable Gate Array 2, communication serial port 3 and the voltage transformation module 4 that are connected with external bus 01.
Described I/O extended chip 1 connects the built-in functional block 21 of described Field Programmable Gate Array 2 by the programming passage, described Field Programmable Gate Array 2 again with described communication serial port 3 corresponding connections, described Field Programmable Gate Array 2 built-in functional blocks 21 are to realize that the rs 232 serial interface signal of its output moves towards the function of which current serial ports, belongs to the functional module of prior art.
Described I/O extended chip 1 by programming control procedure of passage and step summary is: obtain the current state of external bus 01 by the address of the external bus 01 that is connected with I/O extended chip 1, if state then waits for doing, up to the free time; If state is shown as the free time, then initialization I/O extended chip 1 divides into groups its IO mouth passage, one group in per two passages and the functional block 21 corresponding connections built-in with described Field Programmable Gate Array 2.
Described communication serial port 3 connects voltage transformation module 4 again, and described voltage transformation module 4 voltage transitions of signal process that communication serial port 3 spreads out of are to meet electrical code, so that field equipment connecting.
Embodiment one:
Referring to Fig. 2, a kind of communication serial port RS232/485 software commutation circuit is that the present invention is applied to the switching between the communication serial port RS232/485.
A kind of communication serial port RS232/485 software commutation circuit comprises and the outside I that is simple and easy to usefulness most 2The SM Bus GPIO chip 5 that the C bus connects is built-in with the Field Programmable Gate Array FPGA-6 of four functional blocks, four group communication serial ports RS232/RS485 modules 63 and be provided with four groups of RS232/485I/F interface modules 7 of serial port COM-8.
Described SM Bus GPIO chip 5 is that General Purpose Input and Output is a kind of general I/O extended chip, SM Bus GPIO chip 5 is provided with eight passages, described eight passages are controlled by programming, one group in per two passages, built-in with described Field Programmable Gate Array FPGA-6 respectively four functional blocks, 62 corresponding connections, they are to realize that the rs 232 serial interface signal that serial ports controller is drawn moves towards promptly to move towards the RS232 interface or the functional block of RS485 interface.
Because Field Programmable Gate Array FPGA-6 has greater flexibility, also can realize more a plurality of functional blocks according to actual needs.
Eight passages that SM Bus GPIO chip 5 is provided with carry out control connection Field Programmable Gate Array FPGA-6 as control signal by programming, and described programming Control channel packet process and step summary are:
(1) obtains the current state of external bus by the address/data register of the external bus that is connected with SM Bus GPIO chip 5, then wait for busy as state, up to the free time; If state is idle, then carry out next step program;
(2) initialization I/O extended chip is a SM Bus GPIO chip 5, makes eight IO mouth passages be divided into four groups.
The side of described Field Programmable Gate Array FPGA-6 is provided with four serial ports 61, respectively with built-in four functional blocks, 62 corresponding linkings; Each functional block 62 of opposite side is drawn two lines and is connected a group communication serial ports RS232/RS485 module 63 respectively, described four functional blocks, the 62 corresponding four group communication serial ports RS232/RS485 modules 63 that connect.
Every group communication serial ports RS232/RS485 module 63 corresponding 7, four RS232/485I/F interface modules 7 of a RS232/485I/F interface module that connect all are provided with serial port COM-8.
I/F is Interface, the expression interface, and rs 232 serial interface signal need realize meeting the RS232/RS485 electrical code through voltage transitions, so that field equipment connecting.Described RS232/485I/F interface module 7 is that compliant was exported after the RS232/RS485 rs 232 serial interface signal was carried out voltage transitions.
The action principle of present embodiment and step can be sketched and be: the relevant pin of Field Programmable Gate Array FPGA-2 is connected respectively to the rs 232 serial interface signal that serial ports controller is drawn, the signal of each serial ports is piece of the inner formation of programmable gate array device FPGA-2 at the scene, the output state that belongs to the rs 232 serial interface signal of this piece is controlled by the signal value output of SM Bus GPIO chip 5, and this output valve realizes by programming.When supposing first group RS232 channel control signals unlatching, then Field Programmable Gate Array FPGA-2 exports the required corresponding signal of RS232, and closes the RS485 passage.Otherwise, open the RS485 passage, RS232 pathway closure then, described four groups of serial ports are all according to same operation principle.
Embodiment two: referring to Fig. 3, a kind of communication serial port RS232/422 software commutation circuit is that the present invention is applied to the switching between the communication serial port RS232/422.
A kind of communication serial port RS232/422 software commutation circuit comprises and the outside I that is simple and easy to usefulness most 2The SM Bus GPIO chip 9 that the C bus connects is built-in with the Field Programmable Gate Array FPGA-10 of four functional blocks 101, four group communication serial ports RS232/RS422 modules 102 and be provided with four groups of RS232/422I/F interface modules 11 of serial port COM-12.
Described SM Bus GPIO chip 9 is that General Purpose Input and Output is a kind of general I/O extended chip, SM Bus GPIO chip 9 is provided with eight passages, described eight passages are controlled by programming, one group in per two passages, built-in with described Field Programmable Gate Array FPGA-10 respectively four functional blocks, 101 corresponding connections, they are to realize that the rs 232 serial interface signal that serial ports controller is drawn moves towards promptly to move towards the RS232 interface or the functional block of RS422 interface.
Described SM Bus GPIO chip 9 carries out the control channel grouping by programming, and its control procedure is:
(1) obtains the current state of external bus by the bus address/data register that is connected with SM Bus GPIO chip 9, if state then waits for busy, up to the free time; Carry out next step program when idle;
(2) initialization I/O extended chip is a SM Bus GPIO chip 9, makes eight IO mouth passages be divided into four groups.
Because Field Programmable Gate Array FPGA-10 has greater flexibility, also can realize more a plurality of functional blocks according to actual needs.
Eight passages that SM Bus GPIO chip 9 is provided with carry out control connection Field Programmable Gate Array FPGA-10 as control signal by programming, the side of described programmable gate array device FPGA-10 is provided with four serial ports 13, respectively with built-in four functional blocks, 101 corresponding linkings, each functional block 101 correspondence of opposite side are drawn two lines and a group communication serial ports RS232/RS422 module 102, the corresponding respectively four group communication serial ports RS232/RS422 modules 102 that connect of described four functional blocks 101.
RS232/RS422IF interface module 11 of described every group communication serial ports RS232/RS422 module 102 corresponding connections, described RS232/RS422IF interface module 11 is to be the exportable signal of electrical code with RS232/RS422 rs 232 serial interface signal voltage transitions, and is connected with external equipment by serial port COM-12.
The course of work of present embodiment is summarized as follows:
The relevant pin of Field Programmable Gate Array FPGA-10 is connected respectively to the rs 232 serial interface signal that serial ports controller is drawn, the signal of each serial ports is piece of the inner formation of programmable gate array device FPGA-10 at the scene, the output state that belongs to the rs 232 serial interface signal of this piece is controlled by the signal value output of SM Bus GPIO chip 9, and this output valve realizes by programming.After rs 232 serial interface signal process RS232/RS422IF interface module 11 voltage transitions of Field Programmable Gate Array FPGA-10 output, be connected with external equipment by the serial port COM-12 that is connected with described RS232/RS422IF interface module 11.
When supposing first group RS232 channel control signals unlatching, then Field Programmable Gate Array FPGA-10 exports the required corresponding signal of RS232, and closes the RS422 passage.Otherwise, open the RS422 passage, RS232 pathway closure then, above-mentioned four groups of serial ports are all according to same operation principle.
Embodiment three: referring to Fig. 4, a kind of communication serial port RS422/485 software commutation circuit is that the present invention is applied to the switching between the communication serial port RS422/485.
A kind of communication serial port RS422/485 software commutation circuit, comprise the SM Bus GPIO chip 14 that is connected with the outside I2C bus that is simple and easy to usefulness most, be built-in with the Field Programmable Gate Array FPGA-17 of four functional blocks 171, four group communication serial ports RS422/RS485 modules 172 and four groups of RS232/485I/F interface modules 15 that are provided with serial port COM-16.
Described SM Bus GPIO chip 14 is that General Purpose Input and Output is a kind of general I/O extended chip, SM Bus GPIO chip 14 is provided with eight passages, described eight passages are controlled by programming, one group in per two passages, built-in with described Field Programmable Gate Array FPGA-17 respectively four functional blocks, 171 corresponding connections, they are to realize that the rs 232 serial interface signal that serial ports controller is drawn moves towards promptly to move towards the RS422 interface or the functional block of RS485 interface.
Because Field Programmable Gate Array FPGA-17 has greater flexibility, also can realize more a plurality of functional blocks according to actual needs, promptly in the Field Programmable Gate Array FPGA-17 more function piece 171 can be set, with practical requirement.
Eight passages that SM Bus GPIO chip 14 is provided with carry out control connection Field Programmable Gate Array FPGA-6 as control signal by programming, and control procedure and step summary are:
(1) obtains the current state of external bus by the address/data register of the external bus that is connected with SM Bus GPIO chip 14, then wait for busy as state, up to the free time; If state is shown as the free time, then carry out next step program.
(2) initialization I/O extended chip is a SM Bus GPIO chip 14, makes eight IO mouth passages be divided into four groups;
The side of described Field Programmable Gate Array FPGA-17 is provided with four serial ports 18, respectively with built-in four functional blocks, 171 corresponding linkings; Each functional block 171 of opposite side is drawn two lines and is connected a group communication serial ports RS422/RS485 module 172 respectively, described four functional blocks, the 171 corresponding four group communication serial ports RS422/RS485 modules 172 that connect.
Every group communication serial ports RS422/RS485 module 172 corresponding 15, four RS422/485I/F interface modules 15 of a RS422/485I/F interface module that connect all are provided with serial port COM-16.
Described RS232/485I/F interface module 15 is that compliant was exported by serial port COM-16 after the RS232/RS485 rs 232 serial interface signal was carried out voltage transitions, is connected with external equipment.
The course of work of present embodiment is as described below:
The relevant pin of Field Programmable Gate Array FPGA-17 is connected respectively to the rs 232 serial interface signal that serial ports controller is drawn, the signal of each serial ports is piece of the inner formation of programmable gate array device FPGA-17 at the scene, and the output state that belongs to the rs 232 serial interface signal of this piece is controlled by the signal value output of SM Bus GPIO chip 14.After the rs 232 serial interface signal process RS232/RS422IF interface module 15 voltage transitions standards of Field Programmable Gate Array FPGA-10 output, be connected with external equipment by the serial port COM-16 that is connected with described RS422/RS485IF interface module 15.
When supposing first group RS422 channel control signals unlatching, then Field Programmable Gate Array FPGA-17 exports the required corresponding signal of RS422, and closes the RS485 passage.Otherwise, open the RS485 passage, RS422 pathway closure then, above-mentioned four groups of serial ports are all according to same operation principle.
More than show and described basic principle of the present invention, principal character and advantage of the present invention.The technical staff of the industry should understand; the present invention is not restricted to the described embodiments; that describes in the foregoing description and the specification just illustrates principle of the present invention; the present invention also has various changes and modifications without departing from the spirit and scope of the present invention, and these changes and improvements all fall in the claimed scope of the invention.The claimed scope of the present invention is defined by appending claims and equivalent thereof.

Claims (2)

1. communication serial port software commutation circuit, it is characterized in that, it comprises the I/O extended chip (1) that is connected with external bus (01), the Field Programmable Gate Array FPGA (2) that is connected with I/O extended chip (1) pin, communication serial port (3) and voltage transformation module (4); Described I/O extended chip (1) is provided with the even number passage, described passage is controlled by programming, one group in per two passages, be connected respectively to described Field Programmable Gate Array (2) as control signal, control the switching between described communication serial port (3) different mode, described Field Programmable Gate Array (2) is built-in with the functional block (21) of the rs 232 serial interface signal trend that realizes output;
The corresponding connection of output of the functional block (21) that one end of every group communication serial ports (3) and described Field Programmable Gate Array (2) are built-in, the corresponding every group of passage that connects described I/O extended chip (1) of the input of described functional block (21), the other end connection of described communication serial port (3) is described can be with the voltage transformation module (4) of rs 232 serial interface signal voltage transitions.
2. a kind of communication serial port software commutation circuit according to claim 1, it is characterized in that, described I/O extended chip is a SM Bus GPIO chip (5), SM Bus GPIO chip (5) is provided with eight passages by programming language, and corresponding the connection is built-in with the Field Programmable Gate Array (6) of four functional blocks and the communication serial port RS232/RS485 that switches;
The corresponding connection of a functional block of one group in per two passages in the SM Bus GPIO chip (5) and Field Programmable Gate Array (6), the corresponding four group communication serial ports RS232/RS485 that connect of described each functional block, the corresponding RS232/485I/F module interface (7) that connects of every group communication serial ports RS232/RS485, described RS232/485I/F interface module (7) is provided with serial port COM (8).
CN2009101966297A 2009-09-28 2009-09-28 Software switching circuit for communication serial port Pending CN102035532A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101966297A CN102035532A (en) 2009-09-28 2009-09-28 Software switching circuit for communication serial port

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101966297A CN102035532A (en) 2009-09-28 2009-09-28 Software switching circuit for communication serial port

Publications (1)

Publication Number Publication Date
CN102035532A true CN102035532A (en) 2011-04-27

Family

ID=43887952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101966297A Pending CN102035532A (en) 2009-09-28 2009-09-28 Software switching circuit for communication serial port

Country Status (1)

Country Link
CN (1) CN102035532A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104320594A (en) * 2014-11-21 2015-01-28 连明昌 Serial port matrix switcher based on FPGA
CN105934727A (en) * 2014-01-31 2016-09-07 惠普发展公司,有限责任合伙企业 Output voltage to serial communication port
CN106647443A (en) * 2016-10-31 2017-05-10 杭州优稳自动化系统有限公司 Intelligent controller cascade method
CN110895501A (en) * 2019-06-10 2020-03-20 研祥智能科技股份有限公司 Serial port switching method and system
CN111948965A (en) * 2020-08-14 2020-11-17 上海博瀛通信科技有限公司 System and method for controlling external serial port termination resistor of industrial ONU

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105934727A (en) * 2014-01-31 2016-09-07 惠普发展公司,有限责任合伙企业 Output voltage to serial communication port
CN104320594A (en) * 2014-11-21 2015-01-28 连明昌 Serial port matrix switcher based on FPGA
CN106647443A (en) * 2016-10-31 2017-05-10 杭州优稳自动化系统有限公司 Intelligent controller cascade method
CN110895501A (en) * 2019-06-10 2020-03-20 研祥智能科技股份有限公司 Serial port switching method and system
CN110895501B (en) * 2019-06-10 2024-05-14 研祥智慧物联科技有限公司 Serial port switching method and system thereof
CN111948965A (en) * 2020-08-14 2020-11-17 上海博瀛通信科技有限公司 System and method for controlling external serial port termination resistor of industrial ONU

Similar Documents

Publication Publication Date Title
CN102035532A (en) Software switching circuit for communication serial port
CN104778109B (en) Program downloading system and method for PCIE/PCIX external plug-in card
CN104865958A (en) Matrix switch device, system and method
CN101841419B (en) Method and device for multiplexing communication port
CN201335959Y (en) Multi-channel digital switch signal controller
CN201878164U (en) Dual-redundant network-based embedded intelligent transmission controller
CN201600687U (en) Communication serial software switching circuit
CN106339339B (en) The USB control circuit of bist signal repeat circuit
CN105589384B (en) A kind of multi-channel digital amount input/output unit based on FPGA
CN107885119A (en) A kind of universal parallel switch matrix system and method
CN101170780B (en) Method for dual mode terminal to prevent from current backflow between two radio modules
CN203287403U (en) Signal wiring device
CN101420373B (en) Method for switching between two types of network packets and network apparatus therefor
CN102081120B (en) Testing system
CN108345231A (en) Power equipment linkage control method, system and device
CN202009389U (en) Network switching device
CN208888804U (en) A kind of multi-processor electronic device
CN113759862A (en) Signal switching device and signal control method
CN208386539U (en) A kind of co-located filter of multichannel cavity
CN215867827U (en) Multi-station program burning device for core board of energy controller
CN102136914A (en) Network switching device
CN2529309Y (en) Switchover apparatus for keyboard and mouse of computer
CN103838693A (en) Data transmission device and mobile terminal
CN103825747A (en) Splitter system compatible with 100M Ethernet and 1000M Ethernet
CN208314525U (en) A kind of switch matrix in 6 × 12 duplicate rows channels

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20110427