RS485 communication circuit

By introducing the control unit and protection unit into the RS485 communication circuit, the automatic switching of the 485 communication chip is realized, which solves the problem of data sending and receiving status switching caused by MCU control, and improves the real-time and reliability of the communication circuit.

CN221669874UActive Publication Date: 2024-09-06川泽电气(厦门)有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202323520829.8
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2024-09-06
Estimated Expiration
2033-12-22

AI Technical Summary

Technical Problem

The existing RS485 communication circuit needs to control the sending enable pin DE and the receiving enable pin through the MCU to control the 485 communication chip to be in the state of sending data or receiving data, and cannot realize automatic switching between data sending and data receiving.

Method used

An RS485 communication circuit is designed, including a control unit, a transceiver unit and a protection unit. The transceiver unit is automatically controlled to be in the receiving or transmitting state through the switching device, avoiding the intervention of the MCU and realizing automatic switching of data transmission and reception.

Benefits of technology

It improves the real-time performance and reliability of the RS485 communication circuit, saves MCU resources, realizes automatic switching of data sending and receiving, and reduces the system bit error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN221669874U
    Figure CN221669874U
Patent Text Reader

Abstract

The utility model provides an RS485 communication circuit, and the circuit is characterized in that a control unit is used for controlling the on-off of a switching device in the control unit according to the existence condition of a data signal of a data transmitting end, so as to output a corresponding control signal; the transceiving unit is used for controlling itself to be in a data receiving state or a data sending state according to the control signal; wherein when the data signal does not exist at the data transmitting end, the switching device is not conducted, and the control signal is used for controlling the transceiving unit to be in a data receiving state; when a data signal exists at the data transmitting end, the switching device is switched on, and the control signal is used for controlling the transceiving unit to be in a data transmitting state, so that the problem that the existing RS485 communication circuit needs to control the transmitting enabling pin DE and the receiving enabling pin # imgabs0 # through the MCU to control the 485 communication chip to be in a data transmitting or receiving state is solved; and automatic switching between data sending and data receiving cannot be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The utility model relates to the technical field of power electronics, in particular to an RS485 communication circuit. Background Art

[0002] In the field of industrial control technology, buses are mostly used for information transmission and data exchange between external devices and main controllers. RS485 bus communication is a commonly used bus communication technology. To achieve RS485 bus communication, 485 communication chips and MCUs are usually used in external devices and main controllers.

[0003] The 485 communication chip is a half-duplex communication chip, which has two channels: sending and receiving. At any time, it can only be in a state of data sending or data receiving, and cannot send and receive data at the same time. The 485 communication chip has a sending input pin DI, a receiving output pin RO, a sending enable pin DE and a receiving enable pin Usually, the MCU controls the transmit enable pin DE and the receive enable pin To control the 485 communication chip to be in the state of sending data or receiving data. When the sending enable pin DE is high, it is in the state of sending data. When the receiving enable pin is high, it is in the state of sending data. When it is at a low level, it is in the data receiving state and cannot achieve automatic switching between data sending and data receiving. Utility Model Content

[0004] In view of this, the embodiment of the utility model provides an RS485 communication circuit to solve the problem that the existing RS485 communication circuit needs to control the sending enable pin DE and the receiving enable pin through the MCU. To control the 485 communication chip to be in the state of sending data or receiving data, the problem of being unable to realize the automatic switching of data sending and data receiving.

[0005] To achieve the above purpose, the present invention provides the following technical solutions:

[0006] The utility model embodiment discloses an RS485 communication circuit, comprising: a control unit, a transceiver unit and a protection unit for absorbing bad electrical signals;

[0007] The first signal end of the transceiver unit is connected to the data receiving end, the second signal end of the transceiver unit and the input end of the control unit are connected to the data sending end, the third signal end of the transceiver unit and the fourth signal end of the transceiver unit are respectively connected to the RS485 communication line A end and the RS485 communication line B end through the protection unit, and the fifth signal end of the transceiver unit is connected to the output end of the control unit;

[0008] Among them, when there is no data signal at the data sending end, the switch device in the control unit is not turned on, and the transceiver unit is in a data receiving state; when there is a data signal at the data sending end, the switch device in the control unit is turned on, and the transceiver unit is in a data sending state.

[0009] Optionally, in the above-mentioned RS485 communication circuit, the data sending end and the data receiving end are connected to corresponding ports of the MCU.

[0010] Optionally, the above-mentioned RS485 communication circuit further includes: an isolation unit for isolating the transceiver unit from the MCU.

[0011] Optionally, in the above RS485 communication circuit, the isolation unit includes: an isolation chip, wherein:

[0012] The receiving output pin of the isolation chip serves as the receiving output end of the isolation unit and is connected to the data receiving end;

[0013] The receiving input pin of the isolation chip serves as the receiving input end of the isolation unit and is connected to the first signal end of the transceiver unit;

[0014] The transmission input pin of the isolation chip serves as the transmission output end of the isolation unit and is connected to the data transmission end;

[0015] The transmission output pin of the isolation chip serves as the transmission output end of the isolation unit and is connected to the second signal end of the transceiver unit;

[0016] The power pins in the isolation chip are respectively connected to corresponding power supplies, and the ground pins in the isolation chip are respectively grounded.

[0017] Optionally, in the above RS485 communication circuit, the control unit includes: a switch tube, a first resistor, a second resistor and a capacitor;

[0018] The first resistor is connected to the gate of the switch tube, and the connection point is connected to the data sending end as the input end of the control unit; the other end of the first resistor is connected to the corresponding power supply;

[0019] The source of the switch tube is connected to one end of the capacitor, and the connection point is connected to the power supply;

[0020] The drain of the switch tube is connected to the other end of the capacitor and one end of the second resistor respectively, and the connection point is connected to the fifth signal terminal of the transceiver unit as the output end of the control unit;

[0021] The other end of the second resistor is grounded.

[0022] Optionally, in the above RS485 communication circuit, the switch tube is a PMOS tube.

[0023] Optionally, in the above RS485 communication circuit, the protection unit includes: a protection chip, a first fuse and a second fuse;

[0024] One end of the first fuse serves as the first end of the protection unit and is connected to the A end of the RS485 communication line;

[0025] The other end of the first fuse is connected to the first pin of the protection chip, and the connection point serves as the second end of the protection unit, which is connected to the third signal end of the transceiver unit;

[0026] One end of the second fuse serves as the third end of the protection unit and is connected to the B end of the RS485 communication line;

[0027] The other end of the second fuse is connected to the second pin of the protection chip, the connection point is connected to the fourth signal terminal of the transceiver unit as the fourth end of the protection unit, and the third pin of the protection chip is grounded.

[0028] Optionally, in the above RS485 communication circuit, the protection chip is composed of two bidirectional transient suppression diodes connected in series.

[0029] Optionally, in the above RS485 communication circuit, the transceiver unit includes: an RS485 chip, a third resistor, a fourth resistor and a fifth resistor;

[0030] Among them, one end of the third resistor is connected to the power supply; the other end of the third resistor is respectively connected to the differential signal A pin of the RS485 chip and one end of the fourth resistor, and the connection point serves as the third signal end of the transceiver unit;

[0031] The other end of the fourth resistor is respectively connected to one end of the fifth resistor and the differential signal B pin of the RS485 chip, and the connection point serves as the fourth signal end of the transceiver unit;

[0032] The receiving output pin of the RS485 chip serves as the first signal end of the transceiver unit;

[0033] The sending output pin of the RS485 chip serves as the second signal end of the transceiver unit;

[0034] The receiving enable pin and the transmitting enable pin of the RS485 chip are connected, and the connection point serves as the fifth signal terminal of the transceiver unit;

[0035] The power pin of the RS485 chip is connected to a power source, and the ground pin of the RS485 chip is grounded.

[0036] Optionally, in the above-mentioned RS485 communication circuit, the undesirable electrical signal includes: an electrostatic signal and / or a surge signal.

[0037] Based on the above, the RS485 communication circuit provided by the embodiment of the utility model includes: a control unit, a transceiver unit and a protection unit for absorbing bad electrical signals; the first signal end of the transceiver unit is connected to the data receiving end, the second signal end of the transceiver unit and the input end of the control unit are connected to the data sending end, the third signal end of the transceiver unit and the fourth signal end of the transceiver unit are respectively connected to the RS485 communication line A end and the RS485 communication line B end through the protection unit, and the fifth signal end of the transceiver unit is connected to the output end of the control unit; wherein, when there is no data signal at the data sending end, the switch device in the control unit is not turned on, the transceiver unit is in a data receiving state, and the external data is transmitted to the data receiving end through the transceiver unit; when there is a data signal at the data sending end, the switch device in the control unit is turned on, the transceiver unit is in a data sending state, and the data is transmitted to the outside through the transceiver unit, which solves the problem that the existing RS485 communication circuit needs to control the sending enable pin DE and the receiving enable pin through the MCU To control the 485 communication chip to be in the state of sending data or receiving data, the problem of being unable to realize the automatic switching of data sending and data receiving. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the utility model or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the utility model. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0039] Figure 1 A schematic diagram of the structure of an RS485 communication circuit provided in this application;

[0040] Figure 2 A circuit diagram of an RS485 communication circuit provided in an embodiment of the present application;

[0041] Figure 3 A circuit diagram of an existing RS485 communication circuit provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of the structure of another RS485 communication circuit provided in an embodiment of the present application;

[0043] Figure 5A circuit diagram of another RS485 communication circuit provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the utility model to clearly and completely describe the technical solutions in the embodiments of the utility model. Obviously, the described embodiments are only part of the embodiments of the utility model, not all of the embodiments. Based on the embodiments in the utility model, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the utility model.

[0045] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0046] The present application embodiment provides an RS485 communication circuit to solve the problem that the existing RS485 communication circuit needs to control the sending enable pin DE and the receiving enable pin through the MCU. To control the 485 communication chip to be in the state of sending data or receiving data, the problem of being unable to realize the automatic switching of data sending and data receiving.

[0047] See also Figure 1 The RS485 communication circuit may mainly include: a control unit 101, a transceiver unit 102 and a protection unit 103 for absorbing bad electrical signals at the A end and the B end of the RS485 communication line.

[0048] The first signal end of the transceiver unit 102 is connected to the data receiving end (RXD in the figure), the second signal end of the transceiver unit 102 and the input end of the control unit 101 are connected to the data sending end (TXD in the figure), the third signal end of the transceiver unit 102 and the fourth signal end of the transceiver unit 102 are connected to the RS485 communication line A end (RS485A in the figure) and the RS485 communication line B end (RS485B in the figure) through the protection unit 103, and the fifth signal end of the transceiver unit 102 is connected to the output end of the control unit 101;

[0049] Among them, when there is no data signal at the data sending end, the switch device in the control unit is not turned on, and the transceiver unit is in a data receiving state; when there is a data signal at the data sending end, the switch device in the control unit is turned on, and the transceiver unit is in a data sending state.

[0050] Specifically, the protection unit 103 can be used to absorb bad electrical signals flowing into the RS485 communication line A end and the RS485 communication line B end;

[0051] In some embodiments, the control unit 101 can be used to control the on and off of the switch device in itself to output a corresponding control signal according to the presence of the data signal at the data sending end; the transceiver unit 102 can be used to control itself to be in a data receiving state or a data sending state according to the control signal;

[0052] It should be noted that when there is no data signal at the data sending end, the switching device is not turned on, and the control signal is used to control the transceiver unit 102 to be in a data receiving state; when there is a data signal at the data sending end, the switching device is turned on, and the control signal is used to control the transceiver unit 102 to be in a data sending state.

[0053] In some embodiments, the data sending end and the data receiving end are connected to the corresponding ports of the MCU; at this time, the MCU and the RS485 communication circuit only need to be connected through two communication lines, and the MCU does not need to control the receive enable pin and the transmit enable pin of the RS485 chip in the RS485 communication circuit, thereby saving MCU resources; in addition, the control unit 101 provided in the present application can automatically put the RS485 communication circuit in a data receiving state or a data transmitting state, without the need for the MCU to intervene in the reception or transmission, thereby improving the real-time and reliability of the RS485 communication circuit.

[0054] In some embodiments, Figure 2 As shown, the control unit 101 may include: a switch tube Q1, a first resistor R1, a second resistor R2 and a capacitor C1.

[0055] The first resistor R1 is connected to the gate of the switch tube Q1, and the connection point is connected to the data sending end as the input end of the control unit 101; the other end of the first resistor R1 is connected to the corresponding power supply VDD;

[0056] The source of the switch tube Q1 is connected to one end of the capacitor C1, and the connection point is connected to the power supply VDD;

[0057] The drain of the switch tube Q1 is connected to the other end of the capacitor C1 and one end of the second resistor R2 respectively, and the connection point is connected to the fifth signal end of the transceiver unit 102 as the output end of the control unit 101;

[0058] The other end of the second resistor R2 is connected to the ground GNDS.

[0059] In actual applications, when there is no data signal at the data sending end, that is, when there is no data on the bus, the gate of the switch tube Q1 is pulled up to the voltage corresponding to the power supply through the first resistor R1. At this time, the switch tube Q1 is not turned on, and the drain of the switch tube Q1 is grounded through the second resistor R2, and the corresponding control signal output is a low level.

[0060] When there is a data signal at the data sending end, that is, when there is data on the bus, the MCU can send the data in frames through the data sending end. At this time, the second signal end of the transceiver unit 102 is pulled low, causing the gate of the switch tube Q1 to be at a low level, the switch tube Q1 is turned on, the drain and source levels of the switch tube Q1 are close to the voltage corresponding to the power supply, and the corresponding control signal output is at a high level.

[0061] It should be noted that in practice, the specific type of the switch tube Q1 can be a PMOS tube; of course, it is not limited to this. The switch tube Q1 can also be other existing transistors, and this application does not limit it. As long as the S485 communication circuit provided by this application can be implemented, it is within the protection scope of this application.

[0062] In some embodiments, see also Figure 2 , the protection unit 103 may include: a protection chip D1, a first fuse F1 and a second fuse F2.

[0063] Among them, one end of the first fuse F1 is used as the first end of the protection unit 103 and is connected to the A end of the RS485 communication line;

[0064] The other end of the first fuse F1 is connected to the first pin of the protection chip D1, and the connection point serves as the second end of the protection unit 103, which is connected to the third signal end of the transceiver unit 102;

[0065] One end of the second fuse F2 serves as the third end of the protection unit 103 and is connected to the B end of the RS485 communication line;

[0066] The other end of the second fuse F2 is connected to the second pin of the protection chip D1 , and the connection point is connected to the fourth signal terminal of the transceiver unit 102 as the fourth end of the protection unit 103 , and the third pin of the protection chip D1 is grounded.

[0067] In practical applications, the protection chip D1 can be composed of two bidirectional transient suppression diodes in series, that is, Figure 2 As shown; of course, it is not limited to this, and other existing protection chips can also be used. This application does not limit the specific type of protection chip, which is within the protection scope of this application.

[0068] It should be noted that in practice, adverse electrical signals may include electrostatic signals and / or surge signals; this may be determined based on the specific application environment and user needs, and this application does not make any specific limitations on them, and they are all within the protection scope of this application.

[0069] In some embodiments, see also Figure 2 , the transceiver unit 102 may include: an RS485 chip U2, a third resistor R3, a fourth resistor R4 and a fifth resistor R5;

[0070] Among them, one end of the third resistor R3 is connected to the power supply VDD, and the other end of the third resistor R3 is respectively connected to the differential signal A pin A of the RS485 chip U2 and one end of the fourth resistor R4, and the connection point serves as the third signal end of the transceiver unit 102;

[0071] The other end of the fourth resistor R4 is respectively connected to one end of the fifth resistor R5 and the differential signal B pin B of the RS485 chip, and the connection point serves as the fourth signal terminal of the transceiver unit 102;

[0072] The receiving output pin RO of the RS485 chip U2 serves as the first signal terminal of the transceiver unit 102;

[0073] The sending output pin DI of the RS485 chip serves as the second signal terminal of the transceiver unit 102;

[0074] RS485 chip receive enable pin connected to the transmit enable pin DE, the connection point serving as the fifth signal terminal of the transceiver unit 102;

[0075] The power pin VCC of the RS485 chip is connected to the power supply VDD, and the ground pin GND of the RS485 chip is connected to the ground GNDS.

[0076] In actual application, when the control signal is low, the receive enable pin of RS485 chip U2 and the transmit enable pin DE are both low, the RS485 chip U2 is in the receiving state, and the external data can be transmitted to the receive output pin RO through the differential signal A pin A of the RS485 chip U2, and then enter the MCU through the data receiving end.

[0077] When the control signal is low, the receive enable pin of the RS485 chip U2 and the transmit enable pin DE are both high, the RS485 chip U2 is in the transmitting state, the data can enter the transmit output pin DI of the RS485 chip through the data transmitting end, and then be transmitted to the outside through the differential signal B pin B of the RS485 chip U2.

[0078] It should also be noted that during the data transmission process, the data transmission end is actually in the switching process of high level and low level. At this time, the transmission output pin D1 of the RS485 chip U2 is also in the continuous switching process of high level and low level. At this time, in order to meet the requirement of being in the data transmission state, the second resistor R2 and capacitor C1 in the control unit 101 can form a delay circuit. The time constant is controlled to a preset value through parameter matching, which can ensure that during the data transmission process, the receiving enable pin of the RS485 chip U2 The voltage of the transmit enable pin DE is in the high level range, ensuring that the entire circuit is always in the data transmission state until the data transmission is completed, thereby reducing the system bit error rate.

[0079] Specifically, the preset value may be 1ms, but is certainly not limited thereto. Other values ​​may be selected depending on the specific application environment and user needs. This application does not limit these values ​​and they are all within the protection scope of this application.

[0080] Based on the above, the RS485 communication circuit provided in this embodiment includes: a control unit 101, a transceiver unit 102 and a protection unit 103; the first signal end of the transceiver unit 102 is connected to the data receiving end, the second signal end is connected to the data sending end, the third signal end and the fourth signal end are respectively connected to the RS485 communication line A end and the RS485 communication line B end through the protection unit 103, and the fifth signal end is connected to the output end of the control unit 101; the protection unit 103 is used to absorb the bad electrical signals flowing into the RS485 communication line A end and the RS485 communication line B end; the control unit 101 is used to control itself according to the existence of the data signal at the data sending end. The switch device in the middle is turned on and off to output the corresponding control signal; the transceiver unit 102 is used to control itself to be in a data receiving state or a data sending state according to the control signal; wherein, when there is no data signal at the data sending end, the switch device is not turned on, and the control signal is used to control the transceiver unit 102 to be in a data receiving state, and the external data is transmitted to the data receiving end through the transceiver unit 102; when there is a data signal at the data sending end, the switch device is turned on, and the control signal is used to control the transceiver unit 102 to be in a data sending state, and the data is transmitted to the outside through the transceiver unit 102, which solves the problem that the existing RS485 communication circuit needs to control the sending enable pin DE and the receiving enable pin through the MCU To control the 485 communication chip to be in the state of sending data or receiving data, the problem of being unable to realize the automatic switching of data sending and data receiving.

[0081] In practical applications, such as Figure 3As shown, the existing RS485 isolation transceiver circuit can generally be composed of three parts, namely: isolation part, data transmission and reception part and protection circuit part. Among them, the resistors R1, R2, R3, R4, R5, R6 and isolation chips U1, U2, U3 in the figure constitute the isolation part, the RS485 chip U4 and resistors R7, R8, R9 constitute the RS485 data transmission and reception part, and the fuses F1, F2 and protection chip D1 constitute the protection circuit part. The data receiving end, the data transmitting end, the receiving enable end and the transmitting enable end are connected to the MCU. When data needs to be sent, the MCU sets the receiving enable end and the transmitting enable end high, and pulls up the receiving enable pin and the transmitting enable pin of the RS485 chip U4 after passing through the isolation optocoupler chip U2. At this time, the RS485 chip is in the data transmission state, and the MCU can send the data by frame through the data transmitting end. After passing through the isolation optocoupler chip U3, it is sent to the outside through the transmitting output pin of the RS485 chip via the differential signal B pin. When data needs to be received, the MCU sets the receive enable terminal and the transmit enable terminal to low, and after being transmitted through the isolation optocoupler chip U2, the receive enable pin and the transmit enable pin of the RS485 chip U4 are set to low. At this time, the RS485 chip is in the receiving state, and the external data is transmitted to the receive output pin through the differential signal A terminal of the RS485 chip, and then transmitted to the data receiving terminal and to the inside of the MCU through the isolation optocoupler chip U1.

[0082] However, in the above circuit, data reception or transmission is controlled by MCU, while the present application is automatically controlled by control unit 101; and the above circuit needs to occupy 4 ports of MCU, while the present application only needs to occupy 2 ports of MCU, saving MCU resources. In addition, due to the baud rate requirements of RS485 communication, when the baud rate of 38400 is to be met, the isolation optocoupler chips U1 and U3 must use high-speed optocouplers.

[0083] Based on this, another embodiment of the present application provides an RS485 communication circuit, see Figure 4 The RS485 communication circuit may further include: an isolation unit 104 for isolating the transceiver unit 102 from the MCU.

[0084] In practical applications, the isolation unit 104 can physically isolate the transceiver unit 102 from the MCU.

[0085] See also Figure 5 , the isolation unit 104 may include: an isolation chip U1, wherein:

[0086] The receiving output pin (7 in the figure) of the isolation chip U1 serves as the receiving output terminal of the isolation unit 104 and is connected to the data receiving terminal;

[0087] The receiving input pin (2 in the figure) of the isolation chip U1 serves as the receiving input terminal of the isolation unit 104 and is connected to the first signal terminal of the transceiver unit 102;

[0088] The transmission input pin (6 in the figure) of the isolation chip U1 serves as the transmission output terminal of the isolation unit 104 and is connected to the data transmission terminal;

[0089] The transmission output pin (3 in the figure) of the isolation chip U1 serves as the transmission output terminal of the isolation unit 104 and is connected to the second signal terminal of the transceiver unit 102;

[0090] The power pins (1 and 8 in the figure) in the isolation chip U1 are respectively connected to corresponding power supplies (VDD and VCC in the figure), and the ground pins (4 and 5 in the figure) in the isolation chip U1 are respectively grounded (GND and GNDS in the figure).

[0091] It should be noted that the isolation chip U1 can be a capacitive isolation chip, and the number is 1. Since the cost of high-speed isolation optocoupler chips is much higher than that of ordinary optocoupler chips, compared with the existing high-speed optocoupler chips that require a number of 2, not only the cost is reduced, but also the PCB (circuit board) can be more compact and the design is more convenient, further reducing the cost.

[0092] It should also be noted that the use of capacitive isolation chips instead of high-speed optocoupler chips and isolation chips with a rate of 100kb / s or above can fully meet the requirements of a high communication baud rate of 38400.

[0093] Based on the above, combined Figure 5 , the working process of the RS485 communication circuit using the capacitive isolation chip as the isolation unit 104 is described in detail below:

[0094] When there is no data on the bus, the gate of the switch tube Q1 is pulled up to the voltage VDD corresponding to the power supply through the first resistor R1. At this time, the switch tube Q1 is not turned on, and the drain of the switch tube Q1 is grounded to GND through the second resistor R2, which is a low level, that is, the receiving enable pin of the RS485 chip U2. The RS485 chip U2 is in the data receiving state, and the external data is transmitted to the receiving output pin RO through the differential signal A pin A of the RS485 chip U2, and is transmitted to the data receiving end MCU through the isolation chip U1.

[0095] When data needs to be sent, the MCU sends the data in frames through the data sending end. After passing through the isolation chip U1, it is first transmitted to the sending output pin DI of the RS485 chip U2. At this time, the sending output pin DI of the RS485 chip U2 is pulled low, causing the gate of the switch tube Q1 to be low level, the switch tube Q1 is turned on, and the drain and source levels of the switch tube Q1 are close to the voltage VDD of the corresponding power supply, that is, the receiving enable pin of the RS485 chip U2. And the transmit enable pin DE is close to the voltage VDD corresponding to the power supply, so that the RS485 chip U2 is in the transmitting state, and the data is transmitted to the outside through the transmit output pin DI of the RS485 chip U2, the differential signal B pin B of the RS485 chip, and the B end of the RS485 communication line.

[0096] In the process of data transmission, the data transmitting end is actually in the switching process of high level and low level. At this time, after being transmitted by the isolation chip U1, the sending output pin DI of the RS485 chip U2 is also in the continuous switching process of high level and low level. In order to meet the requirement of being in the sending state all the time, the second resistor R2 and the capacitor C1 in the control unit 101 constitute a delay circuit. By matching appropriate parameters, it can be ensured that during the sending process, the receiving enable pin of the RS485 chip U2 The transmit enable pin DE is always in the high level voltage range, so that the entire RS485 communication circuit is in the data sending state until the data is sent, reducing the system bit error rate.

[0097] It should be noted that the isolation chip U1 is used to achieve isolation between the MCU and the RS485 chip. Instead of using a high-speed isolation optocoupler, the use of an isolation chip with a rate of 100kb / s or above can fully meet the requirements of a high communication baud rate of 38400.

[0098] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0099] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present utility model.

[0100] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An RS485 communication circuit, characterized in that: include: A control unit, a transceiver unit, and a protection unit for absorbing bad electrical signals; The first signal end of the transceiver unit is connected to the data receiving end, the second signal end of the transceiver unit and the input end of the control unit are connected to the data sending end, the third signal end of the transceiver unit and the fourth signal end of the transceiver unit are respectively connected to the RS485 communication line A end and the RS485 communication line B end through the protection unit, and the fifth signal end of the transceiver unit is connected to the output end of the control unit; Among them, when there is no data signal at the data sending end, the switch device in the control unit is not turned on, and the transceiver unit is in a data receiving state; when there is a data signal at the data sending end, the switch device in the control unit is turned on, and the transceiver unit is in a data sending state.

2. The RS485 communication circuit according to claim 1, characterized in that: The data transmitting end and the data receiving end are connected to corresponding ports of the MCU.

3. The RS485 communication circuit according to claim 2, characterized in that: Also includes: An isolation unit for isolating the transceiver unit from the MCU.

4. The RS485 communication circuit according to claim 3, characterized in that: The isolation unit comprises: an isolation chip, wherein: The receiving output pin of the isolation chip serves as the receiving output end of the isolation unit and is connected to the data receiving end; The receiving input pin of the isolation chip serves as the receiving input end of the isolation unit and is connected to the first signal end of the transceiver unit; The transmission input pin of the isolation chip serves as the transmission output end of the isolation unit and is connected to the data transmission end; The transmission output pin of the isolation chip serves as the transmission output end of the isolation unit and is connected to the second signal end of the transceiver unit; The power pins in the isolation chip are respectively connected to corresponding power supplies, and the ground pins in the isolation chip are respectively grounded.

5. The RS485 communication circuit according to claim 1, characterized in that: The control unit includes: a switch tube, a first resistor, a second resistor and a capacitor; The first resistor is connected to the gate of the switch tube, and the connection point is connected to the data sending end as the input end of the control unit; the other end of the first resistor is connected to the corresponding power supply; The source of the switch tube is connected to one end of the capacitor, and the connection point is connected to the power supply; The drain of the switch tube is connected to the other end of the capacitor and one end of the second resistor respectively, and the connection point is connected to the fifth signal terminal of the transceiver unit as the output end of the control unit; The other end of the second resistor is grounded.

6. The RS485 communication circuit according to claim 5, characterized in that: The switch tube is a PMOS tube.

7. The RS485 communication circuit according to claim 1, characterized in that: The protection unit comprises: a protection chip, a first fuse and a second fuse; One end of the first fuse serves as the first end of the protection unit and is connected to the A end of the RS485 communication line; The other end of the first fuse is connected to the first pin of the protection chip, and the connection point serves as the second end of the protection unit, which is connected to the third signal end of the transceiver unit; One end of the second fuse serves as the third end of the protection unit and is connected to the B end of the RS485 communication line; The other end of the second fuse is connected to the second pin of the protection chip, the connection point is connected to the fourth signal terminal of the transceiver unit as the fourth end of the protection unit, and the third pin of the protection chip is grounded.

8. The RS485 communication circuit according to claim 7, characterized in that: The protection chip is composed of two bidirectional transient suppression diodes connected in series.

9. The RS485 communication circuit according to claim 1, characterized in that: The transceiver unit comprises: an RS485 chip, a third resistor, a fourth resistor and a fifth resistor; Among them, one end of the third resistor is connected to the power supply; the other end of the third resistor is respectively connected to the differential signal A pin of the RS485 chip and one end of the fourth resistor, and the connection point serves as the third signal end of the transceiver unit; The other end of the fourth resistor is respectively connected to one end of the fifth resistor and the differential signal B pin of the RS485 chip, and the connection point serves as the fourth signal end of the transceiver unit; The receiving output pin of the RS485 chip serves as the first signal end of the transceiver unit; The sending output pin of the RS485 chip serves as the second signal end of the transceiver unit; The receiving enable pin and the transmitting enable pin of the RS485 chip are connected, and the connection point serves as the fifth signal terminal of the transceiver unit; The power pin of the RS485 chip is connected to a power source, and the ground pin of the RS485 chip is grounded.

10. The RS485 communication circuit according to any one of claims 1 to 9, characterized in that: The bad electrical signals include: static electricity signals and / or surge signals.

Citation Information

Cited By

  • Low-delay control method and system for RS485 communication, storage medium and equipment

    CN121644268A