Bus communication circuit and device

By introducing a program-controlled reference voltage adjustment module into the bus communication circuit, the reference voltage is adjusted to adapt to slave equipment and external environment of different specifications, the anti-interference ability of the M-BUS bus communication method when facing instruments and noise interference of different specifications is solved. The problem of insufficient has improved the applicability and noise tolerance of bus communication circuits.

CN112583682BActive Publication Date: 2024-11-22WASION GROUP HLDG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011573828.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2024-11-22
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

The existing remote meter reading system M-BUS bus communication method faces interference with slave instruments of different specifications or external noise, the anti-interference ability and adaptive adjustment ability are insufficient, resulting in abnormal data transmission.

Method used

A bus communication circuit is designed, including a main station signal transmission module, a communication protection module, a signal conversion resistor and a program-controlled reference voltage adjustment module. By adjusting the reference voltage, it is located between the first signal voltage and the second signal voltage, and the Applicability and anti-interference ability of bus communication circuits.

Benefits of technology

This solution can adapt to slave equipment of different specifications, improve the applicability of bus communication circuits, and ensure the stability of data transmission by adjusting the reference voltage, enhancing noise tolerance and anti-interference ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112583682B_ABST
    Figure CN112583682B_ABST
Patent Text Reader

Abstract

The present invention discloses a bus communication circuit, including a master station signal sending module, a communication protection module, a signal conversion resistor, a master station signal receiving module and a program-controlled reference voltage adjustment module; the input end of the master station signal sending module is connected to the signal sending end of the master station, the output end of the master station signal sending module is respectively connected to the communication protection module, the program-controlled reference voltage adjustment module and the master station signal receiving module through the signal conversion resistor, the program-controlled reference voltage adjustment module is also connected to the master station signal receiving module, and the output end of the master station signal receiving module is connected to the signal receiving end of the master station. The present invention adjusts the reference voltage through algorithm program control, so that the M‑BUS bus communication circuit can adapt to more differentiated slave station devices. By automatically adjusting the reference voltage in the communication circuit through the program-controlled algorithm, it can also ensure that the communication circuit obtains maximum noise tolerance and anti-interference ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of circuit electronics, and in particular to a bus communication circuit and device. Background Art

[0002] The existing M-BUS bus communication mode of the remote meter reading system is a master-slave half-duplex transmission bus, which uses a call / answer method to realize two-end communication, that is, after the master station sends an inquiry, the slave station transmits data to the master station. Among them, the master station can send the bus voltage to the slave station to power the slave station, and send a "1" or "0" logic signal to the slave station through the voltage amplitude change of the bus voltage to realize data transmission. The slave station can send a "1" or "0" logic signal to the master station by adding a pulse current to the normal slave current. That is, the master station can send a signal to the slave station through the bus while powering the slave station, so that the battery set in the terminal meter of the slave station is only used as a backup power supply, reducing the work requirements of regular maintenance and battery replacement on the slave side.

[0003] However, in the existing terminal meters used for remote meter reading, different meters have different specifications and models, and the pulse currents they generate are not the same. The module that realizes pulse current recognition in bus communication cannot accurately recognize the logic signal when the pulse current changes. In addition, due to the long bus length, the noise signal generated by the external environment is high, and data transmission abnormalities are prone to occur under the influence of noise signals. In other words, the existing bus communication method has low applicability when facing slave station meters of different specifications or noise interference in different environments. Summary of the invention

[0004] The main purpose of the present invention is to provide a bus communication circuit and device, aiming to solve the problem that the existing bus communication method has insufficient anti-interference ability and adaptive adjustment ability.

[0005] In order to achieve the above object, the present invention provides a bus communication circuit, including a master station signal sending module, a communication protection module, a signal conversion resistor, a master station signal receiving module and a programmable reference voltage adjustment module;

[0006] The input end of the master station signal sending module is connected to the signal sending end of the master station, the output end of the master station signal sending module is connected to the first end of the communication protection module through the signal conversion resistor, the second end of the communication protection module is connected to the slave station, the first end of the communication protection module is also connected to the first input end of the master station signal receiving module and the input end of the program-controlled reference voltage adjustment module, the output end of the program-controlled reference voltage adjustment module is connected to the second input end of the master station signal receiving module, and the output end of the master station signal receiving module is connected to the signal receiving end of the master station;

[0007] The master station signal sending module is used to adjust the first output voltage according to the data signal sent by the master station;

[0008] The communication protection module is used to send the first output voltage to the slave station so that the slave station can obtain the data signal sent by the master station according to the first output voltage, and is also used to adjust the first output current according to the data signal sent by the slave station;

[0009] The signal conversion resistor is used to step down and adjust the first output voltage according to the first output current to obtain a first signal voltage or a second signal voltage;

[0010] The program-controlled reference voltage adjustment module is used to adjust the output reference voltage to be between the first signal voltage and the second signal voltage;

[0011] The master station signal receiving module is used to receive the first signal voltage or the second signal voltage and compare it with a reference voltage to obtain a data signal sent by the slave station and send it to the master station.

[0012] Optionally, the programmable reference voltage adjustment module includes a first diode and a plurality of resistor unit circuits connected in parallel with each other;

[0013] The anode of the first diode is connected to the first end of the communication protection module, the cathode of the first diode is respectively connected to the first end of each resistance unit circuit, and the second end of each resistance unit circuit is connected to the second input end of the master station signal receiving module;

[0014] The programmable reference voltage adjustment module is used to adjust the equivalent resistance of the programmable reference voltage adjustment module by controlling the on and off of the plurality of resistance unit circuits.

[0015] Optionally, each of the resistance unit circuits includes an adjustment resistor, a first switch tube, a first resistor, a second resistor, a first capacitor and a first control unit;

[0016] The cathode of the first diode is respectively connected to the first end of the first capacitor, the first end of the first resistor and the first end of the first switch tube, the control end of the first switch tube is respectively connected to the second end of the first capacitor, the second end of the first resistor and the first end of the second resistor, the second end of the second resistor is connected to the control end of the first control unit, the controlled end of the first control unit is connected to the master station, and the second end of the first switch tube is connected to the second input end of the master station signal receiving module;

[0017] The first control unit is used to control the on and off of the first switch tube according to the control signal sent by the master station.

[0018] Optionally, the first control unit is a first optical coupler or a second switching tube.

[0019] Optionally, the adjustment resistors in each of the resistor unit circuits are different.

[0020] Optionally, the master station signal receiving module includes a first comparator, a third resistor, a fourth resistor, a second capacitor and a second optical coupler;

[0021] The first input end of the first comparator is connected to the first end of the communication protection module through the third resistor, the second input end of the first comparator is respectively connected to the second end of each resistor unit circuit, the second end of the first comparator is grounded through a fourth resistor, the second capacitor is connected in parallel with the fourth resistor, the output end of the first comparator is connected to the controlled end of the second optical coupler, and the control end of the second optical coupler is connected to the signal receiving end of the master station;

[0022] The second optical coupler is used to send corresponding high and low level signals to the signal receiving end of the master station according to the high and low level signals output by the first comparator.

[0023] Optionally, the master station signal sending module includes a third optical coupler, a voltage stabilizing chip, a first voltage stabilizing diode and a second voltage stabilizing diode;

[0024] The controlled end of the third optocoupler is connected to the signal sending end of the master station, the output positive electrode and output negative electrode of the third optocoupler are respectively connected to the negative electrode and positive electrode of the second voltage stabilizing diode, the input end of the voltage stabilizing chip is connected to the bus voltage, the ground end of the voltage stabilizing chip is connected to the negative electrode of the first voltage stabilizing diode, the positive electrode of the first voltage stabilizing diode is connected to the negative electrode of the second voltage stabilizing diode, the positive electrode of the second voltage stabilizing diode is grounded, and the output end of the voltage stabilizing chip is the output end of the signal sending module of the master station.

[0025] Optionally, the communication protection module includes a second diode, a transient diode, a third capacitor and a thermistor;

[0026] The anode of the second diode is the first end of the communication protection module, the anode of the second diode is grounded through the third capacitor, the cathode of the second diode is connected to the anode of the slave station through the thermistor, the cathode of the slave station is grounded, and the cathode of the second diode is also grounded through the transient diode.

[0027] Optionally, the communication protection module is further used to receive the first output voltage to power the slave station.

[0028] In addition, to achieve the above objectives, the present invention also provides a bus communication device, which includes a host, a slave, and a bus communication circuit connected to the host and the slave respectively, and the bus communication circuit is configured as the bus communication circuit described above.

[0029] The present invention is provided with a program-controlled reference voltage adjustment module, and can adjust the reference voltage obtained by the master station signal receiving module when facing signal interference caused by different slave station equipment terminals or different external environments. By adjusting the magnitude of the reference voltage so that it is at an optimal value between the first signal voltage and the second signal voltage, the bus communication circuit can be adapted to various different slave station equipment, thereby improving the applicability of the bus communication circuit. By adjusting the magnitude of the reference voltage so that it is close to the optimal value of the first signal voltage and the second signal voltage, it can be ensured that the communication circuit obtains the maximum noise tolerance and anti-interference ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the embodiments of the present invention 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 described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.

[0031] Figure 1 A schematic diagram of a module of an embodiment of a bus communication circuit of the present invention;

[0032] Figure 2 for Figure 1 A schematic diagram of the circuit structure of an embodiment;

[0033] Figure 3 for Figure 2 A schematic diagram of the circuit structure of an embodiment of a first control unit in an embodiment;

[0034] Figure 4 for Figure 2 A schematic diagram of the circuit structure of another embodiment of the first control unit in the embodiment.

[0035] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings.

[0036] Description of Figure Numbers:

[0037]

[0038] DETAILED DESCRIPTION

[0039] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

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

[0041] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0042] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0043] The present invention provides a bus communication circuit, which is applied to a bus communication device. The bus communication device can realize data communication between a host and a plurality of slaves.

[0044] See also Figure 1 In one embodiment, the bus communication circuit includes a master station signal sending module 10, a communication protection module 20, a signal conversion resistor R, a master station signal receiving module 30 and a programmable reference voltage adjustment module 40. The input end of the master station signal sending module 10 is connected to the signal sending end of the master station, the output end of the master station signal sending module 10 is connected to the first end of the communication protection module 20 through the signal conversion resistor R, the second end of the communication protection module 20 is connected to the slave station, the first end of the communication protection module 20 is also connected to the first input end of the master station signal receiving module 30 and the input end of the programmable reference voltage adjustment module 40, the output end of the programmable reference voltage adjustment module 40 is connected to the second input end of the master station signal receiving module 30, and the output end of the master station signal receiving module 30 is connected to the signal receiving end of the master station.

[0045] The master station can send a corresponding data signal, such as a logic signal "1" or "0", to the input end of the master station signal sending module 10. The master station signal sending module 10 adjusts the output first output voltage accordingly according to the data signal. That is, the first output voltage output by the master station signal sending module 10 when receiving the logic signal "1" is different from the first output voltage output when receiving the logic signal "0", and has a large voltage amplitude difference, so that the back end can identify two different first output voltages.

[0046] The communication protection module 20 can realize the reception and transmission of data signals. When the communication protection module 20 receives the first output voltage, the first output voltage can be sent to the slave station. The slave station can determine the corresponding data signal according to the voltage amplitude of the first output voltage to realize the data transmission process from the master station to the slave station.

[0047] The communication protection module 20 can also receive a data signal sent by the slave station, and adjust the first output current according to the data signal. The first output voltage is the output voltage of the output end of the master station signal sending module 10, and the first output current is the current on the current loop composed of the master station signal sending module 10, the signal conversion resistor R and the communication protection module 20. For example, the data signal sent by the slave station can be a logical signal "0" or "1". When the slave station sends a signal "1", the first output current can be kept unchanged; when sending a signal "0", a pulse current consumption is added to the original first output current. By detecting the current amplitude of the first output current, the signal data sent by the slave station can be determined.

[0048] When the slave station does not generate a pulse current, the amplitude of the voltage reduction of the first output voltage after passing through the signal conversion resistor R is the product of the resistance value of the signal conversion resistor R and the current value of the normal first output current. When the slave station generates a pulse current, the voltage drop on the signal conversion resistor R increases, and the increased voltage amplitude is the product of the current value of the pulse current and the resistance value of the signal conversion resistor R. That is, when a pulse current is generated in the current loop, the voltage drop generated on the signal conversion resistor R increases, so that the voltage value at the end of the signal conversion resistor R away from the master station signal sending module 10 is further reduced relative to the voltage value when no pulse current is generated.

[0049] The master station signal receiving module 30 can receive two different first output voltages after the signal conversion resistor R drops the voltage, which are the first signal voltage and the second signal voltage. Among them, the first signal voltage is the voltage received by the master station signal receiving module 30 after the first output voltage drops through the signal conversion resistor R when the slave station generates a pulse current; the second signal voltage is the voltage received by the master station signal receiving module 30 after the first output voltage drops through the signal conversion resistor R when the slave station does not generate a pulse current. It can be understood that when a pulse current is generated in the current loop, the voltage drop on the signal conversion resistor R increases, and the voltage reduction amplitude of the first signal voltage after passing through the signal conversion resistor R is greater, that is, the first signal voltage is lower than the second signal voltage.

[0050] By adjusting the output reference voltage through the programmable reference voltage adjustment module 40, the second signal voltage received by the master station signal receiving module 30 can be higher than the reference voltage when no pulse current is generated; and when a pulse current is generated, the first signal voltage received by the master station signal receiving module 30 is lower than the reference voltage, that is, by adjusting the reference voltage, the reference voltage is between the first signal voltage and the second signal voltage. By comparing the actual signal voltage with the reference voltage, it can be determined that the actual signal voltage is the second signal voltage when it is greater than the reference voltage, and the first signal voltage when it is less than the reference voltage, and then determine whether a pulse current is generated in the current loop to obtain the data signal sent by the slave station. After determining the data signal sent by the slave station, the master station signal receiving module 30 can send it to the signal receiving end of the master station to realize the data transmission process from the slave station to the master station.

[0051] It should be noted that for slave station instruments of different specifications, the amplitude of the pulse current generated is not the same, so the voltage amplitude of the first output voltage after the voltage reduction will change, that is, the first signal voltage and the second signal voltage change with the specification of the slave station instrument. At this time, if the first signal voltage and the second signal voltage are both greater than or less than the reference voltage, the master station signal receiving module 30 will not be able to judge whether the pulse current is generated based on the comparison of the signal voltage and the reference voltage, and thus the data signal sent by the slave station cannot be determined. By adjusting the output reference voltage through the program-controlled reference voltage adjustment module 40, when facing different slave station terminal devices, the reference voltage is adjusted so that the reference voltage is between the first signal voltage and the second signal voltage, and the data signal sent by the slave station can be determined by the actual signal voltage. That is, for different slave station device terminals, the reference voltage is tested and adjusted through the program-controlled reference voltage adjustment module 40, and the reference voltages corresponding to different slave station device terminals can be obtained, so that the bus communication circuit can be adapted to different slave station devices, thereby improving the applicability of the bus communication circuit.

[0052] like Figure 1 As shown, in the bus communication circuit, the number of slave stations can be set to one or more, each slave station is connected to one end of the signal conversion resistor R through its corresponding communication protection module 20, and the other end of the signal conversion resistor R is connected to the master station signal sending module 10.

[0053] Similarly, when the reference voltage is set between the first signal voltage and the second signal voltage, if the voltage difference between the reference voltage and the first signal voltage is small, when the first signal voltage increases due to the superposition of the noise signal of the external environment, it is easy for the first signal voltage after the superposition of the interference signal to be greater than the reference voltage, thereby affecting the judgment of the data signal by the master station signal receiving module 30. That is, the reference voltage not only needs to be set between the first signal voltage and the second signal voltage, but also needs to have a certain voltage difference with the first signal voltage and the second signal voltage to provide noise tolerance. It can be understood that by setting the reference voltage to the average value of the first signal voltage and the second signal voltage, the maximum theoretical noise tolerance value can be obtained, and the maximum theoretical noise tolerance value is half of the difference between the voltages of the first signal voltage and the second signal voltage, thereby improving the anti-interference ability of the bus communication circuit.

[0054] In this embodiment, by setting a program-controlled reference voltage adjustment module 40, the reference voltage obtained by the master station signal receiving module 30 can be adjusted when facing signal interference caused by different slave station equipment terminals or different external environments. By adjusting the magnitude of the reference voltage so that it is between the first signal voltage and the second signal voltage, the bus communication circuit can be adapted to various different slave station equipment, thereby improving the applicability of the bus communication circuit. By adjusting the magnitude of the reference voltage so that it is close to the average value of the first signal voltage and the second signal voltage, a larger theoretical noise tolerance value can be obtained, thereby improving the anti-interference ability of the bus communication circuit.

[0055] Refer to Figure 1 and Figure 2 The programmable reference voltage adjustment module 40 may include a first diode D1 and a plurality of resistor unit circuits 41 connected in parallel. The anode of the first diode D1 is connected to the first end of the communication protection module 20, the cathode of the first diode D1 is connected to the first end of each resistor unit circuit 41, and the second end of each resistor unit circuit 41 is connected to the second input end of the master station signal receiving module 30.

[0056] The programmable reference voltage adjustment module 40 can control the on and off of multiple resistance unit circuits 41 to adjust the equivalent resistance of the programmable reference voltage adjustment module 40. The equivalent resistance of the programmable reference voltage adjustment module 40 as a whole is the resistance value of the equivalent resistance of each turned-on resistance unit circuit 41 connected in parallel. The input impedance to ground of the second end of the master station signal receiving module 30 and the equivalent resistance of the programmable reference voltage adjustment module 40 form a voltage divider circuit, the equivalent resistance of the programmable reference voltage adjustment module 40 is a pull-up resistor, and the input impedance to ground of the second end of the master station signal receiving module 30 is a pull-down resistor, then the reference voltage obtained by the second end of the master station signal receiving module 30 is the voltage value after the first output voltage is divided by the voltage divider circuit.

[0057] It can be understood that, for the voltage divider circuit, when the resistance of the pull-down resistor remains unchanged, the pull-up resistor increases, and the output voltage after voltage division decreases. That is, the reference voltage can be reduced by increasing the equivalent resistance of the program-controlled reference voltage adjustment module 40 as a whole; and the reference voltage can be increased by reducing the equivalent resistance of the program-controlled reference voltage adjustment module 40 as a whole. The program-controlled reference voltage adjustment module 40 can generate multiple different equivalent resistances by controlling the on and off of multiple resistance unit circuits 41. After arranging the equivalent resistances that can be generated from small to large, the voltage value range of the reference voltage can be determined by testing whether the reference voltage obtained under each equivalent resistance is between the first signal voltage and the second signal voltage. Taking three resistance unit circuits 41 as an example, when the equivalent resistance of each resistance unit circuit 41 is not the same, there are a total of 8 combinations. The equivalent infinite resistance when the three resistance unit circuits 41 are all disconnected is discarded, and there are 7 equivalent resistance combinations. After arranging the 7 combinations in order of size, a valid combination can be obtained by traversing and testing each equivalent resistance combination. For example, in the 1st and 2nd combinations with smaller equivalent resistance among the 7 combinations, the generated reference voltage is not between the first signal voltage and the second signal voltage, while the generated reference voltage in the 3rd to 7th combinations is between the first signal voltage and the second signal voltage. It can be determined that the reference voltage corresponding to the 3rd to 7th combinations can realize the signal data transmission of the slave device terminal. Furthermore, the reference voltage corresponding to the 5th combination can be selected from the 3rd to 7th combinations to make the reference voltage closer to the average value of the first signal voltage and the second signal voltage, so that the master station signal receiving module 30 has a certain noise tolerance when comparing the actual signal voltage with the reference voltage.

[0058] Each of the above-mentioned resistance unit circuits 41 includes an adjustment resistor Ri, a first switch tube Q1, a first resistor R1, a second resistor R2, a first capacitor C1 and a first control unit 42. The cathode of the first diode D1 is respectively connected to the first end of the first capacitor C1, the first end of the first resistor R1 and the first end of the first switch tube Q1, the control end of the first switch tube Q1 is respectively connected to the second end of the first capacitor C1, the second end of the first resistor R1 and the first end of the second resistor R2, the second end of the second resistor R2 is connected to the control end of the first control unit 42, the controlled end of the first control unit 42 is connected to the master station, and the second end of the first switch tube Q1 is connected to the second input end of the master station signal receiving module 30.

[0059] The master station can control the on and off of each resistor unit circuit 41 by sending a control signal. The first switch tube Q1 can be a PNP transistor or a P-channel MOS tube. Figure 2 The circuit schematic diagram of the resistor unit circuit 41 when the first switch tube Q1 is a PNP type triode is shown in FIG. The master station can send a conduction signal or a cutoff signal to the first control unit 42. When the first control unit 42 receives the conduction signal, it can ground the control end of the first switch tube Q1 to turn on the first switch tube Q1; when the first control unit 42 receives the cutoff signal, it can empty the control end of the first switch tube Q1 to turn off the first switch tube Q1. Figure 2 As shown, in the programmable reference voltage adjustment module 40 composed of three resistor unit circuits 41, the master station can control the first control unit 42 in each resistor unit circuit 41 through the CTR1, CTR2 and CTR3 ports respectively.

[0060] The first capacitor C1 and the first resistor R1 can prevent the control end of the first switch tube Q1 from shaking due to external signals, thereby avoiding malfunction of the first switch tube Q1.

[0061] It can be understood that the first diode D1 is a charging diode, the first capacitor C1 is an energy storage capacitor, and the pulse current is usually 11mA to 20mA. When the pulse current is not generated, the voltage on the first resistor R1 is the second signal voltage, and the first capacitor C1 is charged. When the pulse current is generated so that the second signal voltage is reduced to the first signal voltage, the first capacitor C1 can be discharged so that the voltage on the first resistor R1 remains at the second signal voltage. The first resistor R1 and the second resistor R2 form a voltage divider circuit, wherein the resistance value of the first resistor R1 is much greater than the resistance value of the second resistor R2, so that when the second resistor R2 is grounded, the control end level of the first switch tube Q1 is low, and the first switch tube Q1 is turned on. When the second resistor R2 is not grounded, the control end level of the first switch tube Q1 is high, and the first switch tube Q1 is turned off.

[0062] It can be understood that the above-mentioned signal conversion resistor R can be a winding resistor, and the resistance parameter of the winding resistor can be 100Ω-3W. The first resistor R1 can be set to be at least ten times greater than the second resistor R2, and the second resistor R2 can be set to at least 10KΩ, so that the control terminal level on the first switch tube Q1 after the second resistor R2 divides the voltage is lower than the conduction level value, ensuring that the first switch tube Q1 is saturated and turned on. The first diode D1 can be a Schottky diode with a small reverse current and a reduced forward conduction voltage, such as a BAT54 Schottky diode with a forward conduction voltage drop of about 0.2V and a reverse leakage current of less than 0.1μA. The first switch tube Q1 can be a PNP-type triode, such as a germanium tube with a voltage drop of 0.1V to 0.2V when a small current is saturated and turned on. The first capacitor C1 in each resistor unit circuit 41 can avoid the influence of interference malfunction. When the fourth resistor R4 and the second capacitor C2 in the master station signal receiving module 30 are selected, the time constant τ=RC is required to be large so that the capacitor can store more energy.

[0063] When the first switch tube Q1 is turned on, the resistance unit circuit 41 is in the on state. When some of the resistance unit circuits 41 are in the on state, the overall equivalent resistance of the resistance unit circuits 41 is the resistance value of the adjustment resistors Ri of the on resistance unit circuits 41 connected in parallel.

[0064] It should be noted that, in order to obtain different equivalent resistance combinations, the adjustment resistors Ri in each resistance unit circuit 41 can be set to be different from each other. In the case where the resistance values ​​of the adjustment resistors Ri are all different, when the number of resistance unit circuits 41 is n, the number of all equivalent resistance combinations that can be obtained is 2 n The number of effective equivalent resistance combinations after removing the infinite equivalent resistance when all resistance unit circuits 41 are disconnected is 2 n -1.

[0065] It is understandable that when the number of resistance unit circuits 41 is large, n-1 is large, and it takes a lot of time to use a traversal method to measure whether the reference voltage corresponding to the equivalent resistance of each combination meets the requirements. After determining the equivalent resistance of each combination and arranging them in order of size, the efficiency of determining the effective combination can also be improved by segmented testing. For example, two adjacent equivalent resistance combinations x and y are selected, where the equivalent resistance of x is lower than the equivalent resistance of y. If the reference voltages obtained under the x combination and the y combination are both greater than the first signal voltage and the second signal voltage, then when the equivalent resistance is further reduced, the reference voltage will be further increased. Since the reference voltage under the y combination is already higher than the first signal voltage and the second signal voltage, the larger reference voltage undoubtedly does not meet the requirements. Then, other combinations in the equivalent resistance combination whose equivalent resistance is less than the y combination no longer need to be tested, so as to save test time and improve test efficiency.

[0066] Please refer to Figure 3 When the bus communication circuit has an isolation requirement, the first control unit 42 may be a first optocoupler N1. When the master station sends a turn-on signal to the first optocoupler N1, the first optocoupler N1 may ground the second end of the second resistor R2; and when the master station sends a turn-off signal to the first optocoupler N1, the first optocoupler N1 may leave the second end of the second resistor R2 empty.

[0067] Please refer to Figure 4 When the bus communication circuit does not need to isolate the control part from the communication part, the first control unit 42 can be the second switch tube Q2. When the master station sends a turn-on signal to the second switch tube Q2, the second switch tube Q2 can ground the second end of the second resistor R2. When the master station sends a turn-off signal to the second switch tube Q2, the second switch tube Q2 can leave the second end of the second resistor R2 empty. The second switch tube Q2 can also be a triode or a MOS tube. Figure 4 Only the circuit schematic diagram of the first control unit 42 when the second switch tube is a triode is shown.

[0068] The master station signal receiving module 30 may include a first comparator A1, a third resistor R3, a fourth resistor R4, a second capacitor C2, and a second optical coupler N2. The first input end of the first comparator A1 is connected to the first end of the communication protection module 20 through the third resistor R3, the second input end of the first comparator A1 is respectively connected to the second end of each resistor unit circuit 41, the second end of the first comparator A1 is grounded through the fourth resistor R4, the second capacitor C2 is connected in parallel with the fourth resistor R4, the output end of the first comparator A1 is connected to the controlled end of the second optical coupler N2, and the control end of the second optical coupler N2 is connected to the signal receiving end of the master station.

[0069] The first input terminal of the first comparator A1 can receive the first signal voltage or the second signal voltage, and the second input terminal can receive the reference voltage. After the first comparator A1 receives the actual signal voltage at the first terminal, it can determine whether the actual signal voltage is the first signal voltage or the second signal voltage by comparing the actual signal voltage with the reference voltage. When the actual signal voltage is greater than the reference voltage, the actual signal voltage is the second signal voltage; when the actual signal voltage is less than the reference voltage, the actual signal voltage is the first signal voltage.

[0070] When the first comparator A1 receives the first signal voltage, it can output a low-level signal; and when it receives the second signal voltage, it can output a high-level signal. When the second optical coupler N2 receives a low-level signal, it can send a corresponding low-level signal to the signal receiving end of the master station; when the second optical coupler N2 receives a high-level signal, it can send a corresponding high-level signal to the signal receiving end of the master station. The transmission of logic signals can be achieved through high and low level signals.

[0071] It can be understood that in the above embodiment, the second optocoupler N2 can isolate the master station from the bus communication circuit. The reference voltage and the actual signal voltage at the input end of the first comparator A1 are both about 30V. By setting the optocoupler isolation, it is possible to avoid the higher voltage in the communication part from affecting the low-voltage signal of the master station. Depending on whether there is an isolation requirement, the optocoupler isolation part can be adaptively added or cancelled to suit different application scenarios. For example, when safety isolation of strong and weak electricity is required, optocoupler isolation needs to be set. The output end of the first comparator A1 is directly connected to the signal receiving end of the master station to reduce device costs.

[0072] The above-mentioned master station signal sending module 10 may include a third optical coupler N3, a voltage stabilizing chip U1, a first voltage stabilizing diode ZD1 and a second voltage stabilizing diode ZD2. The controlled end of the third optical coupler N3 is connected to the signal sending end of the master station, the output positive electrode and the output negative electrode of the third optical coupler N3 are respectively connected to the negative electrode and the positive electrode of the second voltage stabilizing diode ZD2, the input end of the voltage stabilizing chip U1 is connected to the bus voltage, the ground end of the voltage stabilizing chip U1 is connected to the negative electrode of the first voltage stabilizing diode ZD1, the positive electrode of the first voltage stabilizing diode ZD1 is connected to the negative electrode of the second voltage stabilizing diode ZD2, the positive electrode of the second voltage stabilizing diode ZD2 is grounded, and the output end of the voltage stabilizing chip U1 is the output end of the master station signal sending module 10.

[0073] When the output positive pole and output negative pole of the third optocoupler N3 are not turned on, the ground terminal of the voltage stabilizing chip U1 is grounded through two voltage stabilizing diodes. At this time, the voltage of the ground terminal of the voltage stabilizing chip U1 to the ground is the sum of the breakdown voltages of the two voltage stabilizing diodes. The signal sending end of the master station can send high and low level signals as logic signals "0" or "1". When the third optocoupler N3 receives a low level signal, the third optocoupler N3 can short-circuit the second voltage stabilizing diode ZD2. At this time, the voltage of the ground terminal of the voltage stabilizing chip U1 to the ground is the breakdown voltage of a voltage stabilizing diode. For example, when the breakdown voltage of the two voltage stabilizing diodes is 13V and the bus voltage is 31V, if the third optocoupler N3 receives a high level signal, the voltage of the output terminal of the voltage stabilizing chip U1 to the ground is 31V; and if the third optocoupler N3 receives a low level signal, the second voltage stabilizing diode ZD2 is short-circuited, and the voltage of the output terminal of the voltage stabilizing chip U1 to the ground is 18V. By detecting the output voltage of the voltage regulator chip U1, the logic signal sent by the signal sending end of the master station can be determined, thereby realizing the signal transmission process.

[0074] Understandably, Figure 2 The TX end is the signal transmitting end of the master station, and the RX end is the signal receiving end of the master station. The first optical coupler N1 can be an ordinary optical coupler. The second optical coupler N2 and the third optical coupler N3 can be ordinary optical couplers, or high-speed optical couplers can be selected according to the actual communication baud rate.

[0075] The communication protection module 20 may include a second diode D2, a transient diode TVS, a third capacitor C3 and a thermistor PTC. The anode of the second diode D2 is the first end of the communication protection module 20, the anode of the second diode D2 is grounded through the third capacitor C3, the cathode of the second diode D2 is connected to the anode of the slave station through the thermistor PTC, the cathode of the slave station is grounded, and the cathode of the second diode D2 is also grounded through the transient diode TVS.

[0076] The transient diode TVS can absorb the spike pulse signals such as static electricity and lightning strikes generated between the interface of the master station and the slave station to protect the communication circuit. When the current in the current loop is too large, the resistance of the thermistor PTC increases with the increase of temperature, and finally disconnects the circuit to protect the master station power supply and avoid external short circuit and overload damage to the master station power supply. It is understandable that when the temperature of the thermistor PTC decreases, the current loop can be connected again. The third capacitor C3 plays a filtering role and can filter the AC interference signal.

[0077] It should be noted that when the slave receives the first output voltage, the voltage will change with the change of distance and bus current. The slave can determine the corresponding logic signal "0" or "1" by detecting whether the voltage differs from the dynamic reference voltage by a preset voltage threshold. For example, the slave can realize dynamic level recognition through the interface chip TSS721A. The dynamic reference voltage of the interface chip is obtained by charging the capacitor in the chip with the voltage received at the access position of the slave. When the baud rate is greater than 300, there is a higher output voltage for every 11 bits in the transmitted bit stream, which can ensure that the dynamic reference voltage is stable near the higher output voltage. When the interface chip receives the actual output voltage, it can determine whether the corresponding logic signal "0" or "1" is received by judging whether the actual output voltage differs from the dynamic reference voltage by more than 10V.

[0078] It can be understood that in the above embodiment, the first signal voltage or the second signal voltage sent by the master station signal sending module 10 is higher than the working voltage of the slave station device, and the static standby current of the slave is the first output current. Then, the first output voltage after voltage reduction obtained by the communication protection module 20 can also be used as the working voltage of the slave station to power the slave station after being stabilized by two voltage regulator diodes.

[0079] like Figure 2 As shown, in one embodiment, the calculation formula of the reference voltage received by the second end of the first comparator A1 can be:

[0080]

[0081] Among them, Umark is the first output voltage, Imark is the first output current, R is the resistance value of the signal conversion resistor R, Ud1 is the conduction voltage drop of the first diode D1, Uq1 is the conduction voltage drop of the first switch tube Q1, Rb is the equivalent resistance of the fourth resistor R4, the equivalent DC impedance of the second capacitor C2 and the input impedance to ground of the first comparator A1 in parallel, and the R combination is the equivalent resistance of the adjustment resistors Ri in all the conductive resistance unit circuits 41 in parallel.

[0082] The present invention also provides a bus communication device, which includes a host, a slave, and a bus communication circuit connected to the host and the slave respectively. The structure of the bus communication circuit can refer to the above embodiment and will not be repeated here. As a matter of course, since the bus communication device of this embodiment adopts the technical solution of the above bus communication circuit, the bus communication device has all the beneficial effects of the above bus communication circuit.

[0083] The above are only optional embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A bus communication circuit, characterized in that: It includes a master station signal sending module, a communication protection module, a signal conversion resistor, a master station signal receiving module and a program-controlled reference voltage adjustment module; The input end of the master station signal sending module is connected to the signal sending end of the master station, the output end of the master station signal sending module is connected to the first end of the communication protection module through the signal conversion resistor, the second end of the communication protection module is connected to the slave station, the first end of the communication protection module is also connected to the first input end of the master station signal receiving module and the input end of the program-controlled reference voltage adjustment module, the output end of the program-controlled reference voltage adjustment module is connected to the second input end of the master station signal receiving module, and the output end of the master station signal receiving module is connected to the signal receiving end of the master station; The master station signal sending module is used to adjust the first output voltage according to the data signal sent by the master station; The communication protection module is used to send the first output voltage to the slave station so that the slave station can obtain the data signal sent by the master station according to the first output voltage, and is also used to adjust the first output current according to the data signal sent by the slave station; The signal conversion resistor is used to step down and adjust the first output voltage according to the first output current to obtain a first signal voltage or a second signal voltage; The program-controlled reference voltage adjustment module is used to adjust the output reference voltage to be between the first signal voltage and the second signal voltage; The master station signal receiving module is used to receive the first signal voltage or the second signal voltage and compare it with a reference voltage to obtain a data signal sent by the slave station and send it to the master station; The program-controlled reference voltage adjustment module includes a first diode and a plurality of resistor unit circuits connected in parallel with each other; The anode of the first diode is connected to the first end of the communication protection module, the cathode of the first diode is respectively connected to the first end of each resistance unit circuit, and the second end of each resistance unit circuit is connected to the second input end of the master station signal receiving module; The programmable reference voltage adjustment module is used to adjust the equivalent resistance of the programmable reference voltage adjustment module by controlling the on and off of the plurality of resistance unit circuits; Each of the resistance unit circuits comprises an adjustment resistor, a first switch tube, a first resistor, a second resistor, a first capacitor and a first control unit; The cathode of the first diode is respectively connected to the first end of the first capacitor, the first end of the first resistor and the first end of the first switch tube, the control end of the first switch tube is respectively connected to the second end of the first capacitor, the second end of the first resistor and the first end of the second resistor, the second end of the second resistor is connected to the control end of the first control unit, the controlled end of the first control unit is connected to the master station, and the second end of the first switch tube is connected to the second input end of the master station signal receiving module; The first control unit is used to control the on and off of the first switch tube according to the control signal sent by the master station; Among them, the first signal voltage is the voltage received by the master station signal receiving module after the first output voltage passes through the voltage drop of the signal conversion resistor when the slave station generates a pulse current; the second signal voltage is the voltage received by the master station signal receiving module after the first output voltage passes through the voltage drop of the signal conversion resistor R when the slave station does not generate a pulse current.

2. The bus communication circuit according to claim 1, characterized in that: The first control unit is a first optical coupler or a second switch tube.

3. The bus communication circuit according to claim 1, characterized in that: The adjustment resistors in each of the resistor unit circuits are different from each other.

4. The bus communication circuit according to claim 1, characterized in that: The master station signal receiving module includes a first comparator, a third resistor, a fourth resistor, a second capacitor and a second optical coupler; The first input end of the first comparator is connected to the first end of the communication protection module through the third resistor, the second input end of the first comparator is respectively connected to the second end of each resistor unit circuit, the second end of the first comparator is grounded through a fourth resistor, the second capacitor is connected in parallel with the fourth resistor, the output end of the first comparator is connected to the controlled end of the second optical coupler, and the control end of the second optical coupler is connected to the signal receiving end of the master station; The second optical coupler is used to send corresponding high and low level signals to the signal receiving end of the master station according to the high and low level signals output by the first comparator.

5. The bus communication circuit according to any one of claims 1 to 4, characterized in that: The master station signal sending module includes a third optical coupler, a voltage stabilizing chip, a first voltage stabilizing diode and a second voltage stabilizing diode; The controlled end of the third optocoupler is connected to the signal sending end of the master station, the output positive electrode and output negative electrode of the third optocoupler are respectively connected to the negative electrode and positive electrode of the second voltage stabilizing diode, the input end of the voltage stabilizing chip is connected to the bus voltage, the ground end of the voltage stabilizing chip is connected to the negative electrode of the first voltage stabilizing diode, the positive electrode of the first voltage stabilizing diode is connected to the negative electrode of the second voltage stabilizing diode, the positive electrode of the second voltage stabilizing diode is grounded, and the output end of the voltage stabilizing chip is the output end of the signal sending module of the master station.

6. The bus communication circuit according to any one of claims 1 to 4, characterized in that: The communication protection module includes a second diode, a transient diode, a third capacitor and a thermistor; The anode of the second diode is the first end of the communication protection module, the anode of the second diode is grounded through the third capacitor, the cathode of the second diode is connected to the anode of the slave station through the thermistor, the cathode of the slave station is grounded, and the cathode of the second diode is also grounded through the transient diode.

7. The bus communication circuit according to claim 6, characterized in that: The communication protection module is further used to receive the first output voltage to power the slave station.

8. A bus communication device, characterized in that: The bus communication device includes a host, a slave, and a bus communication circuit connected to the host and the slave respectively, and the bus communication circuit is configured as the bus communication circuit according to any one of claims 1 to 7.