WO2023168965A1 - Circuit for realizing bus communication, bus communication system, and power source energy storage device - Google Patents

Circuit for realizing bus communication, bus communication system, and power source energy storage device Download PDF

Info

Publication number
WO2023168965A1
WO2023168965A1 PCT/CN2022/129789 CN2022129789W WO2023168965A1 WO 2023168965 A1 WO2023168965 A1 WO 2023168965A1 CN 2022129789 W CN2022129789 W CN 2022129789W WO 2023168965 A1 WO2023168965 A1 WO 2023168965A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
bus
uart
circuit
processing module
Prior art date
Application number
PCT/CN2022/129789
Other languages
French (fr)
Chinese (zh)
Inventor
陈雄伟
邓勇明
Original Assignee
深圳市驰普科达科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市驰普科达科技有限公司 filed Critical 深圳市驰普科达科技有限公司
Publication of WO2023168965A1 publication Critical patent/WO2023168965A1/en

Links

Classifications

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

Definitions

  • the present application relates to the field of bus communication technology, and in particular to a circuit for realizing bus communication, a bus communication system and a power supply energy storage device.
  • the UART interface is a very common industrial interface and is a standard configuration on many chips. However, the UART interface has certain limitations and can only meet the communication requirements between two circuit modules with UART interfaces. If a live device, such as an energy storage power supply device, is provided with multiple circuit modules, an additional bus communication module needs to be provided in each circuit module to achieve communication between multiple different circuit modules.
  • the main purpose of this application is to provide a circuit, bus communication system and power supply energy storage device for realizing bus communication, aiming to use the UART interface to realize bus communication.
  • This application proposes a circuit for realizing bus communication, which is applied to a bus communication system.
  • the bus communication system includes a bus
  • the circuit for realizing bus communication includes:
  • a processing module has a UART transmitter and a UART receiver, and the UART receiver is electrically connected to the bus;
  • a transceiver circuit the input end of the transceiver circuit is connected to the UART transmitter, and the output end of the transceiver circuit is electrically connected to the UART receiver and the bus respectively;
  • the processing module is used to receive the first data sent on the bus through the UART receiving end;
  • the processing module is also configured to output the second data to the bus and the UART receiving end via the UART transmitting end and the transceiver circuit;
  • the processing module is also configured to, when outputting the second data via the UART transmitter and the transceiver circuit, if the data received via the UART receiver is different from the second data, stop processing.
  • the UART transmitting end outputs the second data, and confirms that no data has been received by the UART receiving end within the delay time corresponding to the preset source address, and then passes the UART transmitting end and the transceiver again.
  • the circuit outputs the second data to the bus and the UART receiving end.
  • the processing module is further configured to output a reception completion signal to the bus via the UART transmitter and the transceiver circuit after receiving the first data transmitted on the bus through the UART receiving end. .
  • both the second data and the first data include address characters corresponding to the preset source address
  • the processing module is also configured to encode the characters that are the same as the address characters in the data to be sent according to the preset encoding method corresponding to the address characters to generate the second data, and then use the UART to generate the second data.
  • the transmitting end and the transceiver circuit output the second data to the bus;
  • the processing module is also configured to, after outputting the second data to the bus via the UART transmitter and the transceiver circuit, if the reception completion signal is not received within the preset completion feedback time, re- The second data is output to the bus via the UART transmitter and the transceiver circuit.
  • the processing module is also configured to decode the first data according to the address characters of the first data when receiving the first data;
  • the processing module is further configured to determine that the first data including the previous address character is junk data if the address character is repeatedly received when the first data is received; and the subsequent The data after one of the address characters starts to be received as the new first data.
  • the processing module also has a bus status detection terminal, and the bus status detection terminal is electrically connected to the UART receiving terminal;
  • the processing module is configured to detect the level status of the UART receiving end through the bus status detection end, and determine that the bus is in an idle state when the level status does not change within a preset detection time;
  • the processing module is also configured to output the second data to the bus and the UART receiving end via the UART transmitting end and the transceiver circuit when it is confirmed that the bus is in an idle state.
  • the circuit for realizing bus communication further includes:
  • a first isolation circuit the first isolation circuit is connected in series between the UART receiving end and the bus; the first isolation circuit is used to isolate and transmit the first data to the UART receiving end; And also for isolating and transmitting the second data to the UART receiving end;
  • a second isolation circuit the second isolation circuit is connected in series between the input end of the transceiver circuit and the UART transmitting end; the second isolation circuit is used to isolate and transmit the second data to the bus and all Described UART receiver.
  • the circuit for realizing bus communication further includes a first current limiting circuit and a second current limiting circuit.
  • the first current limiting circuit is connected in series between the UART receiving end and the bus.
  • the second current limiting circuit is connected in series between the UART transmitting end and the transceiver circuit.
  • the transceiver circuit includes a first switch and a first resistor, the first current limiting circuit includes a second resistor, and the second current limiting circuit includes a third resistor and a first capacitor;
  • the first end of the first switch tube, the second end of the first resistor and the second end of the second resistor are respectively connected to the bus line, and the first end of the first resistor is connected to the first end of the first resistor.
  • a power supply end is connected, the second end of the first switch tube and the second end of the third resistor are respectively connected to the second end of the first capacitor, and the third end of the first switch tube is grounded, so The first end of the second resistor is connected to the UART receiving end, and the first end of the third resistor and the first end of the first capacitor are electrically connected to the UART transmitting end respectively.
  • This application also proposes a bus communication system, which includes a bus and a plurality of circuits for realizing bus communication as described in any one of the above items that are electrically connected to the bus.
  • the power supply energy storage device includes a bus and a plurality of circuit modules.
  • Each of the plurality of circuit modules includes any one of the above-mentioned devices for realizing bus communication that is electrically connected to the bus. circuit.
  • the power supply energy storage device further includes an interface, the interface is electrically connected to the bus, the interface is used to electrically connect to an external terminal, and the interface is used to access updates sent by the external terminal.
  • the data is transmitted to the circuit module via the bus and the UART receiving end to update the data in the circuit module.
  • the circuit for realizing bus communication in this application includes a processing module and a transceiver circuit.
  • the processing module has a UART transmitter and a UART receiver.
  • the UART receiver is electrically connected to the bus.
  • the input end of the transceiver circuit is connected to the UART transmitter.
  • the output ends of the transceiver circuit are respectively Electrically connected to the UART receiving end and bus.
  • the processing module is used to receive the first data sent on the bus through the UART receiving end, and is used to output the second data to the bus and UART receiving end through the UART transmitting end and the transceiver circuit, and is used to transmit the data to the bus through the UART transmitting end.
  • Figure 1 is a module schematic diagram of an embodiment of a circuit for realizing bus communication in this application;
  • Figure 2 is a module schematic diagram of another embodiment of a circuit for realizing bus communication in this application;
  • Figure 3 is a module schematic diagram of a circuit for realizing bus communication according to another embodiment of the present application.
  • Figure 4 is a circuit schematic diagram of an embodiment of a circuit for realizing bus communication in this application.
  • Figure 5 is a circuit schematic diagram of an embodiment of the bus communication system of the present application.
  • label name label name 10 processing module 20 Transceiver circuit 41 first isolation circuit 42 Second isolation circuit 31 First current limiting circuit 32 Second current limiting circuit
  • the UART interface is a very common industrial interface and is a standard configuration on many chips. However, the UART interface has certain limitations and can only meet the communication requirements between two circuit modules with UART interfaces. If a live device, such as an energy storage power supply device, is provided with multiple circuit modules, an additional bus communication module needs to be provided in each circuit module to achieve communication between multiple different circuit modules.
  • this application proposes a circuit for realizing bus communication, which is applied to the bus communication system.
  • the bus communication system includes a bus
  • the circuit for realizing bus communication includes:
  • the processing module 10 has a UART transmitting end TXD and a UART receiving end RXD, and the UART receiving end RXD is electrically connected to the bus;
  • Transceiver circuit 20 the input end of the transceiver circuit 20 is connected to the UART transmitter TXD, and the output end of the transceiver circuit 20 is electrically connected to the UART receiver RXD and the bus;
  • the processing module 10 is used to receive the first data sent on the bus through the UART receiving terminal RXD;
  • the processing module 10 is also used to output the second data to the bus and the UART receiving end RXD via the UART transmitter TXD and the transceiver circuit 20;
  • the processing module 10 is also configured to stop outputting the second data via the UART transmitting end TXD if the data received through the UART receiving end RXD is different from the second data when outputting the second data through the UART transmitting end TXD and the transceiver circuit 20 , and when it is confirmed that no data has been received by the UART receiving end RXD within the delay time corresponding to the preset source address, the second data is output to the bus and the UART receiving end RXD via the UART transmitting end TXD and the transceiver circuit 20 again.
  • the processing module 10 can be implemented using any main controller with a UART transmitter TXD and a UART receiver RXD, such as MCU, DSP (Digital Signal Process, digital signal processing chip), FPGA (Field Programmable Gate) Array, programmable logic gate array chip), etc.
  • MCU Digital Signal Process, digital signal processing chip
  • FPGA Field Programmable Gate
  • programmable logic gate array chip programmable logic gate array chip
  • the processing module 10 also has a bus status detection terminal IN, and the bus status detection terminal IN is electrically connected to the UART receiving terminal RXD;
  • the processing module 10 is used to detect the level status of the UART receiving end RXD through the bus status detection terminal IN, and determine that the bus is in an idle state when the level status does not change within the preset detection time;
  • the processing module 10 is also configured to output the second data to the bus and the UART receiving terminal RXD via the UART transmitting terminal TXD and the transceiver circuit 20 when it is confirmed that the bus is in an idle state.
  • the bus status detection terminal IN of the processing module 10 can detect the level state of the UART receiving terminal RXD.
  • the bus status detecting terminal IN of the processing module 10 detects the level state of the UART receiving terminal RXD, it always remains unchanged. , for example, if it remains high, then there will be no level change on the current bus, thus determining that the current bus is in an idle state. Since the start character of UART communication is low level, when the processing module 10 detects that the UART receiving end RXD has a low level through the bus status detection end IN, it is determined that the current bus is not in an idle state. At this time, the processing module 10 will only The first data transmitted from the bus is received through the UART receiving end RXD, and the data will not be sent out.
  • the processing module 10 can output the second data to the bus and the UART receiving end RXD via the UART transmitting end TXD and the transceiver circuit 20 .
  • a bus in a bus communication system, a bus is often electrically connected to multiple circuits for implementing bus communication in this application. Therefore, during the bus communication process, developers in each processing module 10 will set different preset source addresses for differentiation. When at least two processing modules 10 simultaneously output the second data through the UART transmitting terminal TXD and the transceiver circuit 20, this will cause the two data to interfere with each other, thereby causing data transmission errors on the bus.
  • the processing module 10 since the processing module 10 will simultaneously send the second data to its own UART receiving end RXD when outputting it through the UART transmitting end TXD and the transceiver circuit 20, if at this time the processing module 10 finds that it receives the second data through the UART receiving end RXD, If the data is inconsistent with the sent data, it will be determined that there are other processing modules 10 on the current bus that are sending data at the same time. Similarly, other processing modules 10 that are sending data at the same time will also find that they received the first data through the UART receiving end RXD. If the data is inconsistent with the sent data, it will also be determined that there are other processing modules 10 on the current bus sending data at the same time.
  • the processing module 10 When it is determined that there are other processing modules 10 on the current bus sending data at the same time, the processing module 10 will stop outputting the second data through the UART transmitter TXD, and confirm that no second data has been sent through the UART receiver RXD within the delay time corresponding to the preset source address. When any data is received, the second data is output to the bus and UART receiving end RXD via the UART transmitter TXD and the transceiver circuit 20 again.
  • Each processing module 10 has a preset source address pre-stored in it, which is "No. 1", “No. 2” and “No. 3” respectively. , the corresponding delay times are “1mS", “2mS” and "3mS” respectively.
  • the No. 1 processing module 10 and the No. 2 processing module 10 simultaneously output the second
  • the No. 1 processing module 10 and the No. 2 processing module 10 will simultaneously find that the data they receive through the UART receiving end RXD is inconsistent with the data sent, and both will stop sending data. At this time, the bus enters the idle state.
  • processing module 10 fails to receive any data within 1 mS, it is considered that the current bus is already in the idle state, and will start outputting through its UART transmitter TXD and transceiver circuit 20 Second data.
  • processing module No. 2 10 will receive the first data from the bus via the UART receiving end RXD (which is the second data sent by No. 1 above). At this time, it will consider that the bus is in a non-idle state and will not send any data.
  • the No. 2 processing module 10 finds that no data can be received within 2 mS, it will consider that the current bus is already in an idle state, and will start to pass its UART transmitter TXD and transceiver circuit 20 outputs the second data that processing module No. 2 10 needs to send. In this way, in the application of actual bus communication system, the UART interface can be used to realize bus communication.
  • the processing module 10 will also find through its UART receiving end RXD that the second data output is inconsistent with the actual data to be output, and will stop output, and confirm that it has not been received by the UART receiving end RXD within the delay time corresponding to the preset source address. After receiving any data, the second data is output again through its UART transmitting end TXD and the transceiver circuit 20 . In this way, the processing module 10 can verify and correct the output data, thereby improving the stability of the bus communication system.
  • the circuit for realizing bus communication also includes a first current limiting circuit 31 and a second current limiting circuit 32.
  • the first current limiting circuit 31 is connected in series between the UART receiving end RXD and the bus.
  • the current limiting circuit 32 is connected in series between the UART transmitting terminal TXD and the transceiver circuit 20 .
  • the first current limiting circuit 31 and the second current limiting circuit 32 can be implemented using resistors. It should be understood that the UART receiving end RXD and the UART transmitting end TXD of the processing module 10 generally can withstand relatively low currents. , excessive current may cause damage to the above two ports. Therefore, setting up the first current limiting circuit 31 and the second current limiting circuit 32 can reduce the input and output currents to the UART receiving end RXD and the UART transmitting end TXD, effectively improving the stability and reliability of the circuit that implements bus communication. sex.
  • the transceiver circuit 20 includes a first switch Q1 and a first resistor R1
  • the first current limiting circuit 31 includes a second resistor R2
  • the second current limiting circuit 32 includes a third resistor.
  • the first end of the first switch Q1, the second end of the first resistor R1, and the second end of the second resistor R2 are respectively connected to the bus, and the first end of the first resistor R1 is connected to the first power terminal V1.
  • the second terminal of the first switch Q1 and the second terminal of the third resistor R3 are respectively connected to the second terminal of the first capacitor C1.
  • the third terminal of the first switch Q1 is connected to the ground.
  • the first terminal of the second resistor R2 is connected to the UART.
  • the receiving end RXD is connected, the first end of the third resistor R3 and the first end of the first capacitor C1 are electrically connected to the UART transmitting end TXD respectively, and the bus status detection end IN of the processing module 10 is electrically connected to the UART receiving end RXD.
  • the voltage of the first power terminal V1 is the bus voltage
  • the first switch Q1 is a PNP transistor.
  • the processing module 10 wants to output data through the UART transmitting terminal TXD
  • the processing module 10 outputs a low-level signal through the UART transmitting terminal TXD
  • the first switch Q1 will be turned on.
  • the voltage at the second end of the first resistor R1 It will be pulled to the bottom, that is, the same voltage as the low-level signal.
  • the UART receiving end RXD will receive the low-level signal and will output a low-level signal to the bus.
  • the processing module 10 outputs a high-level signal through the UART transmitting terminal TXD
  • the first switch tube Q1 fails to meet the conduction condition, and the first switch tube Q1 is not turned on.
  • the UART receiving terminal RXD will receive a high-level signal. level signal. In this way, the data output by the processing module 10 through the UART receiving terminal RXD can be simultaneously output to the bus and fed back to the UART receiving terminal RXD.
  • the bus status detection terminal IN When the processing module 10 has not output any data through the UART transmitting terminal TXD, and when other processing modules 10 connected to the bus are sending data from the bus, the bus status detection terminal IN will detect the level change on the current bus. At this time The processing module 10 will not output any data via the UART transmitting terminal TXD, and will receive any data via the UART receiving terminal RXD.
  • the circuit for realizing bus communication in this application includes a processing module 10 and a transceiver circuit 20.
  • the processing module 10 has a UART transmitter TXD and a UART receiver RXD.
  • the UART receiver RXD is electrically connected to the bus.
  • the input end of the transceiver circuit 20 is connected to the UART transmitter TXD. connection, the output end of the transceiver circuit 20 is electrically connected to the UART receiving end RXD and the bus respectively.
  • the processing module 10 is used to receive the first data sent on the bus via the UART receiving terminal RXD, and is used to output the second data to the bus and the UART receiving terminal RXD via the UART transmitting terminal TXD and the transceiver circuit 20, and is used to When the second data is output via the UART transmitting terminal TXD and the transceiver circuit 20, if the data received via the UART receiving terminal RXD is different from the second data, the output of the second data via the UART transmitting terminal TXD is stopped, and the preset source address is When it is confirmed that no data has been received by the UART receiving end RXD within the corresponding delay time, the second data is output to the bus and the UART receiving end RXD via the UART transmitting end TXD and the transceiver circuit 20 again.
  • this application implements bus communication using the UART interface.
  • multiple circuit modules do not need to install additional bus communication modules.
  • the processing module 10 is also configured to output a reception completion signal to the bus via the UART transmitter TXD and the transceiver circuit 20 after receiving the first data transmitted on the bus via the UART receiver RXD.
  • Both the second data and the first data include address characters corresponding to the preset source address
  • the processing module 10 is also used to generate the second data after encoding the characters that are the same as the address characters in the data to be sent according to the preset encoding method corresponding to the address characters, and then encode the second data through the UART transmitter TXD and the transceiver circuit 20. 2. Data output to the bus;
  • the processing module 10 is also used to output the second data to the bus via the UART transmitter TXD and the transceiver circuit 20, if the reception completion signal is not received within the preset completion feedback time, then re-transmit the data via the UART transmitter TXD and the transceiver circuit 20. Circuit 20 outputs the second data to the bus.
  • the processing module 10 is also configured to decode the first data according to the address characters of the first data when receiving the first data;
  • the processing module 10 is also configured to, when receiving the first data, if address characters are repeatedly received, determine that the first data including the previous address character is junk data; and use the data after the next address character as new The first data starts to be received.
  • each circuit mounted on the bus to implement bus communication will pre-store different preset source addresses in the processing module 10 according to the user's needs. Therefore, when the processing module 10 sends data to the outside, it will also include the address characters related to the preset source address as the beginning. It can be understood that the data sent out through the UART transmitter will also include the data that needs to be transmitted via the bus. The address characters of the default source address corresponding to other processing modules 10.
  • the processing module 10 when the processing module 10 needs to send data via the UART transmitter, the characters that are the same as the address characters in the data to be sent will be encoded according to the preset encoding method.
  • the preset encoding corresponding to the current processing module 10 Assuming that the address character of the source address is "05”, any "05” character in the data to be output, except the address character, will be modified to "V”, and the second data will be generated after encoding, and then transmitted via UART
  • the terminal TXD and the transceiver circuit 20 output the second data to the bus.
  • the processing module 10 when the processing module 10 receives the first data from the bus through the UART receiving end RXD, it will also first receive the address characters of the first data, and then decode the contents of the remaining characters according to the preset encoding method. Specifically, taking the received first data as the second data output by the processing module 10 in the above embodiment as an example, the processing module 10 receives the first data through the UART receiving end RXD, and determines that the address character of the first data is " 05", all subsequent "V" characters will be decoded into "05".
  • UART transmission data will have data length variables in accordance with protocol requirements, so that when the processing module 10 receives the first data via the UART receiving end RXD, the time to end the reception is determined based on the data length variable. .
  • the data may be interfered by the environment in which the receiving processing module 10 is located, which may cause the data length variable to change. This causes the processing module 10 to receive the first data even though it has actually received all the data. data, but it will still be considered that the data has not been completely received and is always in the receiving state, resulting in the inability to feed back the completion signal to the bus.
  • the processing module 10 outputs the second data to the bus via the UART transmitter TXD and the transceiver circuit 20, if the reception completion signal is not received within the preset completion feedback time, it will re-transmit via the UART.
  • the terminal TXD and the transceiver circuit 20 output the second data to the bus.
  • the processing module 10 of the receiver reads the address character again, it immediately determines that all the previously received data is junk data, and starts to receive the data after the address character as the new first data again, thereby preventing the data from being read.
  • the data length variable is disturbed and modified, causing the processing module 10 to be in the receiving state for a long time.
  • the address character corresponding to the source address prestored by the receiver processing module 10 is 01
  • the address character corresponding to the source address prestored by the transmitter processing module 10 is 02
  • the preset completion feedback time is 1S. Example to illustrate.
  • the character that is the same as the address character 02 in the data to be output will be modified to "II" to generate the second data, and the data length variable of the second data will be set to 5 bytes.
  • the data length variable of the second data became 10,000 bytes.
  • the receiving party's processing module 10 when the receiving party's processing module 10 receives the first data that is the above-mentioned interfered second data, it will determine that its address character is "02" and determine that the data length variable is 10,000 bytes. The receiving party's processing module 10 will be in the receiving state for a long time, and the reception completion signal will not be fed back to the transmitter through the bus. Therefore, since the transmitter processing module 10 does not receive the reception completion signal within the preset completion feedback time, the transmitter processing module 10 will re-output the second data to the bus via the UART transmitter TXD and the transceiver circuit 20 .
  • the receiver processing module 10 will again receive the first data, which is the second data after the interference, from the bus via the UART receiving end RXD, and will receive the unique address character "02" again, and the receiver will process The module 10 will consider that the data before this new address character are junk data, and start receiving the data after the next address character as the new first data. In this way, in practical applications, compared with the existing method of verifying all data after receiving it, changes in data length variables can be discovered faster, thereby shortening the error correction time.
  • a check code is also set in the transmitted UART data. If the processing module 10 receives the first data from the bus via the UART receiving end RXD, the data length variable is not wrong, but the intermediate data occurs. If there is an error, the processing module 10 will perform verification according to the check code in the received first data after completing the reception of the data to determine whether there is an error in the intermediate data.
  • a circuit for realizing bus communication also includes:
  • the first isolation circuit 41 is connected in series between the UART receiving end RXD and the bus; the first isolation circuit 41 is used to isolate and transmit the first data to the UART receiving end RXD; the first isolation circuit 41 also Used to isolate and transmit the second data to the UART receiving end RXD;
  • the second isolation circuit 42 is connected in series between the input terminal of the transceiver circuit 20 and the UART transmitting terminal TXD; the second isolation circuit 42 is used to transmit the second data in isolation to the bus and the UART receiving terminal RXD.
  • the voltage level of the application environment of the bus communication system using UART communication may be different from the voltage level of the circuit module used in the circuit of the present application to implement bus communication.
  • the voltage of the application environment The level is 48V
  • the working voltage of the sensor is 3.3V
  • the working voltage limit of its processing module 10 is also 3.3V.
  • the UART receiving end RXD and the UART transmitting end TXD on the processing module 10 in the sensor can only withstand a voltage of 3.3V, which is much less than 48V. This causes the processing module 10 of the sensor to be unable to withstand the bus voltage and unable to drive the transceiver circuit 20 Work.
  • both the first isolation circuit and the second isolation circuit 42 can be implemented using voltage isolation devices, such as optocouplers, transformers, etc.
  • the first isolation circuit 41 can convert the first data of a high voltage level on the bus, such as the first data of 48V, into the first data of a low voltage level, such as the first data of 3.3V. , so that the UART receiving end RXD of the processing module 10 in a low-voltage working environment can normally receive the first data.
  • the second isolation circuit 42 can also convert the low-voltage second data output by the UART transmitting end TXD of the processing module 10 into high-voltage second data, and output it to the bus through the transceiver circuit 20 .
  • This application also proposes a bus communication system, including a bus and any of the above-mentioned circuits for realizing bus communication.
  • bus communication system of the present application is based on the above-mentioned circuit for realizing bus communication
  • the embodiments of the bus communication system of the present application include all the technical solutions of all the embodiments of the above-mentioned circuit for realizing bus communication, and the technology achieved The effect is exactly the same and will not be repeated here.
  • the power supply energy storage device includes a bus and multiple circuit modules.
  • Each of the multiple circuit modules includes any of the above-mentioned circuits for realizing bus communication that are electrically connected to the bus.
  • the embodiments of the power supply energy storage device of the present application include all the technical solutions of all the embodiments of the above-mentioned circuit for realizing bus communication, and achieve The technical effects are also exactly the same and will not be repeated here.
  • the power supply energy storage device also includes an interface, the interface is electrically connected to the bus, the interface is used to electrically connect to the external terminal, the interface is used to access update data sent by the external terminal, and transmits it via the bus and the UART receiving end.
  • RXD is transmitted to the circuit module to update the data in the circuit module.
  • the interface can be a charging interface of the power supply energy storage device, such as a TYPE-C interface, a Micro USB interface, etc., and the bus can be connected to the data line of the charging interface.
  • R&D personnel or after-sales personnel can send data to the bus through the charging interface, and then transmit update data to the circuit module connected to the bus, thereby achieving online upgrade of the internal circuit module program of the power supply energy storage device.

Abstract

The present application provides a circuit for realizing bus communication, a bus communication system, and a power source energy storage device. The circuit for realizing bus communication is applied to the bus communication system; the bus communication system comprises a bus; the circuit for realizing bus communication comprises a processing module and a transceiving circuit; the processing module is provided with a UART transmitting end and a UART receiving end; the UART receiving end is electrically connected to the bus; an input end of the transceiving circuit is connected to the UART transmitting end; and an output end of the transceiving circuit is respectively electrically connected to the UART receiving end and the bus.

Description

实现总线通讯的电路、总线通讯系统及电源储能装置Circuits, bus communication systems and power supply energy storage devices that realize bus communication
本申请要求于2022年3月8号申请的、申请号为202210218161.2的中国专利申请的优先权。This application claims priority to the Chinese patent application with application number 202210218161.2 filed on March 8, 2022.
技术领域Technical field
本申请涉及总线通讯技术领域,特别涉及一种实现总线通讯的电路、总线通讯系统及电源储能装置。The present application relates to the field of bus communication technology, and in particular to a circuit for realizing bus communication, a bus communication system and a power supply energy storage device.
背景技术Background technique
UART接口是一种非常常见的工业接口,是很多芯片上的标准配置。然而,UART接口具有一定的局限性,只能够满足两个带有UART接口之间的电路模块的通讯。若一带电设备,例如储能电源装置中设置有多个电路模块,则需要额外在每个电路模块中再设置一总线通讯模块,才能够实现多个不同的电路模块之间的通讯。The UART interface is a very common industrial interface and is a standard configuration on many chips. However, the UART interface has certain limitations and can only meet the communication requirements between two circuit modules with UART interfaces. If a live device, such as an energy storage power supply device, is provided with multiple circuit modules, an additional bus communication module needs to be provided in each circuit module to achieve communication between multiple different circuit modules.
技术问题technical problem
本申请的主要目的是提供一种实现总线通讯的电路、总线通讯系统及电源储能装置,旨在采用UART接口实现总线通讯。The main purpose of this application is to provide a circuit, bus communication system and power supply energy storage device for realizing bus communication, aiming to use the UART interface to realize bus communication.
技术解决方案Technical solutions
本申请提出了一种实现总线通讯的电路,应用于总线通讯系统,所述总线通讯系统包括总线,所述实现总线通讯的电路包括:This application proposes a circuit for realizing bus communication, which is applied to a bus communication system. The bus communication system includes a bus, and the circuit for realizing bus communication includes:
处理模块,所述处理模块具有UART发射端和UART接收端,所述UART接收端与所述总线电连接;A processing module, the processing module has a UART transmitter and a UART receiver, and the UART receiver is electrically connected to the bus;
收发电路,所述收发电路的输入端与所述UART发射端连接,所述收发电路的输出端分别与所述UART接收端与所述总线电连接;A transceiver circuit, the input end of the transceiver circuit is connected to the UART transmitter, and the output end of the transceiver circuit is electrically connected to the UART receiver and the bus respectively;
其中,所述处理模块,用于经所述UART接收端接收所述总线上发来的第一数据;Wherein, the processing module is used to receive the first data sent on the bus through the UART receiving end;
所述处理模块,还用于经所述UART发射端和所述收发电路将第二数据输出至总线和所述UART接收端;The processing module is also configured to output the second data to the bus and the UART receiving end via the UART transmitting end and the transceiver circuit;
所述处理模块,还用于在经所述UART发射端和所述收发电路输出所述第二数据时,若经所述UART接收端接收到的数据与所述第二数据不同,则停止经所述UART发射端输出所述第二数据,并在预设源地址相对应的延迟时间内确认未经所述UART接收端接收到任何数据时,再重新经所述UART发射端和所述收发电路将所述第二数据输出至总线和所述UART接收端。The processing module is also configured to, when outputting the second data via the UART transmitter and the transceiver circuit, if the data received via the UART receiver is different from the second data, stop processing. The UART transmitting end outputs the second data, and confirms that no data has been received by the UART receiving end within the delay time corresponding to the preset source address, and then passes the UART transmitting end and the transceiver again. The circuit outputs the second data to the bus and the UART receiving end.
在一实施方式中,所述处理模块还用于在经所述UART接收端接收完所述总线上传来的第一数据后,经所述UART发射端和所述收发电路输出接收完成信号至总线。In one embodiment, the processing module is further configured to output a reception completion signal to the bus via the UART transmitter and the transceiver circuit after receiving the first data transmitted on the bus through the UART receiving end. .
在一实施方式中,所述第二数据和所述第一数据中均包括与所述预设源地址对应的地址字符;In one implementation, both the second data and the first data include address characters corresponding to the preset source address;
所述处理模块,还用于将待发送的数据中的与所述地址字符相同的字符按照与所述地址字符对应的预设编码方式进行编码后生成所述第二数据,再经所述UART发射端和所述收发电路将所述第二数据输出至总线;The processing module is also configured to encode the characters that are the same as the address characters in the data to be sent according to the preset encoding method corresponding to the address characters to generate the second data, and then use the UART to generate the second data. The transmitting end and the transceiver circuit output the second data to the bus;
所述处理模块,还用于在经所述UART发射端和所述收发电路将所述第二数据输出至总线后,若在预设完成反馈时间内未接收到所述接收完成信号,则重新经所述UART发射端和所述收发电路将所述第二数据输出至总线。The processing module is also configured to, after outputting the second data to the bus via the UART transmitter and the transceiver circuit, if the reception completion signal is not received within the preset completion feedback time, re- The second data is output to the bus via the UART transmitter and the transceiver circuit.
所述处理模块,还用于在接收到所述第一数据时,根据所述第一数据的地址字符对所述第一数据进行解码处理;The processing module is also configured to decode the first data according to the address characters of the first data when receiving the first data;
所述处理模块,还用于在接收到所述第一数据时,若重复接收到所述地址字符时,则确定包括前一个所述地址字符的所述第一数据为垃圾数据;并将后一个所述地址字符后的数据作为新的所述第一数据开始接收。The processing module is further configured to determine that the first data including the previous address character is junk data if the address character is repeatedly received when the first data is received; and the subsequent The data after one of the address characters starts to be received as the new first data.
在一实施方式中,所述处理模块还具有总线状态检测端,所述总线状态检测端与所述UART接收端电连接;In one embodiment, the processing module also has a bus status detection terminal, and the bus status detection terminal is electrically connected to the UART receiving terminal;
所述处理模块,用于经所述总线状态检测端检测所述UART接收端的电平状态,并在所述电平状态在预设检测时间内未变化时,确定所述总线处于空闲状态;The processing module is configured to detect the level status of the UART receiving end through the bus status detection end, and determine that the bus is in an idle state when the level status does not change within a preset detection time;
所述处理模块,还用于在确认所述总线处于空闲状态时,经所述UART发射端和所述收发电路将第二数据输出至总线和所述UART接收端。The processing module is also configured to output the second data to the bus and the UART receiving end via the UART transmitting end and the transceiver circuit when it is confirmed that the bus is in an idle state.
在一实施方式中,所述实现总线通讯的电路还包括:In one embodiment, the circuit for realizing bus communication further includes:
第一隔离电路,所述第一隔离电路串联于所述UART接收端和所述总线之间;所述第一隔离电路,用于将所述第一数据进行隔离传输至所述UART接收端;以及还用于将所述第二数据进行隔离传输至所述UART接收端;A first isolation circuit, the first isolation circuit is connected in series between the UART receiving end and the bus; the first isolation circuit is used to isolate and transmit the first data to the UART receiving end; And also for isolating and transmitting the second data to the UART receiving end;
第二隔离电路,所述第二隔离电路串联于所述收发电路的输入端和所述UART发射端之间;所述第二隔离电路,用于将所述第二数据隔离传输至总线和所述UART接收端。A second isolation circuit, the second isolation circuit is connected in series between the input end of the transceiver circuit and the UART transmitting end; the second isolation circuit is used to isolate and transmit the second data to the bus and all Described UART receiver.
在一实施方式中,所述实现总线通讯的电路还包括第一限流电路和第二限流电路,所述第一限流电路串联在所述UART接收端和所述总线之间,所述第二限流电路串联在所述UART发射端和所述收发电路之间。In one embodiment, the circuit for realizing bus communication further includes a first current limiting circuit and a second current limiting circuit. The first current limiting circuit is connected in series between the UART receiving end and the bus. The second current limiting circuit is connected in series between the UART transmitting end and the transceiver circuit.
在一实施方式中,所述收发电路包括第一开关管、第一电阻,所述第一限流电路包括第二电阻,所述第二限流电路包括第三电阻和第一电容;In one embodiment, the transceiver circuit includes a first switch and a first resistor, the first current limiting circuit includes a second resistor, and the second current limiting circuit includes a third resistor and a first capacitor;
其中,所述第一开关管的第一端、所述第一电阻的第二端、所述第二电阻的第二端分别与所述总线连接,所述第一电阻的第一端与第一电源端连接,所述第一开关管的第二端、所述第三电阻的第二端分别与所述第一电容的第二端,所述第一开关管的第三端接地,所述第二电阻的第一端与所述UART接收端连接,所述第三电阻的第一端、所述第一电容的第一端分别与所述UART发射端电连接。Wherein, the first end of the first switch tube, the second end of the first resistor and the second end of the second resistor are respectively connected to the bus line, and the first end of the first resistor is connected to the first end of the first resistor. A power supply end is connected, the second end of the first switch tube and the second end of the third resistor are respectively connected to the second end of the first capacitor, and the third end of the first switch tube is grounded, so The first end of the second resistor is connected to the UART receiving end, and the first end of the third resistor and the first end of the first capacitor are electrically connected to the UART transmitting end respectively.
本申请还提出了一种总线通讯系统,包括总线和与所述总线电连接的多个如上述任一项所述的实现总线通讯的电路。This application also proposes a bus communication system, which includes a bus and a plurality of circuits for realizing bus communication as described in any one of the above items that are electrically connected to the bus.
本申请还提出了一种电源储能装置,电源储能装置包括总线和多个电路模块,多个所述电路模块均包括与所述总线电连接的上述任一项所述的实现总线通讯的电路。This application also proposes a power supply energy storage device. The power supply energy storage device includes a bus and a plurality of circuit modules. Each of the plurality of circuit modules includes any one of the above-mentioned devices for realizing bus communication that is electrically connected to the bus. circuit.
在一实施方式中,所述电源储能装置还包括接口,所述接口与所述总线电连接,所述接口用于与外部终端电连接,所述接口用于接入外部终端发来的更新数据,并经总线和所述UART接收端传输至所述电路模块,以更新所述电路模块内的数据。In one embodiment, the power supply energy storage device further includes an interface, the interface is electrically connected to the bus, the interface is used to electrically connect to an external terminal, and the interface is used to access updates sent by the external terminal. The data is transmitted to the circuit module via the bus and the UART receiving end to update the data in the circuit module.
有益效果beneficial effects
本申请实现总线通讯的电路包括处理模块、收发电路,处理模块具有UART发射端和UART接收端,UART接收端与总线电连接,收发电路的输入端与UART发射端连接,收发电路的输出端分别与UART接收端与总线电连接。其中,处理模块用于经UART接收端接收总线上发来的第一数据,以及用于经UART发射端和收发电路将第二数据输出至总线和UART接收端,以及用于在经UART发射端和收发电路输出第二数据时,若经UART接收端接收到的数据与第二数据不同,则停止经UART发射端输出第二数据,并在预设源地址相对应的延迟时间内确认未经UART接收端接收到任何数据时,再重新经UART发射端和收发电路将第二数据输出至总线和UART接收端。如此,本申请实现了采用UART接口实现总线通讯。在实际电源储能装置中,多个电路模块不用再额外安装总线通讯模块,只需要用各个电路模块的处理器自带的UART接口和上述本申请电路,便能够实现多个电路模块之间的总线通讯。The circuit for realizing bus communication in this application includes a processing module and a transceiver circuit. The processing module has a UART transmitter and a UART receiver. The UART receiver is electrically connected to the bus. The input end of the transceiver circuit is connected to the UART transmitter. The output ends of the transceiver circuit are respectively Electrically connected to the UART receiving end and bus. Among them, the processing module is used to receive the first data sent on the bus through the UART receiving end, and is used to output the second data to the bus and UART receiving end through the UART transmitting end and the transceiver circuit, and is used to transmit the data to the bus through the UART transmitting end. When the transceiver circuit outputs the second data, if the data received through the UART receiving end is different from the second data, the output of the second data through the UART transmitting end will be stopped, and it will be confirmed within the delay time corresponding to the preset source address. When the UART receiving end receives any data, the second data is output to the bus and the UART receiving end again through the UART transmitting end and the transceiver circuit. In this way, this application implements bus communication using the UART interface. In an actual power supply energy storage device, multiple circuit modules do not need to install additional bus communication modules. You only need to use the UART interface of the processor of each circuit module and the above-mentioned circuit of the present application to realize communication between multiple circuit modules. bus communication.
附图说明Description of the drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。In order to explain the embodiments of the present application or the technical solutions in the prior art more clearly, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on the structures shown in these drawings without exerting creative efforts.
图1为本申请实现总线通讯的电路一实施例的模块示意图;Figure 1 is a module schematic diagram of an embodiment of a circuit for realizing bus communication in this application;
图2为本申请实现总线通讯的电路另一实施例的模块示意图;Figure 2 is a module schematic diagram of another embodiment of a circuit for realizing bus communication in this application;
图3为本申请实现总线通讯的电路再一实施例的模块示意图;Figure 3 is a module schematic diagram of a circuit for realizing bus communication according to another embodiment of the present application;
图4为本申请实现总线通讯的电路一实施例的电路示意图;Figure 4 is a circuit schematic diagram of an embodiment of a circuit for realizing bus communication in this application;
图5为本申请总线通讯系统一实施例的电路示意图。Figure 5 is a circuit schematic diagram of an embodiment of the bus communication system of the present application.
附图标号说明:Explanation of reference numbers:
标号 label 名称 name 标号 label 名称 name
10 10 处理模块 processing module 20 20 收发电路 Transceiver circuit
41 41 第一隔离电路 first isolation circuit 42 42 第二隔离电路 Second isolation circuit
31 31 第一限流电路 First current limiting circuit 32 32 第二限流电路 Second current limiting circuit
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings.
本发明的实施方式Embodiments of the invention
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
UART接口是一种非常常见的工业接口,是很多芯片上的标准配置。然而,UART接口具有一定的局限性,只能够满足两个带有UART接口之间的电路模块的通讯。若一带电设备,例如储能电源装置中设置有多个电路模块,则需要额外在每个电路模块中再设置一总线通讯模块,才能够实现多个不同的电路模块之间的通讯。The UART interface is a very common industrial interface and is a standard configuration on many chips. However, the UART interface has certain limitations and can only meet the communication requirements between two circuit modules with UART interfaces. If a live device, such as an energy storage power supply device, is provided with multiple circuit modules, an additional bus communication module needs to be provided in each circuit module to achieve communication between multiple different circuit modules.
为此,本申请提出一种实现总线通讯的电路,应用于总线通讯系统,总线通讯系统包括总线,实现总线通讯的电路包括:To this end, this application proposes a circuit for realizing bus communication, which is applied to the bus communication system. The bus communication system includes a bus, and the circuit for realizing bus communication includes:
处理模块10,处理模块10具有UART发射端TXD和UART接收端RXD,UART接收端RXD与总线电连接;Processing module 10, the processing module 10 has a UART transmitting end TXD and a UART receiving end RXD, and the UART receiving end RXD is electrically connected to the bus;
收发电路20,收发电路20的输入端与UART发射端TXD连接,收发电路20的输出端分别与UART接收端RXD与总线电连接;Transceiver circuit 20, the input end of the transceiver circuit 20 is connected to the UART transmitter TXD, and the output end of the transceiver circuit 20 is electrically connected to the UART receiver RXD and the bus;
其中,处理模块10,用于经UART接收端RXD接收总线上发来的第一数据;Among them, the processing module 10 is used to receive the first data sent on the bus through the UART receiving terminal RXD;
处理模块10,还用于经UART发射端TXD和收发电路20将第二数据输出至总线和UART接收端RXD;The processing module 10 is also used to output the second data to the bus and the UART receiving end RXD via the UART transmitter TXD and the transceiver circuit 20;
处理模块10,还用于在经UART发射端TXD和收发电路20输出第二数据时,若经UART接收端RXD接收到的数据与第二数据不同,则停止经UART发射端TXD输出第二数据,并在预设源地址相对应的延迟时间内确认未经UART接收端RXD接收到任何数据时,再重新经UART发射端TXD和收发电路20将第二数据输出至总线和UART接收端RXD。The processing module 10 is also configured to stop outputting the second data via the UART transmitting end TXD if the data received through the UART receiving end RXD is different from the second data when outputting the second data through the UART transmitting end TXD and the transceiver circuit 20 , and when it is confirmed that no data has been received by the UART receiving end RXD within the delay time corresponding to the preset source address, the second data is output to the bus and the UART receiving end RXD via the UART transmitting end TXD and the transceiver circuit 20 again.
在本实施例中,处理模块10可以采用任何带UART发射端TXD和UART接收端RXD的主控制器来实现,例如MCU、DSP(Digital Signal Process,数字信号处理芯片)、FPGA(Field Programmable Gate Array,可编程逻辑门阵列芯片)等。In this embodiment, the processing module 10 can be implemented using any main controller with a UART transmitter TXD and a UART receiver RXD, such as MCU, DSP (Digital Signal Process, digital signal processing chip), FPGA (Field Programmable Gate) Array, programmable logic gate array chip), etc.
在本实施例中,参考图4,处理模块10还具有总线状态检测端IN,总线状态检测端IN与UART接收端RXD电连接;In this embodiment, referring to Figure 4, the processing module 10 also has a bus status detection terminal IN, and the bus status detection terminal IN is electrically connected to the UART receiving terminal RXD;
处理模块10,用于经总线状态检测端IN检测UART接收端RXD的电平状态,并在电平状态在预设检测时间内未变化时,确定总线处于空闲状态;The processing module 10 is used to detect the level status of the UART receiving end RXD through the bus status detection terminal IN, and determine that the bus is in an idle state when the level status does not change within the preset detection time;
处理模块10,还用于在确认总线处于空闲状态时,经UART发射端TXD和收发电路20将第二数据输出至总线和UART接收端RXD。The processing module 10 is also configured to output the second data to the bus and the UART receiving terminal RXD via the UART transmitting terminal TXD and the transceiver circuit 20 when it is confirmed that the bus is in an idle state.
在本实施例中,处理模块10的总线状态检测端IN可以检测UART接收端RXD的电平状态,当处理模块10的总线状态检测端IN检测到UART接收端RXD的电平状态始终保持不变,例如保持高电平,那么当前总线上也就没有电平变化,从而确定当前总线处于空闲状态。由于UART通讯的起始字符为低电平,所以在处理模块10经总线状态检测端IN检测到UART接收端RXD有低电平时,则确定当前总线不处于空闲状态,此时处理模块10只会经UART接收端RXD接收总线传来的第一数据,并不会发出数据。同样的,当确定UAER接收端的电平没有变化,即确定当前总线空闲时,处理模块10就可以经UART发射端TXD和收发电路20将第二数据输出至总线和UART接收端RXD。In this embodiment, the bus status detection terminal IN of the processing module 10 can detect the level state of the UART receiving terminal RXD. When the bus status detecting terminal IN of the processing module 10 detects the level state of the UART receiving terminal RXD, it always remains unchanged. , for example, if it remains high, then there will be no level change on the current bus, thus determining that the current bus is in an idle state. Since the start character of UART communication is low level, when the processing module 10 detects that the UART receiving end RXD has a low level through the bus status detection end IN, it is determined that the current bus is not in an idle state. At this time, the processing module 10 will only The first data transmitted from the bus is received through the UART receiving end RXD, and the data will not be sent out. Similarly, when it is determined that the level of the UAER receiving end has not changed, that is, when it is determined that the current bus is idle, the processing module 10 can output the second data to the bus and the UART receiving end RXD via the UART transmitting end TXD and the transceiver circuit 20 .
在本实施例中,需要理解的是,在总线通讯系统中,在一个总线上往往电连接着多个本申请实现总线通讯的电路。因此,在进行总线通讯的过程中,每个处理模块10内研发人员都会设置有不同的预设源地址以进行区别。当至少两个处理模块10同时经UART发射端TXD和收发电路20输出第二数据时,这就会导致两个数据互相干扰,进而导致总线上的传输的数据错误。此时,由于处理模块10在经UART发射端TXD和收发电路20输出第二数据时会同时发给自己的UART接收端RXD,若此时处理模块10发现其经UART接收端RXD接收到的第一数据和发出的数据不一致,则会确定当前总线上有其他处理模块10在同时发出数据,同理,其他同时在发出数据的处理模块10也会发现其经UART接收端RXD接收到的第一数据和发出的数据不一致,同样会确定当前总线上有其他处理模块10在同时发出数据。当确定当前总线上有其他处理模块10在同时发出数据时,处理模块10会停止经UART发射端TXD输出第二数据,并在预设源地址相对应的延迟时间内确认未经UART接收端RXD接收到任何数据时,再重新经UART发射端TXD和收发电路20将第二数据输出至总线和UART接收端RXD。In this embodiment, it should be understood that in a bus communication system, a bus is often electrically connected to multiple circuits for implementing bus communication in this application. Therefore, during the bus communication process, developers in each processing module 10 will set different preset source addresses for differentiation. When at least two processing modules 10 simultaneously output the second data through the UART transmitting terminal TXD and the transceiver circuit 20, this will cause the two data to interfere with each other, thereby causing data transmission errors on the bus. At this time, since the processing module 10 will simultaneously send the second data to its own UART receiving end RXD when outputting it through the UART transmitting end TXD and the transceiver circuit 20, if at this time the processing module 10 finds that it receives the second data through the UART receiving end RXD, If the data is inconsistent with the sent data, it will be determined that there are other processing modules 10 on the current bus that are sending data at the same time. Similarly, other processing modules 10 that are sending data at the same time will also find that they received the first data through the UART receiving end RXD. If the data is inconsistent with the sent data, it will also be determined that there are other processing modules 10 on the current bus sending data at the same time. When it is determined that there are other processing modules 10 on the current bus sending data at the same time, the processing module 10 will stop outputting the second data through the UART transmitter TXD, and confirm that no second data has been sent through the UART receiver RXD within the delay time corresponding to the preset source address. When any data is received, the second data is output to the bus and UART receiving end RXD via the UART transmitter TXD and the transceiver circuit 20 again.
具体地,以总线上分别电连接着三个本申请实现总线通讯的电路,每个处理模块10内都预存有预设源地址,分别为“1号”、“2号”和“3号”,其所对应的延时时间分别为“1mS”、“2mS”和“3mS”,当1号处理模块10和2号处理模块10同时经其各自的UART发射端TXD和收发电路20输出第二数据时,1号处理模块10和2号处理模块10会同时发现其各自经UART接收端RXD接收到的数据和发出的数据不一致,并都会停止发送数据。此时,总线进入空闲状态,当1号处理模块10在1mS内未能够接收到任何数据时,则认为当前总线已经是处于空闲状态了,便会开始经其UART发射端TXD和收发电路20输出第二数据。此刻,2号处理模块10便会经UART接收端RXD接收到总线传来的第一数据(为上述1号发出的第二数据)此时便会认为总线处于非空闲状态,不会发送任何数据,待接收完第一数据以后,若2号处理模块10发现在2mS内未能够接收到任何数据时,则认为当前总线已经是处于空闲状态了,便会开始经其UART发射端TXD和收发电路20输出2号处理模块10需要发出的第二数据。如此,在实际总线通讯系统的应用中,便能够采用UART接口实现总线通讯。Specifically, three circuits of the present application for realizing bus communication are electrically connected to the bus. Each processing module 10 has a preset source address pre-stored in it, which is "No. 1", "No. 2" and "No. 3" respectively. , the corresponding delay times are "1mS", "2mS" and "3mS" respectively. When the No. 1 processing module 10 and the No. 2 processing module 10 simultaneously output the second When receiving data, the No. 1 processing module 10 and the No. 2 processing module 10 will simultaneously find that the data they receive through the UART receiving end RXD is inconsistent with the data sent, and both will stop sending data. At this time, the bus enters the idle state. When the No. 1 processing module 10 fails to receive any data within 1 mS, it is considered that the current bus is already in the idle state, and will start outputting through its UART transmitter TXD and transceiver circuit 20 Second data. At this moment, processing module No. 2 10 will receive the first data from the bus via the UART receiving end RXD (which is the second data sent by No. 1 above). At this time, it will consider that the bus is in a non-idle state and will not send any data. , after receiving the first data, if the No. 2 processing module 10 finds that no data can be received within 2 mS, it will consider that the current bus is already in an idle state, and will start to pass its UART transmitter TXD and transceiver circuit 20 outputs the second data that processing module No. 2 10 needs to send. In this way, in the application of actual bus communication system, the UART interface can be used to realize bus communication.
同时,可以理解的是,若当前处理模块10在经其UART发射端TXD和收发电路20输出第二数据时受到干扰,导致输出到总线的第二数据和实际想要输出的数据不一致,处理模块10同样也会经其UART接收端RXD发现输出的第二数据与实际想要输出的数据不一致,便会停止输出,在预设源地址相对应的延迟时间内确认未经UART接收端RXD接收到任何数据后,重新经其UART发射端TXD和收发电路20输出第二数据。如此,便能够实现处理模块10对于输出的数据的校验与改正,提高了总线通讯系统工作的稳定性。At the same time, it can be understood that if the current processing module 10 is interfered when outputting the second data through its UART transmitting end TXD and the transceiver circuit 20, causing the second data output to the bus to be inconsistent with the data actually intended to be output, the processing module 10 will also find through its UART receiving end RXD that the second data output is inconsistent with the actual data to be output, and will stop output, and confirm that it has not been received by the UART receiving end RXD within the delay time corresponding to the preset source address. After receiving any data, the second data is output again through its UART transmitting end TXD and the transceiver circuit 20 . In this way, the processing module 10 can verify and correct the output data, thereby improving the stability of the bus communication system.
在本实施例中,参考图2,实现总线通讯的电路还包括第一限流电路31和第二限流电路32,第一限流电路31串联在UART接收端RXD和总线之间,第二限流电路32串联在UART发射端TXD和收发电路20之间。In this embodiment, referring to Figure 2, the circuit for realizing bus communication also includes a first current limiting circuit 31 and a second current limiting circuit 32. The first current limiting circuit 31 is connected in series between the UART receiving end RXD and the bus. The current limiting circuit 32 is connected in series between the UART transmitting terminal TXD and the transceiver circuit 20 .
在本实施例中,第一限流电路31和第二限流电路32可以采用电阻来实现,需要理解的是,处理模块10的UART接收端RXD和UART发射端TXD一般能够承受的电流较低,过大的电流可能导致上述两个端口损坏。因此,设置上述第一限流电路31和第二限流电路32,能够降低输入和输出至UART接收端RXD和UART发射端TXD的电流,有效地提高了实现总线通讯的电路的稳定性和可靠性。In this embodiment, the first current limiting circuit 31 and the second current limiting circuit 32 can be implemented using resistors. It should be understood that the UART receiving end RXD and the UART transmitting end TXD of the processing module 10 generally can withstand relatively low currents. , excessive current may cause damage to the above two ports. Therefore, setting up the first current limiting circuit 31 and the second current limiting circuit 32 can reduce the input and output currents to the UART receiving end RXD and the UART transmitting end TXD, effectively improving the stability and reliability of the circuit that implements bus communication. sex.
具体地,在本申请一实施例中,参考图4,收发电路20包括第一开关管Q1、第一电阻R1,第一限流电路31包括第二电阻R2,第二限流电路32包括第三电阻R3和第一电容C1;Specifically, in one embodiment of the present application, referring to FIG. 4 , the transceiver circuit 20 includes a first switch Q1 and a first resistor R1 , the first current limiting circuit 31 includes a second resistor R2 , and the second current limiting circuit 32 includes a third resistor. three resistors R3 and the first capacitor C1;
其中,第一开关管Q1的第一端、第一电阻R1的第二端、第二电阻R2的第二端分别与总线连接,第一电阻R1的第一端与第一电源端V1连接,第一开关管Q1的第二端、第三电阻R3的第二端分别与第一电容C1的第二端,第一开关管Q1的第三端接地,第二电阻R2的第一端与UART接收端RXD连接,第三电阻R3的第一端、第一电容C1的第一端分别与UART发射端TXD电连接,处理模块10的总线状态检测端IN与UART接收端RXD电连接。Among them, the first end of the first switch Q1, the second end of the first resistor R1, and the second end of the second resistor R2 are respectively connected to the bus, and the first end of the first resistor R1 is connected to the first power terminal V1. The second terminal of the first switch Q1 and the second terminal of the third resistor R3 are respectively connected to the second terminal of the first capacitor C1. The third terminal of the first switch Q1 is connected to the ground. The first terminal of the second resistor R2 is connected to the UART. The receiving end RXD is connected, the first end of the third resistor R3 and the first end of the first capacitor C1 are electrically connected to the UART transmitting end TXD respectively, and the bus status detection end IN of the processing module 10 is electrically connected to the UART receiving end RXD.
在本实施例中,第一电源端V1的电压为总线电压,第一开关管Q1为PNP三极管。In this embodiment, the voltage of the first power terminal V1 is the bus voltage, and the first switch Q1 is a PNP transistor.
当处理模块10要经UART发射端TXD输出数据时,若处理模块10经UART发射端TXD输出低电平信号,则第一开关管Q1会导通,此时第一电阻R1的第二端的电压会被拉到底,即和低电平信号同一电压,此时UART接收端RXD会接收到低电平信号,同时会将向总线输出低电平信号。同理,当处理模块10经UART发射端TXD输出高电平信号时,第一开关管Q1未能够满足导通条件,则第一开关管Q1不打开,此时UART接收端RXD会接收到高电平信号。如此,便能够实现处理模块10在经UART接收端RXD输出的数据能够同时输出至总线以及反馈至UART接收端RXD。When the processing module 10 wants to output data through the UART transmitting terminal TXD, if the processing module 10 outputs a low-level signal through the UART transmitting terminal TXD, the first switch Q1 will be turned on. At this time, the voltage at the second end of the first resistor R1 It will be pulled to the bottom, that is, the same voltage as the low-level signal. At this time, the UART receiving end RXD will receive the low-level signal and will output a low-level signal to the bus. In the same way, when the processing module 10 outputs a high-level signal through the UART transmitting terminal TXD, the first switch tube Q1 fails to meet the conduction condition, and the first switch tube Q1 is not turned on. At this time, the UART receiving terminal RXD will receive a high-level signal. level signal. In this way, the data output by the processing module 10 through the UART receiving terminal RXD can be simultaneously output to the bus and fed back to the UART receiving terminal RXD.
当处理模块10还未经UART发射端TXD输出任何数据时,且有其他连接在总线的处理模块10在从总线发出数据时,总线状态检测端IN会检测到当前总线上电平变化,此时处理模块10会不经UART发射端TXD输出任何数据,并会经UART接收端RXD接收任何数据。When the processing module 10 has not output any data through the UART transmitting terminal TXD, and when other processing modules 10 connected to the bus are sending data from the bus, the bus status detection terminal IN will detect the level change on the current bus. At this time The processing module 10 will not output any data via the UART transmitting terminal TXD, and will receive any data via the UART receiving terminal RXD.
本申请实现总线通讯的电路包括处理模块10、收发电路20,处理模块10具有UART发射端TXD和UART接收端RXD,UART接收端RXD与总线电连接,收发电路20的输入端与UART发射端TXD连接,收发电路20的输出端分别与UART接收端RXD与总线电连接。其中,处理模块10用于经UART接收端RXD接收总线上发来的第一数据,以及用于经UART发射端TXD和收发电路20将第二数据输出至总线和UART接收端RXD,以及用于在经UART发射端TXD和收发电路20输出第二数据时,若经UART接收端RXD接收到的数据与第二数据不同,则停止经UART发射端TXD输出第二数据,并在预设源地址相对应的延迟时间内确认未经UART接收端RXD接收到任何数据时,再重新经UART发射端TXD和收发电路20将第二数据输出至总线和UART接收端RXD。如此,本申请实现了采用UART接口实现总线通讯。在实际电源储能装置中,多个电路模块不用再额外安装总线通讯模块,只需要用各个电路模块的处理器自带的UART接口和上述本申请电路,便能够实现多个电路模块之间的总线通讯。The circuit for realizing bus communication in this application includes a processing module 10 and a transceiver circuit 20. The processing module 10 has a UART transmitter TXD and a UART receiver RXD. The UART receiver RXD is electrically connected to the bus. The input end of the transceiver circuit 20 is connected to the UART transmitter TXD. connection, the output end of the transceiver circuit 20 is electrically connected to the UART receiving end RXD and the bus respectively. Among them, the processing module 10 is used to receive the first data sent on the bus via the UART receiving terminal RXD, and is used to output the second data to the bus and the UART receiving terminal RXD via the UART transmitting terminal TXD and the transceiver circuit 20, and is used to When the second data is output via the UART transmitting terminal TXD and the transceiver circuit 20, if the data received via the UART receiving terminal RXD is different from the second data, the output of the second data via the UART transmitting terminal TXD is stopped, and the preset source address is When it is confirmed that no data has been received by the UART receiving end RXD within the corresponding delay time, the second data is output to the bus and the UART receiving end RXD via the UART transmitting end TXD and the transceiver circuit 20 again. In this way, this application implements bus communication using the UART interface. In an actual power supply energy storage device, multiple circuit modules do not need to install additional bus communication modules. You only need to use the UART interface of the processor of each circuit module and the above-mentioned circuit of the present application to realize communication between multiple circuit modules. bus communication.
在本申请一实施例中,处理模块10还用于在经UART接收端RXD接收完总线上传来的第一数据后,经UART发射端TXD和收发电路20输出接收完成信号至总线。In an embodiment of the present application, the processing module 10 is also configured to output a reception completion signal to the bus via the UART transmitter TXD and the transceiver circuit 20 after receiving the first data transmitted on the bus via the UART receiver RXD.
第二数据和第一数据中都包括与预设源地址对应的地址字符;Both the second data and the first data include address characters corresponding to the preset source address;
处理模块10,还用于将待发送的数据中的与地址字符相同的字符按照与地址字符对应的预设编码方式进行编码后生成第二数据,再经UART发射端TXD和收发电路20将第二数据输出至总线;The processing module 10 is also used to generate the second data after encoding the characters that are the same as the address characters in the data to be sent according to the preset encoding method corresponding to the address characters, and then encode the second data through the UART transmitter TXD and the transceiver circuit 20. 2. Data output to the bus;
处理模块10,还用于在经UART发射端TXD和收发电路20将第二数据输出至总线后,若在预设完成反馈时间内未接收到接收完成信号,则重新经UART发射端TXD和收发电路20将第二数据输出至总线。The processing module 10 is also used to output the second data to the bus via the UART transmitter TXD and the transceiver circuit 20, if the reception completion signal is not received within the preset completion feedback time, then re-transmit the data via the UART transmitter TXD and the transceiver circuit 20. Circuit 20 outputs the second data to the bus.
处理模块10,还用于在接收到第一数据时,根据第一数据的地址字符对第一数据进行解码处理;The processing module 10 is also configured to decode the first data according to the address characters of the first data when receiving the first data;
处理模块10,还用于在接收到第一数据时,若重复接收到地址字符时,则确定包括前一个地址字符的第一数据为垃圾数据;并将后一个地址字符后的数据作为新的第一数据开始接收。The processing module 10 is also configured to, when receiving the first data, if address characters are repeatedly received, determine that the first data including the previous address character is junk data; and use the data after the next address character as new The first data starts to be received.
在实际应用中,由上述内容已知,每个挂载在总线的实现总线通讯的电路都会根据用户的需求在处理模块10内预存不同的预设源地址。因此,在处理模块10对外发送数据时,也会包含其发送与预设源地址相关的地址字符作为开头,可以理解的是,经UART发送端发送输出的数据同样也会包括需要经总线传输到的其他的处理模块10所对应的预设源地址的地址字符。In practical applications, it is known from the above that each circuit mounted on the bus to implement bus communication will pre-store different preset source addresses in the processing module 10 according to the user's needs. Therefore, when the processing module 10 sends data to the outside, it will also include the address characters related to the preset source address as the beginning. It can be understood that the data sent out through the UART transmitter will also include the data that needs to be transmitted via the bus. The address characters of the default source address corresponding to other processing modules 10.
在本实施例中,在处理模块10需要经UART发送端发送数据时,会把待发送的数据中的与地址字符相同的字符按照预设编码方式进行编码,例如,当前处理模块10对应的预设源地址的地址字符为“05”,则会将待输出数据中,除了地址字符外的任何“05”的字符修改为“V”,并在进行编码后生成第二数据,再经UART发射端TXD和收发电路20将第二数据输出至总线。In this embodiment, when the processing module 10 needs to send data via the UART transmitter, the characters that are the same as the address characters in the data to be sent will be encoded according to the preset encoding method. For example, the preset encoding corresponding to the current processing module 10 Assuming that the address character of the source address is "05", any "05" character in the data to be output, except the address character, will be modified to "V", and the second data will be generated after encoding, and then transmitted via UART The terminal TXD and the transceiver circuit 20 output the second data to the bus.
同理,在处理模块10通过UART接收端RXD从总线接收到第一数据时,也会先接收到第一数据的地址字符,然后根据预设编码方式对剩下字符中的内容进行解码。具体地,以接收到的第一数据为上述实施例中处理模块10输出的第二数据为例,处理模块10经过UART接收端RXD接收第一数据,并确定了第一数据的地址字符为“05”,便会将后续的所有“V”的字符,进行解码为“05”。Similarly, when the processing module 10 receives the first data from the bus through the UART receiving end RXD, it will also first receive the address characters of the first data, and then decode the contents of the remaining characters according to the preset encoding method. Specifically, taking the received first data as the second data output by the processing module 10 in the above embodiment as an example, the processing module 10 receives the first data through the UART receiving end RXD, and determines that the address character of the first data is " 05", all subsequent "V" characters will be decoded into "05".
需要理解的是,在实际应用中,UART传输数据会有按照协议要求的有数据长度变量,从而使处理模块10经UART接收端RXD接收到第一数据时,根据数据长度变量确定结束接收的时刻。在数据的接收过程中,数据可能会受到接收方处理模块10所处环境的干扰,进而导致数据长度变量产生变化,这就导致处理模块10在接收第一数据时,虽然实际已经接收完了所有的数据,但是依然会认为该数据未接收完始终处于接收状态,导致无法反馈完成信号至总线。此时,由上述内容可知,处理模块10在经UART发射端TXD和收发电路20将第二数据输出至总线后,若在预设完成反馈时间内未接收到接收完成信号,则重新经UART发射端TXD和收发电路20将第二数据输出至总线。如此,接收方的处理模块10在又一次读取到地址字符时,即刻认定前面接收到的所有数据为垃圾数据,而重新将地址字符后的数据作为新的第一数据开始接收,从而防止因数据长度变量被干扰而修改导致处理模块10长时间处于接收状态的情况发生。It should be understood that in actual applications, UART transmission data will have data length variables in accordance with protocol requirements, so that when the processing module 10 receives the first data via the UART receiving end RXD, the time to end the reception is determined based on the data length variable. . During the process of receiving data, the data may be interfered by the environment in which the receiving processing module 10 is located, which may cause the data length variable to change. This causes the processing module 10 to receive the first data even though it has actually received all the data. data, but it will still be considered that the data has not been completely received and is always in the receiving state, resulting in the inability to feed back the completion signal to the bus. At this time, it can be known from the above that after the processing module 10 outputs the second data to the bus via the UART transmitter TXD and the transceiver circuit 20, if the reception completion signal is not received within the preset completion feedback time, it will re-transmit via the UART. The terminal TXD and the transceiver circuit 20 output the second data to the bus. In this way, when the processing module 10 of the receiver reads the address character again, it immediately determines that all the previously received data is junk data, and starts to receive the data after the address character as the new first data again, thereby preventing the data from being read. The data length variable is disturbed and modified, causing the processing module 10 to be in the receiving state for a long time.
具体地,参考图5,以接收方处理模块10预存的源地址对应的地址字符为01,以及发射方处理模块10预存的源地址对应的地址字符为02,以及预设完成反馈时间为1S为例进行说明。Specifically, referring to FIG. 5 , the address character corresponding to the source address prestored by the receiver processing module 10 is 01, and the address character corresponding to the source address prestored by the transmitter processing module 10 is 02, and the preset completion feedback time is 1S. Example to illustrate.
当发射方处理模块10需要输出数据时,会将待输出的数据中的与地址字符02相同的字符修改为“II”,以生成第二数据,并且将第二数据的数据长度变量设置为5个字节。在传输过程中,因为受到了干扰,导致第二数据的数据长度变量变为10000个字节。When the transmitter processing module 10 needs to output data, the character that is the same as the address character 02 in the data to be output will be modified to "II" to generate the second data, and the data length variable of the second data will be set to 5 bytes. During the transmission process, due to interference, the data length variable of the second data became 10,000 bytes.
此时,接收方的处理模块10接收到为上述干扰后的第二数据的第一数据时,会确定其地址字符为“02”以及确定数据长度变量为10000个字节,接收方的处理模块10会长时间的处于接收状态,而不会反馈完接收完成信号经总线反馈至发射方。因此,由于发射方处理模块10在预设完成反馈时间内未接收到接收完成信号,故发射方处理模块10会重新经UART发射端TXD和收发电路20将第二数据输出至总线。此刻,接收方处理模块10会又重新经UART接收端RXD从总线上接收到为上述干扰后第二数据的第一数据,便会又一次接收到唯一的地址字符“02”,则接收方处理模块10会认为在此新的地址字符前的数据都是垃圾数据,并将后一个地址字符后的数据作为新的第一数据开始接收。如此,在实际应用中,相比较于现有的将所有数据接收完后校验的方式,能够更快的发现数据长度变量的变化,从而缩短纠错的时间。At this time, when the receiving party's processing module 10 receives the first data that is the above-mentioned interfered second data, it will determine that its address character is "02" and determine that the data length variable is 10,000 bytes. The receiving party's processing module 10 will be in the receiving state for a long time, and the reception completion signal will not be fed back to the transmitter through the bus. Therefore, since the transmitter processing module 10 does not receive the reception completion signal within the preset completion feedback time, the transmitter processing module 10 will re-output the second data to the bus via the UART transmitter TXD and the transceiver circuit 20 . At this moment, the receiver processing module 10 will again receive the first data, which is the second data after the interference, from the bus via the UART receiving end RXD, and will receive the unique address character "02" again, and the receiver will process The module 10 will consider that the data before this new address character are junk data, and start receiving the data after the next address character as the new first data. In this way, in practical applications, compared with the existing method of verifying all data after receiving it, changes in data length variables can be discovered faster, thereby shortening the error correction time.
可以理解的是,传输的UART数据中还会设置有校验码,若处理模块10在经UART接收端RXD从总线接收第一数据的过程中,数据长度变量并未错误,而是中间数据发生错误,则处理模块10会在完成接收数据后根据接收到的第一数据中的校验码进行校验,以判断中间数据是否出现错误。It can be understood that a check code is also set in the transmitted UART data. If the processing module 10 receives the first data from the bus via the UART receiving end RXD, the data length variable is not wrong, but the intermediate data occurs. If there is an error, the processing module 10 will perform verification according to the check code in the received first data after completing the reception of the data to determine whether there is an error in the intermediate data.
参考图3,在本申请一实施例中,实现总线通讯的电路还包括:Referring to Figure 3, in an embodiment of the present application, a circuit for realizing bus communication also includes:
第一隔离电路41,第一个隔离电路串联于UART接收端RXD和总线之间;第一隔离电路41,用于将第一数据进行隔离传输至UART接收端RXD;第一隔离电路41,还用于将第二数据进行隔离传输至UART接收端RXD;The first isolation circuit 41 is connected in series between the UART receiving end RXD and the bus; the first isolation circuit 41 is used to isolate and transmit the first data to the UART receiving end RXD; the first isolation circuit 41 also Used to isolate and transmit the second data to the UART receiving end RXD;
第二隔离电路42,第二隔离电路42串联于收发电路20的输入端和UART发射端TXD之间;第二隔离电路42,用于将第二数据隔离传输至总线和UART接收端RXD。The second isolation circuit 42 is connected in series between the input terminal of the transceiver circuit 20 and the UART transmitting terminal TXD; the second isolation circuit 42 is used to transmit the second data in isolation to the bus and the UART receiving terminal RXD.
需要理解的是,在实际应用中,采用UART通信的总线通讯系统的应用环境的电压等级与本申请实现总线通讯的电路所应用的电路模块上的电压等级可能并不相同,例如应用环境的电压等级为48V,而传感器的工作电压为3.3V,其处理模块10的工作电压极限也在3.3V。此时,传感器内的处理模块10上的UART接收端RXD和UART发射端TXD仅仅能够承受3.3V电压,远小于48V,这就导致传感器的处理模块10无法承受总线电压,以及无法驱动收发电路20工作。It should be understood that in actual applications, the voltage level of the application environment of the bus communication system using UART communication may be different from the voltage level of the circuit module used in the circuit of the present application to implement bus communication. For example, the voltage of the application environment The level is 48V, while the working voltage of the sensor is 3.3V, and the working voltage limit of its processing module 10 is also 3.3V. At this time, the UART receiving end RXD and the UART transmitting end TXD on the processing module 10 in the sensor can only withstand a voltage of 3.3V, which is much less than 48V. This causes the processing module 10 of the sensor to be unable to withstand the bus voltage and unable to drive the transceiver circuit 20 Work.
为此,在本实施例中,第一个隔离电路和第二隔离电路42都可以采用电压隔离器件,例如光耦、变压器等来实现。如此,在实际应用中,第一隔离电路41便能够将总线上的高电压等级的第一数据,例如48V的第一数据,转换为低电压等级的第一数据,例如3.3V的第一数据,以使低电压工作环境中的处理模块10的UART接收端RXD能够正常接收第一数据。同理,第二隔离电路42也可以将处理模块10的UART发射端TXD输出的低电压等级的第二数据,转换为高电压等级的第二数据,并且经过收发电路20输出至总线。For this reason, in this embodiment, both the first isolation circuit and the second isolation circuit 42 can be implemented using voltage isolation devices, such as optocouplers, transformers, etc. In this way, in practical applications, the first isolation circuit 41 can convert the first data of a high voltage level on the bus, such as the first data of 48V, into the first data of a low voltage level, such as the first data of 3.3V. , so that the UART receiving end RXD of the processing module 10 in a low-voltage working environment can normally receive the first data. Similarly, the second isolation circuit 42 can also convert the low-voltage second data output by the UART transmitting end TXD of the processing module 10 into high-voltage second data, and output it to the bus through the transceiver circuit 20 .
通过上述设置,能够使得在总线通讯系统中,使多个不同电压等级的通讯模块都能够互相之间实现总线通讯,提高了本申请总线通讯系统的兼容性。Through the above settings, multiple communication modules with different voltage levels can realize bus communication with each other in the bus communication system, thereby improving the compatibility of the bus communication system of the present application.
本申请还提出了总线通讯系统,包括总线和上述任一项的实现总线通讯的电路。This application also proposes a bus communication system, including a bus and any of the above-mentioned circuits for realizing bus communication.
值得注意的是,由于本申请总线通讯系统基于上述的实现总线通讯的电路,因此,本申请总线通讯系统的实施例包括上述实现总线通讯的电路全部实施例的全部技术方案,且所达到的技术效果也完全相同,在此不再赘述。It is worth noting that since the bus communication system of the present application is based on the above-mentioned circuit for realizing bus communication, the embodiments of the bus communication system of the present application include all the technical solutions of all the embodiments of the above-mentioned circuit for realizing bus communication, and the technology achieved The effect is exactly the same and will not be repeated here.
本申请还提出了电源储能装置,电源储能装置包括总线和多个电路模块,多个电路模块均包括与总线电连接的上述任一项的实现总线通讯的电路。This application also proposes a power supply energy storage device. The power supply energy storage device includes a bus and multiple circuit modules. Each of the multiple circuit modules includes any of the above-mentioned circuits for realizing bus communication that are electrically connected to the bus.
值得注意的是,由于本申请电源储能装置基于上述的实现总线通讯的电路,因此,本申请电源储能装置的实施例包括上述实现总线通讯的电路全部实施例的全部技术方案,且所达到的技术效果也完全相同,在此不再赘述。It is worth noting that since the power supply energy storage device of the present application is based on the above-mentioned circuit for realizing bus communication, the embodiments of the power supply energy storage device of the present application include all the technical solutions of all the embodiments of the above-mentioned circuit for realizing bus communication, and achieve The technical effects are also exactly the same and will not be repeated here.
需要理解的是,常规的处理器中一般都设置有UART接口,在实际应用中,电源储能装置内部会有多个电路模块,例如DC/DC电路板、AC/DC电路板和BMS电路板,多个电路模块中为了满足电路控制需求,往往都会设置有处理器如此,多个电路模块仅通过一根总线和上述实现总线通讯的电路便可以实现互相之间UART接口通讯,无需额外设置其他的总线进行通讯,降低了电路布线与器件的成本。What needs to be understood is that conventional processors are generally equipped with a UART interface. In practical applications, there will be multiple circuit modules inside the power supply energy storage device, such as DC/DC circuit boards, AC/DC circuit boards and BMS circuit boards. In order to meet the circuit control requirements, multiple circuit modules are often equipped with processors. Multiple circuit modules can realize UART interface communication with each other through only one bus and the above-mentioned bus communication circuit, without the need to set up other additional circuit modules. The bus communicates, reducing the cost of circuit wiring and devices.
在另一实施例中,电源储能装置还包括接口,接口与总线电连接,接口用于与外部终端电连接,接口用于接入外部终端发来的更新数据,并经总线和UART接收端RXD传输至电路模块,以更新电路模块内的数据。In another embodiment, the power supply energy storage device also includes an interface, the interface is electrically connected to the bus, the interface is used to electrically connect to the external terminal, the interface is used to access update data sent by the external terminal, and transmits it via the bus and the UART receiving end. RXD is transmitted to the circuit module to update the data in the circuit module.
在本实施例中,接口可以为电源储能装置的充电接口,例如TYPE-C接口、Micro USB接口等,总线可以连接在充电接口的数据线上。如此,在实际应用中,研发人员或者是售后人员,可以通过充电接口向总线发送数据,进而向与总线连接的电路模块传输更新数据,从而实现对电源储能装置内部电路模块程序的在线升级,无需再拆装电源储能装置的外壳,提高了使用电源储能装置的便利性。In this embodiment, the interface can be a charging interface of the power supply energy storage device, such as a TYPE-C interface, a Micro USB interface, etc., and the bus can be connected to the data line of the charging interface. In this way, in practical applications, R&D personnel or after-sales personnel can send data to the bus through the charging interface, and then transmit update data to the circuit module connected to the bus, thereby achieving online upgrade of the internal circuit module program of the power supply energy storage device. There is no need to disassemble and assemble the housing of the power supply energy storage device, which improves the convenience of using the power supply energy storage device.
以上仅为本申请的可选实施例,并非因此限制本申请的专利范围,凡是在本申请的发明构思下,利用本申请说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本申请的专利保护范围内。The above are only optional embodiments of the present application, and do not limit the patent scope of the present application. Under the inventive concept of the present application, equivalent structural transformations made by using the contents of the description and drawings of the present application, or directly/indirectly used in Other related technical fields are included in the patent protection scope of this application.

Claims (10)

  1. 一种实现总线通讯的电路,应用于总线通讯系统,所述总线通讯系统包括总线,其中,所述实现总线通讯的电路包括:A circuit for realizing bus communication, applied to a bus communication system, the bus communication system includes a bus, wherein the circuit for realizing bus communication includes:
    处理模块,所述处理模块具有UART发射端和UART接收端,所述UART接收端与所述总线电连接;A processing module, the processing module has a UART transmitter and a UART receiver, and the UART receiver is electrically connected to the bus;
    收发电路,所述收发电路的输入端与所述UART发射端连接,所述收发电路的输出端分别与所述UART接收端与所述总线电连接;A transceiver circuit, the input end of the transceiver circuit is connected to the UART transmitter, and the output end of the transceiver circuit is electrically connected to the UART receiver and the bus respectively;
    其中,所述处理模块,用于经所述UART接收端接收所述总线上发来的第一数据;Wherein, the processing module is used to receive the first data sent on the bus through the UART receiving end;
    所述处理模块,还用于经所述UART发射端和所述收发电路将第二数据输出至总线和所述UART接收端;The processing module is also configured to output the second data to the bus and the UART receiving end via the UART transmitting end and the transceiver circuit;
    所述处理模块,还用于在经所述UART发射端和所述收发电路输出所述第二数据时,若经所述UART接收端接收到的数据与所述第二数据不同,则停止经所述UART发射端输出所述第二数据,并在预设源地址相对应的延迟时间内确认未经所述UART接收端接收到任何数据时,再重新经所述UART发射端和所述收发电路将所述第二数据输出至总线和所述UART接收端。The processing module is also configured to, when outputting the second data via the UART transmitter and the transceiver circuit, if the data received via the UART receiver is different from the second data, stop processing. The UART transmitting end outputs the second data, and confirms that no data has been received by the UART receiving end within the delay time corresponding to the preset source address, and then passes the UART transmitting end and the transceiver again. The circuit outputs the second data to the bus and the UART receiving end.
  2. 如权利要求1所述的实现总线通讯的电路,其中,所述处理模块还用于在经所述UART接收端接收完所述总线上传来的第一数据后,经所述UART发射端和所述收发电路输出接收完成信号至总线。The circuit for realizing bus communication according to claim 1, wherein the processing module is further configured to, after receiving the first data transmitted on the bus through the UART receiving end, transmit the data via the UART transmitting end and the The transceiver circuit outputs a reception completion signal to the bus.
  3. 如权利要求2所述的实现总线通讯的电路,其中,所述第二数据和所述第一数据中均包括与所述预设源地址对应的地址字符;The circuit for realizing bus communication according to claim 2, wherein both the second data and the first data include address characters corresponding to the preset source address;
    所述处理模块,还用于将待发送的数据中的与所述地址字符相同的字符按照与所述地址字符对应的预设编码方式进行编码后生成所述第二数据,再经所述UART发射端和所述收发电路将所述第二数据输出至总线;The processing module is also configured to encode the characters that are the same as the address characters in the data to be sent according to the preset encoding method corresponding to the address characters to generate the second data, and then use the UART to generate the second data. The transmitting end and the transceiver circuit output the second data to the bus;
    所述处理模块,还用于在经所述UART发射端和所述收发电路将所述第二数据输出至总线后,若在预设完成反馈时间内未接收到所述接收完成信号,则重新经所述UART发射端和所述收发电路将所述第二数据输出至总线;The processing module is also configured to, after outputting the second data to the bus via the UART transmitter and the transceiver circuit, if the reception completion signal is not received within the preset completion feedback time, re- Output the second data to the bus via the UART transmitter and the transceiver circuit;
    所述处理模块,还用于在接收到所述第一数据时,根据所述第一数据的地址字符对所述第一数据进行解码处理;The processing module is also configured to decode the first data according to the address characters of the first data when receiving the first data;
    所述处理模块,还用于在接收到所述第一数据时,若重复接收到所述地址字符时,则确定包括前一个所述地址字符的所述第一数据为垃圾数据;并将后一个所述地址字符后的数据作为新的所述第一数据开始接收。The processing module is further configured to determine that the first data including the previous address character is junk data if the address character is repeatedly received when the first data is received; and the subsequent The data after one of the address characters starts to be received as the new first data.
  4. 如权利要求1所述的实现总线通讯的电路,其中,所述处理模块还具有总线状态检测端,所述总线状态检测端与所述UART接收端电连接;The circuit for realizing bus communication according to claim 1, wherein the processing module also has a bus status detection terminal, and the bus status detection terminal is electrically connected to the UART receiving terminal;
    所述处理模块,用于经所述总线状态检测端检测所述UART接收端的电平状态,并在所述电平状态在预设检测时间内未变化时,确定所述总线处于空闲状态;The processing module is configured to detect the level status of the UART receiving end through the bus status detection end, and determine that the bus is in an idle state when the level status does not change within a preset detection time;
    所述处理模块,还用于在确认所述总线处于空闲状态时,经所述UART发射端和所述收发电路将所述第二数据输出至总线和所述UART接收端。The processing module is also configured to output the second data to the bus and the UART receiving end via the UART transmitting end and the transceiver circuit when it is confirmed that the bus is in an idle state.
  5. 如权利要求1所述的实现总线通讯的电路,其中,所述实现总线通讯的电路还包括:The circuit for realizing bus communication according to claim 1, wherein the circuit for realizing bus communication further includes:
    第一隔离电路,所述第一隔离电路串联于所述UART接收端和所述总线之间;所述第一隔离电路,用于将所述第一数据进行隔离传输至所述UART接收端;以及还用于将所述第二数据进行隔离传输至所述UART接收端;A first isolation circuit, the first isolation circuit is connected in series between the UART receiving end and the bus; the first isolation circuit is used to isolate and transmit the first data to the UART receiving end; And also for isolating and transmitting the second data to the UART receiving end;
    第二隔离电路,所述第二隔离电路串联于所述收发电路的输入端和所述UART发射端之间;所述第二隔离电路,用于将所述第二数据隔离传输至总线和所述UART接收端。A second isolation circuit, the second isolation circuit is connected in series between the input end of the transceiver circuit and the UART transmitting end; the second isolation circuit is used to isolate and transmit the second data to the bus and all Described UART receiving end.
  6. 如权利要求1所述的实现总线通讯的电路,其中,所述实现总线通讯的电路还包括第一限流电路和第二限流电路,所述第一限流电路串联在所述UART接收端和所述总线之间,所述第二限流电路串联在所述UART发射端和所述收发电路之间。The circuit for realizing bus communication according to claim 1, wherein the circuit for realizing bus communication further includes a first current limiting circuit and a second current limiting circuit, and the first current limiting circuit is connected in series to the UART receiving end. and the bus, the second current limiting circuit is connected in series between the UART transmitting end and the transceiver circuit.
  7. 如权利要求6所述的实现总线通讯的电路,其中,所述收发电路包括第一开关管、第一电阻,所述第一限流电路包括第二电阻,所述第二限流电路包括第三电阻和第一电容;The circuit for realizing bus communication according to claim 6, wherein the transceiver circuit includes a first switch tube and a first resistor, the first current limiting circuit includes a second resistor, and the second current limiting circuit includes a third three resistors and the first capacitor;
    其中,所述第一开关管的第一端、所述第一电阻的第二端、所述第二电阻的第二端分别与所述总线连接,所述第一电阻的第一端与第一电源端连接,所述第一开关管的第二端、所述第三电阻的第二端分别与所述第一电容的第二端,所述第一开关管的第三端接地,所述第二电阻的第一端与所述UART接收端连接,所述第三电阻的第一端、所述第一电容的第一端分别与所述UART发射端电连接。Wherein, the first end of the first switch tube, the second end of the first resistor and the second end of the second resistor are respectively connected to the bus line, and the first end of the first resistor is connected to the first end of the first resistor. A power supply end is connected, the second end of the first switch tube and the second end of the third resistor are respectively connected to the second end of the first capacitor, and the third end of the first switch tube is grounded, so The first end of the second resistor is connected to the UART receiving end, and the first end of the third resistor and the first end of the first capacitor are electrically connected to the UART transmitting end respectively.
  8. 一种总线通讯系统,包括总线和与所述总线电连接的多个如上述权利要求1-7任一项所述的实现总线通讯的电路。A bus communication system includes a bus and a plurality of circuits for realizing bus communication as described in any one of claims 1 to 7 that are electrically connected to the bus.
  9. 一种电源储能装置,其中,所述电源储能装置包括总线和多个电路模块,多个所述电路模块均包括与所述总线电连接的上述权利要求1-7任一项所述的实现总线通讯的电路。A power supply energy storage device, wherein the power supply energy storage device includes a bus and a plurality of circuit modules, and each of the plurality of circuit modules includes a circuit module according to any one of claims 1-7 electrically connected to the bus. A circuit that implements bus communication.
  10. 如权利要求9所述的电源储能装置,其中,所述电源储能装置还包括接口,所述接口与所述总线电连接,所述接口用于与外部终端电连接,所述接口用于接入所述外部终端发来的更新数据,并经总线和所述UART接收端传输至所述电路模块,以更新所述电路模块内的数据。The power supply energy storage device according to claim 9, wherein the power supply energy storage device further includes an interface, the interface is electrically connected to the bus, the interface is used to electrically connect to an external terminal, and the interface is used to The update data sent by the external terminal is accessed and transmitted to the circuit module via the bus and the UART receiving end to update the data in the circuit module.
PCT/CN2022/129789 2022-03-08 2022-11-04 Circuit for realizing bus communication, bus communication system, and power source energy storage device WO2023168965A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210218161.2A CN114301732B (en) 2022-03-08 2022-03-08 Circuit for realizing bus communication, bus communication system and power supply energy storage device
CN202210218161.2 2022-03-08

Publications (1)

Publication Number Publication Date
WO2023168965A1 true WO2023168965A1 (en) 2023-09-14

Family

ID=80978685

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/129789 WO2023168965A1 (en) 2022-03-08 2022-11-04 Circuit for realizing bus communication, bus communication system, and power source energy storage device

Country Status (2)

Country Link
CN (1) CN114301732B (en)
WO (1) WO2023168965A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301732B (en) * 2022-03-08 2022-06-10 深圳市驰普科达科技有限公司 Circuit for realizing bus communication, bus communication system and power supply energy storage device
CN115378911B (en) * 2022-10-24 2023-01-03 上海泰矽微电子有限公司 LIN bus automatic addressing system and implementation method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6385210B1 (en) * 1998-04-17 2002-05-07 Ford Global Technologies, Inc. Method for detecting and resolving data corruption in a UART based communication network
CN106453383A (en) * 2016-11-07 2017-02-22 深圳拓邦股份有限公司 UART (universal asynchronous receiver/transmitter)-based master-slave multi-processor communication system and method
CN109284248A (en) * 2018-08-23 2019-01-29 深圳柴火创客教育服务有限公司 UART bus communication method, equipment and its functional module using UART bus communication
CN113792003A (en) * 2021-09-24 2021-12-14 展讯通信(深圳)有限公司 Single bus communication unit, system and method
CN114301732A (en) * 2022-03-08 2022-04-08 深圳市驰普科达科技有限公司 Circuit for realizing bus communication, bus communication system and power supply energy storage device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7336700B2 (en) * 2001-09-20 2008-02-26 Lockheed Martin Corporation System bus transceiver interface
CN1949734B (en) * 2006-09-21 2010-05-19 王建华 Power supply two-line system real-time bus communication method
CN206249301U (en) * 2016-11-03 2017-06-13 成都声立德克技术有限公司 A kind of short distance UART bus communication structures
US20210385169A1 (en) * 2017-02-12 2021-12-09 Mellanox Technologies Ltd. Communication apparatus generating and eliminating redundant data packets
EP3759872A1 (en) * 2018-03-02 2021-01-06 Elmos Semiconductor SE Method and apparatus for actuating electrical and/or electronic components of a motor vehicle module
US11323548B2 (en) * 2019-01-20 2022-05-03 Arilou Information Security Technologies Ltd. System and method for data compression based on data position in frames structure
US11791938B2 (en) * 2019-09-26 2023-10-17 Nvidia Corporation Parity check decoding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6385210B1 (en) * 1998-04-17 2002-05-07 Ford Global Technologies, Inc. Method for detecting and resolving data corruption in a UART based communication network
CN106453383A (en) * 2016-11-07 2017-02-22 深圳拓邦股份有限公司 UART (universal asynchronous receiver/transmitter)-based master-slave multi-processor communication system and method
CN109284248A (en) * 2018-08-23 2019-01-29 深圳柴火创客教育服务有限公司 UART bus communication method, equipment and its functional module using UART bus communication
CN113792003A (en) * 2021-09-24 2021-12-14 展讯通信(深圳)有限公司 Single bus communication unit, system and method
CN114301732A (en) * 2022-03-08 2022-04-08 深圳市驰普科达科技有限公司 Circuit for realizing bus communication, bus communication system and power supply energy storage device

Also Published As

Publication number Publication date
CN114301732B (en) 2022-06-10
CN114301732A (en) 2022-04-08

Similar Documents

Publication Publication Date Title
WO2023168965A1 (en) Circuit for realizing bus communication, bus communication system, and power source energy storage device
US6643595B2 (en) System and method for detecting a device requiring power
US4597082A (en) Transceiver for multi-drop local area networks
US7522626B2 (en) Communications system and method
JP2752487B2 (en) Network Interface
JPH029493B2 (en)
JPS6360649A (en) Communication interface circuit
CN204314873U (en) A kind of I2C buffer circuit and I2C bus system
CN114168514A (en) Communication isolation circuit and device
TW201840170A (en) Internet telephone device, external connection card and communication method therefor
JP3161016B2 (en) Information transmission equipment
JPH06224976A (en) Interface conversion circuit for half duplex serial transmission
CN111625491A (en) Multi-machine serial communication device and method
US7184484B1 (en) Method and apparatus for serial data communication
TWI769840B (en) Rs-485 circuit and communication system
CN216527159U (en) Communication isolation circuit and device
CN114070666B (en) Bus communication interface circuit and communication method for enhancing bus communication effect
CN112579490A (en) Programmable electronic building block connecting bus
CN114200867A (en) Self-recognition communication correction device, working method and computer equipment
JP2004517564A (en) Device for connecting devices in telephone line
TW202246972A (en) Rs-485 circuit and communication system
KR100519285B1 (en) Apparatus and method for delaying bus reset
JPH0787105A (en) Data transmission equipment
JPS6175415A (en) Interface device
JPH0591147A (en) Terminal equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22930588

Country of ref document: EP

Kind code of ref document: A1