CN109302204A - Adaptive transmitting-receiving RS485 circuit - Google Patents

Adaptive transmitting-receiving RS485 circuit Download PDF

Info

Publication number
CN109302204A
CN109302204A CN201811465147.2A CN201811465147A CN109302204A CN 109302204 A CN109302204 A CN 109302204A CN 201811465147 A CN201811465147 A CN 201811465147A CN 109302204 A CN109302204 A CN 109302204A
Authority
CN
China
Prior art keywords
optocoupler
foot
max485 chip
output end
power supply
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
CN201811465147.2A
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.)
704th Research Institute of CSIC
Original Assignee
704th Research Institute of CSIC
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 704th Research Institute of CSIC filed Critical 704th Research Institute of CSIC
Priority to CN201811465147.2A priority Critical patent/CN109302204A/en
Publication of CN109302204A publication Critical patent/CN109302204A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/38Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
    • H04B1/40Circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B1/00Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
    • H04B1/38Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
    • H04B1/40Circuits
    • H04B1/44Transmit/receive switching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40032Details regarding a bus interface enhancer

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Dc Digital Transmission (AREA)
  • Communication Control (AREA)

Abstract

The present invention relates to a kind of adaptive transmitting-receiving RS485 circuits, existing RS485 communicating circuit is improved, during data transmit-receive, according to RE, DE port level of the feature adjust automatically transceiving chip of bus and sending port data, to switch the read-write state of RS485 interface chip before the deadline, it is adapted the feature of itself and handled data, to obtain optimal transmitting-receiving effect.Feature of the circuit of the present invention according to sending and receiving data, the reiving/transmitting state of automatic switching interface chip, thus the Transistor-Transistor Logic level communicating circuit of RS485, RS232 and single-chip microcontroller is unified, realize the compatibility of software and hardware.

Description

Adaptive transmitting-receiving RS485 circuit
Technical field
The present invention relates to a kind of designing technique of communicating circuit, in particular to a kind of adaptive transmitting-receiving RS485 circuit.
Background technique
RS485 communicating circuit generallys use the MAX485 interface chip of Maxim company production as core, contains inside it One driver and receiver.The end RO and DI is respectively the output of receiver and the input terminal of driver, and respectively with single-chip microcontroller Receiving port RXD be connected with sending port TXD;What the end RE and DE of MAX485 interface chip respectively sended and received makes Energy end, when RE is logical zero, device is in reception state;When DE is logical one, device is in transmission state.
Fig. 1 is the RS485 circuit diagram of existing conventional belt isolation.When the port R/D exports high level, optocoupler U3 cut-off, It is low level that receiver output enable end RE (2 foot in Fig. 1) of MAX485 chip, which is pulled down resistance R4 drop-down, and MAX485 chip connects It receives device to enable, at this point, the level signal of the port RXD is by the receiver output end RO foot of optocoupler U1 and MAX485 chip (in Fig. 1 1 foot) it keeps synchronizing;When the output of the port R/D is low level, the driver of optocoupler U3 conducting, MAX485 chip exports enable end DE foot (3 foot in Fig. 1) is set to high level, and the driver of MAX485 chip is enabled, at this point, the driver input end of MAX485 chip DI foot (4 foot in Fig. 1) is synchronous with the holding of the level of the port TXD by optocoupler U4, and data are sent to bus.Pull-up resistor R7 is under Pull-up resistor R8 is for guaranteeing that connectionless MAX485 chip is in idle condition.
RS485 communicating circuit needs to occupy the additional I/O port resource of single-chip microcontroller compared with RS232 communicating circuit to realize number According to the switching of reiving/transmitting state, and it is also required on drive software the logical sequence of extra process RE, DE control terminal.Once monolithic Machine clock adjusts, and will lead to the sequence change of RS485 control terminal, is unfavorable for the transplanting of driver.
Summary of the invention
The present invention be directed to RS485 to communicate the problem of opposite RS232 communication needs additional control logics timing, propose one The adaptive transmitting-receiving RS485 circuit of kind, user no longer need to consider the control of the port RE, DE, will make the hardware and software development of RS485 It is fully equivalent to RS232.
The technical solution of the present invention is as follows: a kind of adaptive transmitting-receiving RS485 circuit, two groups of completely isolated power supply 3.3V and VCC-485 is used for the two sides photo-coupler PC817 respectively, and power supply 3.3V powers to optocoupler U1 input terminal and optocoupler U3 output end, Power supply VCC-485 connects optocoupler U1 output end and optocoupler U3 supplying power for input end;It sends the port TXD and meets optocoupler U1 input terminal, optocoupler U1 Output end passes through the emitter and base stage that resistance R3 and R5 meet PNP type triode Q1 respectively, and the collector of triode Q1 connects The receiver output enable end RE and driver of MAX485 chip export enable end DE foot, the collector series resistance of triode Q1 R7 ground connection, and connect with the GND foot of the driver input end DI foot of MAX485 chip, MAX485 chip;It receives the port RXD and connects light Coupling U3 output end, the receiver output end RO foot of optocoupler U3 input termination MAX485 chip;The VCC foot of MAX485 chip connects power supply VCC-485;The receiver positive input of MAX485 chip connects power supply by pull-up resistor R4 with driver positive output end A foot VCC-485;The receiver anti-phase input and driver reversed-phase output B foot of MAX485 chip are grounded by pull down resistor R8.
The resistance R4 and R8 value range are 3.9k Ω~4.7k Ω, keep the build-out resistor pressure drop in 485 buses big In 200mV, to improve the anti-electromagnetic interference capability of bus.
The beneficial effects of the present invention are: the present invention adaptively receives and dispatches RS485 circuit, according to the feature of sending and receiving data, certainly The reiving/transmitting state of dynamic switching interface chip, thus the Transistor-Transistor Logic level communicating circuit of RS485, RS232 and single-chip microcontroller is unified, it realizes The compatibility of software and hardware.
Detailed description of the invention
Fig. 1 is the RS485 circuit diagram of existing conventional belt isolation;
Fig. 2 is host communication circuit diagram of the present invention;
Fig. 3 is reception state equivalent circuit diagram of the present invention;
Fig. 4 is equivalent circuit diagram when the present invention sends " 0 ";
Fig. 5 is equivalent circuit diagram when the present invention sends " 1 ".
Specific embodiment
RS485 communication bus is using calling -- the communication modes of response.Either host equipment or slave devices, silent Recognize under situation, is set as receiving data mode;When equipment needs to send data and has been achieved with bus marco temporary, it is changed into hair Send state;Whenever completion transmission task, then it is immediately returned to reception state, bus control right can be surrendered automatically at this time.
The communicating circuit design of certain node is as shown in Figure 2.Communicating circuit is one completely in strict accordance with insulation request Both threads RS485 communicating circuit, meets the design requirement of technical grade product.Two groups of completely isolated power supplys (3.3V and VCC- 485) it is used respectively for the two sides photo-coupler PC817.Power supply 3.3V powers to optocoupler U1 input terminal and optocoupler U3 output end, power supply VCC-485 connects optocoupler U1 output end and optocoupler U3 supplying power for input end;It sends the port TXD and connects optocoupler U1 input terminal, optocoupler U1 output End connects the emitter and base stage of PNP type triode Q1 by resistance R3 and R5 respectively, and the collector of triode Q1 connects MAX485 core Receiver output enable end RE (2 foot in Fig. 2) of piece and driver output enable end DE foot (3 foot in Fig. 2), the collection of triode Q1 Electrode Series Resistance R7 ground connection, and the GND with the driver input end DI foot (4 foot in Fig. 2) of MAX485 chip, MAX485 chip Foot (5 foot in Fig. 2) connection;It receives the port RXD and connects optocoupler U3 output end, the receiver of optocoupler U3 input termination MAX485 chip is defeated Outlet RO foot (1 foot in Fig. 2);The VCC foot (8 foot in Fig. 2) of MAX485 chip meets power supply VCC-485;The reception of MAX485 chip The input of device positive meets power supply VCC-485 by pull-up resistor R4 with driver positive output end A foot (6 foot in Fig. 2);MAX485 core The receiver anti-phase input and driver reversed-phase output B foot (7 foot in Fig. 2) of piece are grounded by pull down resistor R8.
The port transmission TXD of processor and reception RXD port signal pass through optocoupler U1 and U3 (PC817) isolated variable respectively For secondary side voltage signal, realize that two lateral circuits of photo-coupler are completely isolated.
When serial communication interface receives data, according to TTL characteristic, sending the port TXD at this time is idle state, exports high electricity Flat 1, optocoupler U1 cut-off.Triode Q1 is positive-negative-positive, and due to the cut-off of U1, the base voltage of Q1 is drawn high by resistance, triode Q1 In off state.Equivalent circuit such as Fig. 3 when data is received, the port RXD is received by optocoupler U3 isolation and connects MAX485 chip RO foot.
DE, RE of MAX485 chip are pulled down resistance R7 down for 0, and chip, which is in, receives enabled state.Serial communication connects The RXD port level of mouth is synchronous with bus level " 0 " or " 1 " holding by optocoupler PC817.The node, which is in stablize, receives shape State.
When COM TXD sends " 0 ", optocoupler U1 conducting, the base stage of triode Q1 is set by the output end of optocoupler For low level, the base-emitter drop of triode Q1 reaches threshold value, triode Q1 conducting.Equivalent circuit such as Fig. 4. The port DE, RE of MAX485 chip is set to a height of 1 by the collector of Q1, at this point, MAX485, which is in data, sends state, and interior No. 4 feet of input port of portion's driver connect low level.Therefore, " 0 " is sent on output bus.
When the port TXD sends " 1 ", optocoupler U1 cut-off.Triode Q1 is positive-negative-positive, due to the cut-off of U1, the base voltage of Q1 It is drawn high by resistance, triode Q1 is also at off state.Equivalent circuit such as Fig. 5.At this point, DE, RE of MAX485 are pulled down jointly For resistance R7 down for 0, chip cannot send the data on No. 4 feet of driver.But output bus is in pull-up resistor R4 and drop-down electricity Under the collective effect for hindering R8, the end A pull-up is height, and the drop-down of the end B is low, thus bus keeps high level output state.Although MAX485 chip does not send data by driver, but has also reached transmission " 1 " under the collective effect of resistance R4, R8 Effect.R4 and R8 value range is 3.9k Ω~4.7k Ω, and the build-out resistor pressure drop in 485 buses is made to be greater than 200mV, with Improve the anti-electromagnetic interference capability of bus.
During data transmit-receive, according to the end RE, DE of the feature adjust automatically transceiving chip of bus and sending port data Mouth level makes its feature phase with handled data to switch the read-write state of RS485 interface chip before the deadline It adapts to, to obtain optimal transmitting-receiving effect.In Distributed Control System constructed by the RS485 communicating circuit adaptively received and dispatched, net Network any moment can only have a node to send data to bus, other nodes necessarily are in reception state.Therefore, each is saved Point default makes MAX485 chip be in reception state, avoids bus contention.Adaptive transmission circuit has used PNP type triode control The adaptive switching of reiving/transmitting state is completed in the transmitting-receiving enable end of MAX485 chip processed.The biasing resistor of output bus is used as must not The device that can lack completes the function that state " 1 " is sent to bus.

Claims (2)

1. a kind of adaptive transmitting-receiving RS485 circuit, which is characterized in that two groups of completely isolated power supply 3.3V and VCC-485 difference It is used for the two sides photo-coupler PC817, power supply 3.3V powers to optocoupler U1 input terminal and optocoupler U3 output end, power supply VCC-485 Connect optocoupler U1 output end and optocoupler U3 supplying power for input end;It sends the port TXD and connects optocoupler U1 input terminal, optocoupler U1 output end leads to respectively Emitter and base stage that resistance R3 and R5 meet PNP type triode Q1 are crossed, the collector of triode Q1 connects the reception of MAX485 chip Device exports enable end RE and driver exports enable end DE foot, and the collector series resistance R7 of triode Q1 is grounded, and with The GND foot connection of the driver input end DI foot, MAX485 chip of MAX485 chip;It receives the port RXD and connects optocoupler U3 output end, The receiver output end RO foot of optocoupler U3 input termination MAX485 chip;The VCC foot of MAX485 chip meets power supply VCC-485; The receiver positive input of MAX485 chip meets power supply VCC-485 by pull-up resistor R4 with driver positive output end A foot; The receiver anti-phase input and driver reversed-phase output B foot of MAX485 chip are grounded by pull down resistor R8.
2. adaptively receiving and dispatching RS485 circuit according to claim 1, which is characterized in that the resistance R4 and R8 value range For 3.9k Ω~4.7k Ω, the build-out resistor pressure drop in 485 buses is set to be greater than 200mV, to improve the electromagnetism interference of bus Ability.
CN201811465147.2A 2018-12-03 2018-12-03 Adaptive transmitting-receiving RS485 circuit Pending CN109302204A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811465147.2A CN109302204A (en) 2018-12-03 2018-12-03 Adaptive transmitting-receiving RS485 circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811465147.2A CN109302204A (en) 2018-12-03 2018-12-03 Adaptive transmitting-receiving RS485 circuit

Publications (1)

Publication Number Publication Date
CN109302204A true CN109302204A (en) 2019-02-01

Family

ID=65142122

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811465147.2A Pending CN109302204A (en) 2018-12-03 2018-12-03 Adaptive transmitting-receiving RS485 circuit

Country Status (1)

Country Link
CN (1) CN109302204A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111127867A (en) * 2019-10-21 2020-05-08 国网浙江临海市供电有限公司 RS485 communication adapter for electricity consumption information acquisition system and control method
CN112052212A (en) * 2020-08-26 2020-12-08 天津津航计算技术研究所 RS485 communication flow control isolation circuit

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5469473A (en) * 1994-04-15 1995-11-21 Texas Instruments Incorporated Transceiver circuit with transition detection
CN101719112A (en) * 2009-11-19 2010-06-02 北京东方信联科技有限公司 Half-duplex automatic receiving-transmitting switching circuit of RS485
CN102708823A (en) * 2012-06-01 2012-10-03 天马微电子股份有限公司 Automatic switching circuit for RS232 interface and RS485 interface and serial port liquid crystal display module
JP2013026894A (en) * 2011-07-22 2013-02-04 Hitachi Cable Ltd Modem and antenna control system
WO2014048269A1 (en) * 2012-09-27 2014-04-03 广东易事特电源股份有限公司 Communication circuit for automatically performing transceiving control on rs485
CN103780279A (en) * 2014-01-25 2014-05-07 济南诺辉节能技术开发有限公司 Indoor energy efficiency management terminal communication module
CN205142203U (en) * 2015-11-23 2016-04-06 无锡隆玛科技股份有限公司 Automatic transceiver circuits of RS485
CN107809264A (en) * 2017-09-15 2018-03-16 上海大学 A kind of RS485 turns eight road RS232 radio communication converter
CN209120171U (en) * 2018-12-03 2019-07-16 中国船舶重工集团公司第七0四研究所 Adaptive transmitting-receiving RS485 circuit

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5469473A (en) * 1994-04-15 1995-11-21 Texas Instruments Incorporated Transceiver circuit with transition detection
CN101719112A (en) * 2009-11-19 2010-06-02 北京东方信联科技有限公司 Half-duplex automatic receiving-transmitting switching circuit of RS485
JP2013026894A (en) * 2011-07-22 2013-02-04 Hitachi Cable Ltd Modem and antenna control system
CN102708823A (en) * 2012-06-01 2012-10-03 天马微电子股份有限公司 Automatic switching circuit for RS232 interface and RS485 interface and serial port liquid crystal display module
WO2014048269A1 (en) * 2012-09-27 2014-04-03 广东易事特电源股份有限公司 Communication circuit for automatically performing transceiving control on rs485
CN103780279A (en) * 2014-01-25 2014-05-07 济南诺辉节能技术开发有限公司 Indoor energy efficiency management terminal communication module
CN205142203U (en) * 2015-11-23 2016-04-06 无锡隆玛科技股份有限公司 Automatic transceiver circuits of RS485
CN107809264A (en) * 2017-09-15 2018-03-16 上海大学 A kind of RS485 turns eight road RS232 radio communication converter
CN209120171U (en) * 2018-12-03 2019-07-16 中国船舶重工集团公司第七0四研究所 Adaptive transmitting-receiving RS485 circuit

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111127867A (en) * 2019-10-21 2020-05-08 国网浙江临海市供电有限公司 RS485 communication adapter for electricity consumption information acquisition system and control method
CN112052212A (en) * 2020-08-26 2020-12-08 天津津航计算技术研究所 RS485 communication flow control isolation circuit
CN112052212B (en) * 2020-08-26 2023-03-03 天津津航计算技术研究所 RS485 communication flow control isolation circuit

Similar Documents

Publication Publication Date Title
CN201434881Y (en) RS485 interface circuit and electric energy meter employing same
CN105141491B (en) RS485 communication circuit and method for realizing spontaneous self-receiving
CN103248526A (en) Communication equipment and method for achieving out-of-band monitoring and management, and master-slave switching method
CN205193466U (en) Home systems's gateway peripheral circuit and this home systems based on ARM and zigBee
US11226917B2 (en) Translation-based signal generation method and device, home bus system (HBS) circuit, and user equipment
CN216596246U (en) Self-adaptive circuit compatible with multi-serial port protocol and communication equipment
CN109302204A (en) Adaptive transmitting-receiving RS485 circuit
CN208477523U (en) A kind of arithmetic system and corresponding electronic equipment
CN203851126U (en) Circuit realizing two-way communication by using single line
CN108647180A (en) A kind of arithmetic system and corresponding electronic equipment
CN209120171U (en) Adaptive transmitting-receiving RS485 circuit
CN205142257U (en) 485 communication interface circuit of two compatible opto -couplers and control of three opto -couplers
CN209373587U (en) A kind of communication interface circuit
CN210867765U (en) Remote control network switch
CN202475477U (en) Transmit-receive automatic switching circuit for converting RS485 interface into serial port
CN208636683U (en) RS485 electrical level transferring chip
CN203706202U (en) Transmission converter for USB signals and serial wireless signals
CN109597783A (en) A kind of double light-coupled isolation type RS485 circuits
CN215867844U (en) Serial port communication isolation circuit
CN106372025B (en) Bus type communicating circuit
CN213042273U (en) Circuit for converting two-wire system serial bus interface into single-wire half-duplex bus interface
CN210609167U (en) Communication switching circuit and communication switching device
CN113111021A (en) UART master-slave line communication control circuit and method
CN209748544U (en) RS485 half-duplex is from receiving and dispatching circuit
CN210721160U (en) Temperature control circuit and temperature control device

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