CN108880826B - RS232 and RS485 combined interface - Google Patents

RS232 and RS485 combined interface Download PDF

Info

Publication number
CN108880826B
CN108880826B CN201810620128.6A CN201810620128A CN108880826B CN 108880826 B CN108880826 B CN 108880826B CN 201810620128 A CN201810620128 A CN 201810620128A CN 108880826 B CN108880826 B CN 108880826B
Authority
CN
China
Prior art keywords
module
circuit
interface
signal
isolation
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.)
Active
Application number
CN201810620128.6A
Other languages
Chinese (zh)
Other versions
CN108880826A (en
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.)
Baoding Better Electric Equipment Manufacturing Co ltd
Original Assignee
Baoding Better Electric Equipment Manufacturing 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 Baoding Better Electric Equipment Manufacturing Co ltd filed Critical Baoding Better Electric Equipment Manufacturing Co ltd
Priority to CN201810620128.6A priority Critical patent/CN108880826B/en
Publication of CN108880826A publication Critical patent/CN108880826A/en
Application granted granted Critical
Publication of CN108880826B publication Critical patent/CN108880826B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B15/00Suppression or limitation of noise or interference

Abstract

The invention discloses an RS232 and RS485 combined interface which comprises an interface and an external input protection module, wherein the interface and the external input protection module are used for providing interfaces of an RS232 mode and an RS485 mode and inhibiting an overvoltage signal and an overcurrent signal from entering a rear-stage circuit, a differential pressure comparison analysis and RS485 protection module is used for controlling the on-off of the RS485 circuit according to the output of a voltage comparator and realizing the protection of the RS485 circuit, the RS232 and RS485 main circuit and a TT L isolation conversion module are used for signal communication of the RS232 and the RS485 and introducing an interference signal and an abnormal voltage current signal to the external communication, a power supply module is used for providing a 5V isolation power supply for the RS232 main circuit and the RS485 main circuit, and an MCU control unit is in communication connection with the RS232 and RS485 main circuit and the TT L isolation conversion module and is used for receiving and transmitting a rear-stage control instruction.

Description

RS232 and RS485 combined interface
Technical Field
The invention relates to a communication interface, in particular to an RS232 and RS485 combined interface.
Background
With the acceleration of industrialization and information degree, various electronic communication devices rely on RS232 and RS485 interfaces to be more and more extensive, and are used as two most widely applied interface standards of RS232 and RS 485. The RS232 is used as full duplex, but the transmission distance is short, the interference is easy to occur, the RS232 is in a single-point communication mode, the RS485 communication interface is used for replacing the RS232 communication interface, and the RS485 is in a half-duplex transmission mode, so that two most common communication modes of the RS232 and the RS485 exist. Therefore, developing a combined interface which can meet the RS232 communication requirement and is compatible with an RS485 interface becomes a problem to be solved urgently in the field.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an RS232 and RS485 combined interface, which can solve the defects of the prior art, realize the compatible communication of the RS232 and RS485 interfaces, greatly simplify the program design and solve the problem of hardware incompatibility, and is beneficial to better maintenance and communication interconnection of equipment.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows.
An RS232 and RS485 combined interface comprises,
the interface and external input protection module is used for providing interfaces of RS232 and RS485 modes and inhibiting overvoltage signals and overcurrent signals from entering a rear-stage circuit;
a differential pressure comparison analysis and RS485 protection module used for controlling the on-off of the RS485 circuit according to the output of the voltage comparator to realize the protection of the RS485 circuit,
the RS232 and RS485 main circuit and the TT L isolation conversion module are used for signal communication of the RS232 and RS485 and introducing an interference signal and an abnormal voltage and current signal to external communication;
the power supply module is used for providing a 5V isolation power supply for the RS232 main circuit and the RS485 main circuit;
and the MCU control unit is in communication connection with the RS232 and RS485 main circuit and the TT L isolation conversion module and is used for receiving and transmitting a post-stage control instruction.
Preferably, the interface and external input protection module comprises a three-terminal connection port, a self-recovery fuse and a two-terminal regulator which are connected in series.
Preferably, the differential pressure comparison analysis and RS485 protection module comprises an RS232 signal positive-negative conversion module, an L M324 voltage comparator, a T L P521 photoelectric coupler and an RS485 power supply control module which are arranged in series.
Preferably, the RS232 and RS485 main circuits and the TT L isolation conversion module include a port module, a TT L communication isolation module and a TT L communication isolation module which are arranged in series and are respectively connected with the RS485 main circuit and the RS232 main circuit in parallel.
Preferably, the power supply module comprises an internal connection port and an L7805 CV voltage stabilizer which are arranged in series, and the output end of the L7805 CV voltage stabilizer is connected with an ASM1117 voltage stabilizer, an RS485 circuit power supply output module and an RS232 circuit power supply output module in parallel respectively.
Adopt the beneficial effect that above-mentioned technical scheme brought to lie in: the invention can solve the problems of communication mismatching caused by a single interface, equipment development difficulty increase caused by multiple interfaces and resource waste design in the prior art. The method can meet the requirements of different interface standards, greatly simplify port resources, integrate a connection method and simplify operation and maintenance.
Drawings
FIG. 1 is a schematic diagram of one embodiment of the present invention.
Fig. 2 is a block diagram of an interface and external input protection module according to an embodiment of the present invention.
Fig. 3 is a block diagram of a differential pressure comparison analysis and RS485 protection module according to an embodiment of the present invention.
Fig. 4 is a structural diagram of an RS232 and RS485 main circuit and a TT L isolation conversion module according to an embodiment of the present invention.
Fig. 5 is a block diagram of a power module in accordance with an embodiment of the present invention.
Detailed Description
Referring to fig. 1-5, one embodiment of the present invention includes,
the interface and external input protection module 1 is used for providing interfaces of RS232 and RS485 modes and inhibiting overvoltage signals and overcurrent signals from entering a rear-stage circuit;
a differential pressure comparison analysis and RS485 protection module 2, which is used for controlling the on-off of the RS485 circuit according to the output of the voltage comparator to realize the protection of the RS485 circuit,
the RS232 and RS485 main circuit and the TT L isolation conversion module 3 are used for signal communication of the RS232 and RS485 and introducing interference signals and abnormal voltage and current signals to external communication;
the power supply module 4 is used for providing a 5V isolation power supply for the RS232 main circuit and the RS485 main circuit;
and the MCU control unit 5 is in communication connection with the RS232 and RS485 main circuit and the TT L isolation conversion module 3 and is used for receiving and transmitting a post-stage control instruction.
The interface and external input protection module 1 comprises a three-terminal connection port 11, a self-recovery fuse 12 and a two-terminal voltage stabilizer 13 which are arranged in series.
The differential pressure comparison analysis and RS485 protection module 2 comprises an RS232 signal positive-negative conversion module 21, an L M324 voltage comparator 22, a T L P521 photoelectric coupler 23 and an RS485 power supply control module 24 which are arranged in series.
The RS232 and RS485 main circuits and the TT L isolation conversion module 3 comprise a port module 31, a TT L communication isolation module 32 and a TT L communication isolation module 32 which are arranged in series, and the RS485 main circuit 33 and the RS232 main circuit 34 are connected in parallel respectively.
The power module 4 comprises an internal connection port 41 and an L7805 CV voltage stabilizer 42 which are arranged in series, and the output end of the L7805 CV voltage stabilizer 42 is respectively connected with an ASM1117 voltage stabilizer 43, an RS485 circuit power output module 44 and an RS232 circuit power output module 45 in parallel.
The working principle is as follows: the power module 4 provides a required 5V isolation power supply for the RS485 circuit and the RS232 circuit. The interface and external input protection module 1 can be respectively accessed to an RS485 interface mode and an RS232 interface mode; after the communication signal enters the three-terminal connection port 11, in order to protect the damage influence of abnormal overcurrent and overvoltage on the rear-end circuit, the self-recovery fuse 12 and the two-terminal voltage stabilizer 13 are respectively connected, so that the abnormal overcurrent and overvoltage signals can be effectively inhibited from entering the rear-end circuit at the front end. Because the RS232 signal transmission is the signal transceiving mode between RXD and logic ground and between TXD and logic ground, overvoltage protection is respectively carried out between RXD and logic ground, between TXD and logic ground and between RXD and TXD. The protection parameters mainly take RS232 maximum voltage parameters as main parameters, and voltage and current signals in two different modes can pass through the protection parameters.
The interface device has the following three operation modes.
The working mode is as follows: after the MCU control unit 5 sends signals to the circuit, the signals are respectively and simultaneously transmitted to the RS485 and RS232 signals through the isolation circuit, the RS485 and the RS232 can simultaneously generate an A, B differential RS485 mode sending signal and a TXD and logic ground voltage sending signal, and because the RS485 and the RS232 are respectively independent of a power supply, a single line does not form loop pressure difference, so that the signal sending tasks under two modes can be completed due to complementary influence of the two signals.
The second working mode is that when an RS485 mode A, B differential signal is introduced into the external interface or the RXD of the RS232 and a voltage receiving signal of a logic ground are approximately the same as the first working mode, and the signals do not influence respective independent circuits mutually, namely the RS485 signal can be converted into a TT L level by the RS485 circuit and input through an internal port, or the RS232 signal can be converted into a TT L level by the RS232 circuit and input into the MCU control unit 5 or other control acquisition ends through the internal port.
The working mode is three: because RS485 is in A, B differential signal transceiving mode, it is not possible to perform transceiving simultaneously, i.e. half-duplex mode, and RS232 is in transceiving mode between RXD and logic ground, TXD and logic ground, it is possible to perform transceiving simultaneously, i.e. full-duplex mode. Although an independent power supply is arranged between the RXD and the TXD, when data is transmitted and received simultaneously in an RS232 mode, a differential pressure signal of about 30V is generated between the RXD and the TXD, namely an A, B end of the RS485, so that interference can be caused on the RS485 signal, and even the RS485 chip can be damaged. Particularly, a differential pressure comparison analysis and RS485 protection module 2 is designed for the purpose.
When the RS232 interface receives and transmits data independently in a first working mode or a second working mode, namely, a logic 1 is-3-15V, a logic 0 is + 3-15V and noise margin is 2V data, after the RS232 signal positive-negative conversion module 21, a common ground positive signal is generated due to the fact that different power sources are adopted, namely, the conditions of logic 0 and logic 1 are changed into the conditions of logic 0(+3- +15V) for voltage comparison and judgment, after two paths generate voltage signals respectively, after the voltage signals are subjected to more than 3V voltage signals set by L M324, the L M324 voltage comparator 22 generates a low-level signal which is output to the T L P521 photoelectric coupler 23, a rear-level control triode 9013 reference signal is cut off, the RS485 is received and transmitted by control signals at two ends, when the RS 90232 is used for receiving and transmitting data independently, the RS485 protection module does not cut off the data when the RS 90232 is used for receiving and transmitting data independently, the RS485 protection circuit can be switched into a single working mode, and the RS485 protection circuit can be switched into a single receiving and transmitting and receiving and transmitting signals can be switched into a single mode when the RS232 is switched on the RS485 protection circuit.
In the description of the present invention, it is to be understood that the terms "longitudinal", "lateral", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, are merely for convenience of description of the present invention, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention.
The foregoing shows and describes the general principles and broad features of the present invention and advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (4)

1. The utility model provides a RS232 and RS485 combination formula interface which characterized in that: comprises the steps of (a) preparing a mixture of a plurality of raw materials,
the interface and external input protection module (1) is used for providing interfaces of RS232 and RS485 modes and inhibiting overvoltage signals and overcurrent signals from entering a rear-stage circuit;
a differential pressure comparison analysis and RS485 protection module (2) for controlling the on-off of the RS485 circuit according to the output of the voltage comparator to realize the protection of the RS485 circuit,
the RS232 and RS485 main circuit and the TT L isolation conversion module (3) are used for signal communication of the RS232 and RS485 and preventing external communication from introducing interference signals and abnormal voltage and current signals;
the power supply module (4) is used for providing a 5V isolation power supply for the RS232 main circuit and the RS485 main circuit;
the MCU control unit (5) is in communication connection with the RS232 and RS485 main circuits and the TT L isolation conversion module (3) and is used for receiving and transmitting a post-stage control instruction;
the output end of the interface and external input protection module (1) is in communication connection with the input end of the differential pressure comparison analysis and RS485 protection module (2), the output end of the differential pressure comparison analysis and RS485 protection module (2) is in communication connection with the input ends of the RS232 and RS485 main circuits and the TT L isolation conversion module (3), and the output ends of the RS232 and RS485 main circuits and the TT L isolation conversion module (3) are in communication connection with the input end of the MCU control unit (5);
the differential pressure comparison analysis and RS485 protection module (2) comprises an RS232 signal positive-negative conversion module (21), an L M324 voltage comparator (22), a T L P521 photoelectric coupler (23) and an RS485 power supply control module (24) which are arranged in series, the output end of the RS232 signal positive-negative conversion module (21) is connected with the input end of the L M324 voltage comparator (22), the output end of the L M324 voltage comparator (22) is connected with the input end of the T L P521 photoelectric coupler (23), and the output end of the T L P521 photoelectric coupler (23) is connected with the input end of the RS485 power supply control module (24);
when the RS232 interface receives and transmits data independently, after the RS232 signal passes through the RS232 signal positive-negative conversion module (21), a common-ground positive signal is generated due to the fact that different power sources are used for sharing the ground, namely, the situation of logic 0 and logic 1 is changed into the situation of logic 0 to carry out voltage comparison and judgment, after two paths of the two paths generate a low-level signal to be output to the T L P521 photoelectric coupler (23), a reference signal of a rear-level control triode is cut-in, and the RS485 circuit cannot be powered and controlled by the RS485 when the RS232 receives and transmits and receives data independently, and only when the RS485 is in a half-duplex working mode and the RS485 and the RS232 is a full-duplex.
2. The RS232 and RS485 combo interface of claim 1, wherein: the interface and external input protection module (1) comprises a three-terminal connection port (11), a self-recovery fuse (12) and a double-terminal voltage stabilizer (13) which are arranged in series; the output end of the three-end connecting port (11) is connected with the input end of the self-recovery fuse (12), and the output end of the self-recovery fuse (12) is connected with the input end of the double-end voltage stabilizer (13).
3. The RS232 and RS485 combined interface as claimed in claim 1, wherein the RS232 and RS485 main circuit and the TT L isolation conversion module (3) comprise a port module (31) and a TT L communication isolation module (32) which are serially connected, and the TT L communication isolation module (32) is respectively connected with the RS485 main circuit (33) and the RS232 main circuit (34) in parallel.
4. The RS232 and RS485 combined interface as claimed in claim 1, wherein the power module (4) comprises an internal connection port (41) and an L7805 CV voltage stabilizer (42) connected in series, and the output end of the L7805 CV voltage stabilizer (42) is connected in parallel with an ASM1117 voltage stabilizer (43), an RS485 circuit power output module (44) and an RS232 circuit power output module (45), respectively.
CN201810620128.6A 2018-06-15 2018-06-15 RS232 and RS485 combined interface Active CN108880826B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810620128.6A CN108880826B (en) 2018-06-15 2018-06-15 RS232 and RS485 combined interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810620128.6A CN108880826B (en) 2018-06-15 2018-06-15 RS232 and RS485 combined interface

Publications (2)

Publication Number Publication Date
CN108880826A CN108880826A (en) 2018-11-23
CN108880826B true CN108880826B (en) 2020-07-14

Family

ID=64339051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810620128.6A Active CN108880826B (en) 2018-06-15 2018-06-15 RS232 and RS485 combined interface

Country Status (1)

Country Link
CN (1) CN108880826B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450480B (en) * 2018-12-14 2024-01-23 广东电网有限责任公司 RS-485 communication circuit and power supply system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5397928A (en) * 1992-01-17 1995-03-14 Sipex Corporation Voltage tripler using a charge pump having a single multiplexed charge transfer capacitor
CN200980110Y (en) * 2006-11-30 2007-11-21 镇江海达科技有限公司 RS232 and RS485 mixed interface circuit
CN201638145U (en) * 2010-01-12 2010-11-17 北京四方继保自动化股份有限公司 RS232/RS485 (Recommend Standard 232/Recommend Standard 485) integrated interface circuit
CN102110067A (en) * 2009-12-29 2011-06-29 深圳市金博联电力技术有限公司 Highly reliable RS232/RS485/RS422 mixing module for electric power FTU
CN201974473U (en) * 2011-01-07 2011-09-14 安徽省电力科学研究院 Bypass replacement electric quantity automatic discrimination and metering system
CN202795352U (en) * 2012-05-10 2013-03-13 北京北变智达科技有限公司 Wiring method for recommend standard (RS) 232 interface and RS 485 interface

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5397928A (en) * 1992-01-17 1995-03-14 Sipex Corporation Voltage tripler using a charge pump having a single multiplexed charge transfer capacitor
CN200980110Y (en) * 2006-11-30 2007-11-21 镇江海达科技有限公司 RS232 and RS485 mixed interface circuit
CN102110067A (en) * 2009-12-29 2011-06-29 深圳市金博联电力技术有限公司 Highly reliable RS232/RS485/RS422 mixing module for electric power FTU
CN201638145U (en) * 2010-01-12 2010-11-17 北京四方继保自动化股份有限公司 RS232/RS485 (Recommend Standard 232/Recommend Standard 485) integrated interface circuit
CN201974473U (en) * 2011-01-07 2011-09-14 安徽省电力科学研究院 Bypass replacement electric quantity automatic discrimination and metering system
CN202795352U (en) * 2012-05-10 2013-03-13 北京北变智达科技有限公司 Wiring method for recommend standard (RS) 232 interface and RS 485 interface

Also Published As

Publication number Publication date
CN108880826A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN203933593U (en) Half-duplex RS-485 isolation communicating circuit
CN205038637U (en) RS232 and RS485422 interface converter based on microprocessor
CN105141491B (en) RS485 communication circuit and method for realizing spontaneous self-receiving
CN202268916U (en) RS485 communication isolation module
CN108880826B (en) RS232 and RS485 combined interface
CN216013976U (en) Multi-protocol converter
CN203014825U (en) PCM interface test device
CN210270587U (en) RS485 concentrator capable of achieving synchronous acquisition
CN205005065U (en) RS485 communication circuit
CN203982366U (en) Based on ARM and FPGA serial port device flexibly at a high speed
CN107908584B (en) Multi-path RS-485 communication network
CN204695304U (en) A kind of 1553B Bus PC 104 interface board
CN202025203U (en) Feeding type communication circuit
CN204631557U (en) A kind of coalcutter communication system controlled based on PLC
CN204392284U (en) A kind of CAN gateway based on ARM7
CN205003537U (en) Train communication equipment
CN201331694Y (en) Mining essential safe type monitoring substation
CN209930254U (en) Serial port self-sending and self-receiving control circuit
CN208781044U (en) Hydraulic support electronic control system signal coupler
CN203840554U (en) Dual-mode wireless communication equipment used for public bicycle system
CN207706195U (en) A kind of automatic off-line type half-duplex communication circuit
CN202737887U (en) Intelligent communication adapter
CN204442400U (en) A kind of mining RS-485 isolates repeater
CN104683116B (en) A kind of mining RS 485 isolates repeater
CN104486183B (en) A kind of tri-state RS485 means of communication that transmitting-receiving controls certainly

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant