CN113792003A - Single bus communication unit, system and method - Google Patents

Single bus communication unit, system and method Download PDF

Info

Publication number
CN113792003A
CN113792003A CN202111122351.6A CN202111122351A CN113792003A CN 113792003 A CN113792003 A CN 113792003A CN 202111122351 A CN202111122351 A CN 202111122351A CN 113792003 A CN113792003 A CN 113792003A
Authority
CN
China
Prior art keywords
bus
bus communication
data
data frame
communication
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111122351.6A
Other languages
Chinese (zh)
Inventor
聂郁富
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shenzhen Co ltd
Original Assignee
Spreadtrum Communications Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shenzhen Co ltd filed Critical Spreadtrum Communications Shenzhen Co ltd
Priority to CN202111122351.6A priority Critical patent/CN113792003A/en
Publication of CN113792003A publication Critical patent/CN113792003A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter

Abstract

A single bus communication unit, system and method, the system comprising: at least two single-bus communication units, each of which is assigned a unique device ID, the reference grounds of all the single-bus communication units are connected, and the baud rates of all the single-bus communication units are the same; the single bus communication unit includes: the UART interface is characterized in that a transmitting port TX and a receiving port RX of the UART interface are connected to form a single-bus communication interface; the single-bus communication interface is used for connecting the communication bus to realize data interaction with other communication units on the communication bus. The scheme of the invention realizes the mutual communication among a plurality of devices by using one data bus.

Description

Single bus communication unit, system and method
Technical Field
The invention relates to the technical field of communication, in particular to a single-bus communication unit, a system and a method.
Background
In various electronic circuit systems, some data interaction is often required between various functional modules or between an MCU (micro controller Unit) and an MCU (micro control Unit). Currently, the commonly used data lines include an I2C (Inter-Integrated Circuit) bus, an SPI (Serial Peripheral Interface) bus, a UART (Universal Asynchronous Receiver/Transmitter) bus, and the like, which have respective advantages in some application occasions. The I2C bus is composed of two lines, namely, an SDA (Serial Data Acquisition, Serial Clock) line and an SCL (Serial Clock), and the circuit is simple, so that one master can theoretically connect up to 127 slave devices, and the bus is suitable for a case where a plurality of devices share one set of bus. The SPI is composed of CS/CLK/DIN/DOUT (slave enable signal/clock signal/master data input, slave data output/master data output, slave data input) four lines, and has advantages of high rate and bidirectional data transmission. The UART bus consists of two TX/RX (transmit/receive) wires, enabling full duplex communication. Whether SPI, I2C, or UART, these buses typically require at least 2 or more data lines and can only enable communication between two devices.
However, according to the design requirements of functions, the amount of data interacted among the products is small, the data interaction is not frequent, the data line is in an idle state for most of time, the requirement on real-time performance is not high, and resource waste is easily caused by using a special high-speed communication bus.
Disclosure of Invention
The embodiment of the invention provides a single bus communication unit, a single bus communication system and a single bus communication method, which can realize mutual communication among a plurality of devices by utilizing one data bus.
Therefore, the embodiment of the invention provides the following technical scheme:
the embodiment of the invention provides a single bus communication unit, which comprises: the UART interface is characterized in that a transmitting port TX and a receiving port RX of the UART interface are connected to serve as a single-bus communication interface; the single-bus communication interface is used for connecting a communication bus so as to realize data interaction with other communication units on the communication bus.
Optionally, a level shift circuit is further disposed between the single-bus communication interface and the communication bus, and the level shift circuit is configured to keep an input level and an output level of the single-bus communication interface consistent.
Optionally, the level shift circuit includes: and (4) resistance.
Optionally, the single-bus communication unit is any one of: communication equipment, communication module, chip.
An embodiment of the present invention further provides a single bus communication system, where the system includes: at least two single-bus communication units according to any one of claims 1 to 3, each single-bus communication unit being assigned a unique device ID, the reference grounds of all single-bus communication units being connected, and the baud rates of all single-bus communication units being the same.
Optionally, the number of single-bus communication units connected to the communication bus is less than or equal to 252.
Optionally, the device ID is one byte in length.
Optionally, the single bus communication unit comprises any one or more of: communication equipment, communication module, chip.
The embodiment of the invention also provides a single-bus communication method, which is used for realizing data interaction between single-bus communication units connected with a communication bus, wherein each single-bus communication unit is provided with a UART interface, a sending port TX and a receiving port RX of the UART interface are connected to serve as a single-bus communication interface to be connected with the communication bus, and the method comprises the following steps:
the method comprises the steps that a first single-bus communication unit receives a first data frame transmitted on a communication bus byte by byte, and determines whether a receiving equipment ID is the same as the self equipment ID or not after receiving the receiving equipment ID in the first data frame;
if the data are the same, continuing to receive the next byte of data until the byte of data is received and checked;
checking the first data frame to determine whether the first data frame is correct;
if the data frame is correct, sending a response frame to the sending equipment ID in the first data frame;
otherwise, sending an error frame to the ID of the sending equipment in the first data frame to inform the sending equipment of the first data frame to resend.
Optionally, the method further comprises: after determining that the ID of the receiving equipment in the first data frame is the same as the ID of the self equipment, the first single-bus communication unit starts timing; and if the checksum byte data is not received after the first delay, determining that the sending equipment of the first data frame is overtime, and discarding the received data.
Optionally, the method further comprises: the first single-bus communication unit sends a second data frame to the communication bus byte by byte, and starts timing and waiting after finishing sending and checking byte data; and if the response frame sent by the receiving equipment of the second data frame is not received after the maximum waiting time is reached, the second data frame is sent again until the maximum waiting time is reached again, and the second data frame is stopped being sent.
Optionally, the method further comprises: when the first single-bus communication unit sends the second data frame, if the start mark code of a third data frame sent by other single-bus communication units is received, the first single-bus communication unit stops sending the second data frame, and waits to continue sending the second data frame after delaying for a certain time.
Optionally, the delaying to continue sending the second data frame after a certain time includes: if no data is received in the time interval of reaching the maximum delay, continuing to send the second data frame after reaching the maximum delay; and if the ending mark code of the third data frame is received within the time interval of reaching the maximum delay, continuing to delay for waiting for the set time and then sending the second data frame.
Optionally, the method further comprises: the first single-bus communication unit determines the set time according to the own device ID.
An embodiment of the present invention further provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transitory storage medium, and on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the above method.
The embodiment of the present invention further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program that can be executed on the processor, and the processor executes the steps of the method when executing the computer program.
The single-bus communication unit and the system provided by the embodiment of the invention connect the sending port TX and the receiving port RX of each communication unit to the same communication bus based on the UART communication interfaces of the communication units, thereby simultaneously connecting a plurality of devices together and realizing the mutual communication among the devices. The device basically does not need to be additionally provided with additional devices, and is simple in design and low in cost.
According to the single-bus communication method provided by the embodiment of the invention, accurate sending and receiving of data among different communication units can be ensured by setting the corresponding communication data frame format.
Furthermore, by setting corresponding timeout control mechanisms at the data sending end and the data receiving end respectively, not only the effective sending of the data is ensured, but also the invalid waiting of the receiving end after the sending timeout of the data sending end is avoided.
Furthermore, aiming at the characteristics of single bus communication, a corresponding data transmission anti-collision mechanism is set, so that data collision on a communication bus is effectively avoided.
Drawings
FIG. 1 is a schematic structural diagram of a single-bus communication unit according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a single-bus communication system according to an embodiment of the present invention;
FIG. 3 is a flow chart of a single bus communication method according to an embodiment of the present invention;
fig. 4 is another flowchart of a single-bus communication method according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
The UART is a general purpose serial data bus used for asynchronous communications. The bus is in bidirectional communication, and full duplex transmission and reception can be realized. In UART communication, two UARTs communicate directly with each other. The transmitting UART converts parallel data from a control device such as a CPU into serial form and transmits it serially to the receiving UART, which then converts the serial data back to the parallel data of the receiving device. Only two wires are required to transmit data between two UARTs. Data flows from the Tx pin of the transmitting UART to the Rx pin of the receiving UART.
The UART sends data in an asynchronous manner, adding start and stop bits to the transmitted packets. These bits define the beginning and end of the packet so the receiving UART knows when to start reading the bits. When the receiving UART detects the start bit, it starts reading the input bits at a particular frequency called the baud rate. The baud rate is a measure of the data transmission speed, expressed in bits per second (bps). Data transmitted by the UART is encapsulated into data packets. Each data packet mainly comprises: 1 start bit, 5 to 9 data bits (depending on UART), optional parity bits and 1 or 2 stop bits.
When the UART data transmission line is not transmitting data, it is usually held at a high voltage level. To begin a data transmission, the transmitting UART pulls the transmission line from high to low for one clock cycle. When the receiving UART detects a high-to-low transition, it begins reading bits in the data frame at the baud rate.
The UART uses two data lines and can realize data transmission between devices without a clock signal, but does not support a system structure of a plurality of slaves or a plurality of masters.
Therefore, embodiments of the present invention provide a single bus communication unit, a system, and a method, which can utilize one data bus to implement mutual communication among multiple devices.
Fig. 1 is a schematic structural diagram of a single-bus communication unit according to an embodiment of the present invention.
The single bus communication unit provided by the embodiment of the invention comprises: and the transmitting port TX and the receiving port RX of the UART interface are connected to form a single-bus communication interface, and the single-bus communication interface is used for connecting a communication bus so as to realize data interaction with other communication units on the communication bus.
It should be noted that the single-bus communication unit provided in the embodiment of the present invention may specifically be, but is not limited to, any of the following: communication devices, communication modules, chips, etc.
Further, a level conversion circuit can be arranged between the single-bus communication interface and the communication bus, and the level conversion circuit is used for keeping the input level and the output level of the single-bus communication interface consistent.
Connecting a plurality of the above single-bus communication units to the same communication bus can form a single-bus communication system, as shown in fig. 2, which can conveniently implement communication between different communication units.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a single-bus communication system according to an embodiment of the present invention.
The single-bus communication system 20 comprises at least two of the above-mentioned single-bus communication units, of which N (N >2) are shown in fig. 2. In this system, each single-bus communication unit is assigned a unique device ID, and the reference grounds of all the single-bus communication units are connected.
In addition, considering that the operating voltages of different single-bus communication units may be different, which may cause the input and output levels of the TX/RX ports to be inconsistent, if the level difference between different communication units is too large, a level shift circuit needs to be added to perform level shift before being connected to the communication bus, so as to prevent the communication units on the bus from being damaged. Fig. 2 shows a simple level shift circuit, which uses a resistor connected in series between the single bus communication interface and the communication bus to ensure the consistency of the input and output levels of the TX/RX interfaces. Of course, in consideration of the difference between different communication units, the level shift circuit of each communication unit may have other structural forms, and the level shift circuits of different communication units may be the same or different, and the embodiment of the present invention is not limited thereto.
In addition, because single-bus multi-machine communication is adopted, in order to ensure that different communication units on the communication bus correctly receive data transmitted on the communication bus and avoid data collision, the baud rates of all the single-bus communication units connected to the communication bus are the same.
It should be noted that, in a specific application, each communication unit connected to the communication bus may be of the same type, or may be of a plurality of different types, and the embodiment of the present invention is not limited thereto. The number of devices accessible on the bus is determined by the number of device IDs definable by a 1-byte (8-bit) space, and theoretically 256 are supported (device IDs are from 0x00 to 0xFF), and in order to distinguish the device IDs from the start flag code (1 byte) and the end flag code (1 byte), and bytes 0x00 and 0xFF used as special receiver IDs, the number of accessible devices is 252, and of course, if the special receiver ID does not need to be set, or if only one special receiver ID is set, such as 0x00 or 0xFF, the number of accessible device data is 254 or 253. Each communication unit is connected to the communication bus and then keeps a monitoring state, and the RX port receives data transmitted on the bus according to an appointed baud rate.
The communication unit in the single-bus communication system provided by the embodiment of the invention adopts a half-duplex communication mode. The single-bus communication system can realize the mutual communication among a plurality of different communication units by utilizing one communication bus, effectively saves bus resources and can realize the intercommunication of a plurality of machines. Furthermore, the data can be sent in groups, and various different applications can be conveniently realized in the same system.
In the single bus communication system, data frames transmitted and received by the communication unit are transmitted in units of bytes. Each data frame has a plurality of bytes, and the format of the data frame is defined as follows:
Figure BDA0003277414830000061
the meaning of each field in the data frame is as follows:
1. start marker code: 0xBE, length: 1 byte;
2. end flag code: 0xED, length: 1 byte;
3. receiving the device ID: a receiving device ID of the data frame, 0x00 to 0xFF, where 0xED (start flag code) and 0xED (end flag code) cannot be used as the receiving device ID; further, it is also possible to use 0x00 and/or 0Xff as the special device ID, which indicates that the receiver is all other devices on the bus except the sending device, and data broadcasting can be implemented; length: 1 byte;
4. transmitting device ID: a transmitting device ID of the data frame, 0x00 to 0xFF, of which 0xED (start flag code), 0xED (end flag code), further, 0x00 and/or 0xFF cannot be used as the transmitting device ID; length: 1 byte;
5. data type ID: information types of communication data frames are defined, and communication data frames of 256 information types can be defined by 0x00 to 0xFF, for example, response frames: 0xAC (customizable) for the receiving device to reply that the sending device has correctly received the data; error frame: 0xEE (can be customized) is used for replying that the data received by the sending equipment has errors and needs to be retransmitted or other processing flows are carried out by the receiving equipment; length: 1 byte;
6. data length: the number of bytes of the transmitted data is 255(0xFF) at most, when the data length is 0, namely no data exists, the data length is directly followed by an end marker (0 xED); length: 1 byte;
7. data: data content transmitted, length: n bytes defined by the data length;
8. and checking: and the checksum value is 0xFF- (start flag + receiver ID + transmitter ID + data type ID + data length + data (N bytes) + end flag).
Correspondingly, the receiving device performs byte addition operation on all data of the received data frame, and the operation result is 0XFF, which indicates that the received data is correct, that is:
start tag + receiving device ID + sending device ID + data type ID + data length + data (N bytes) + end tag + checksum check 0xFF (1)
Based on the single-bus communication system, the embodiment of the present invention further provides a corresponding single-bus communication method, as shown in fig. 3, which is a flowchart of the method.
The embodiment shown in fig. 3 takes the example of a device on a communication bus receiving a data frame, and includes the following steps:
step 300, the first equipment keeps a monitoring state after being connected with the communication bus;
step 301, a first device RX port receives a first data frame transmitted on a communication bus byte by byte, and receives a receiving device ID in the first data frame;
step 302, determining that the ID of the receiving equipment is the same as the ID of the self equipment, and continuously receiving the next byte data until the byte data is received and checked;
step 303, checking the first data frame to determine whether the first data frame is correct; if so, go to step 304; otherwise, go to step 305;
the checking method has been explained in the foregoing, that is, all the received data are subjected to addition operation, and if the calculation result is "0 xFF", the received data are confirmed to be correct, otherwise, the received data are confirmed to be incorrect;
step 304, sending a response frame ACK to the sending equipment ID in the first data frame through the TX port to complete the communication process;
step 305, an ERROR frame ERROR is sent to the sending device ID in the first data frame through the TX port to inform the sending device of the first data frame to resend.
It should be noted that, in the above step 302, if the first device determines that the receiving device ID is different from the self device ID, the received data may be discarded.
Further, in order to prevent the transmitting device from transmitting data over time, unnecessary waiting is avoided. In step 302, after determining that the receiving device ID is the same as the self device ID, the first device starts timing, and if the sum check byte data is not received after the first delay, it determines that the sending device of the first data frame is overtime, and discards the received data.
The first delay time is as follows: tdelay _ max(s) × (255+5) × 8/baud rate (2)
Fig. 4 is another flowchart of a single-bus communication method according to an embodiment of the present invention.
The embodiment shown in fig. 4 takes the example that the device on the communication bus sends a data frame, and includes the following steps:
step 401, the first device sends the second data frame to the communication bus byte by byte, and starts timing and waiting after sending and checking byte data;
step 402, determining whether a maximum waiting time is reached; if so, go to step 403; otherwise, continuing to wait;
the maximum wait time may be set as: twait _ max(s) 3 × 8/baud rate (3)
Step 403, judging whether a response frame sent by the receiving device of the second data frame is received; if so, go to step 405; otherwise, go to step 404;
step 404, determining whether the second data frame has been retransmitted; if so, go to step 405; otherwise, returning to step 401, and resending the second data frame;
step 405, ending the communication process.
And if the response frame sent by the receiving end of the second data frame is not received after the second delay is reached, the second data frame is sent again, and the sending of the second data frame is stopped until a third delay is reached or the second data frame is sent again for a set number of times.
Because a plurality of devices share the same communication bus, a data collision prevention mechanism can be further arranged to avoid collision of data sent by different devices on the bus, and each device on the communication bus sends data based on the mechanism.
The mechanism for preventing data collision mainly comprises the following points:
1) after receiving the data frame sent by the sending equipment, the receiving equipment needs to respond to the data frame immediately and cannot delay the response;
2) when a device on the communication bus sends out a start marker code (0xBE), other devices cannot send any data until they receive an end marker code (0 xED);
3) after receiving the 'end mark code' (0xED), the equipment which has the requirement of sending data sends data after a certain time delay, and the time delay waiting set time Tdelay _ send is linearly related to the ID of the sending equipment, so that the time delay of each equipment on the bus is different, and the data collision is avoided;
the set time is as follows: tdelay _ send(s) ═ Twait _ max + (8+ transmission device ID)/baud rate, where Twait _ max is the above maximum waiting time, that is, Tdelay _ send(s) ═ 32+ transmission device ID)/baud rate;
4) if the maximum delay is passed, if no data is sent on the bus in the period, all the devices do not perform delay timing any more, and the data can be sent randomly; that is, for a device with a data transmission requirement, under the condition that no data is received, the time delay timing is not performed any more, and the data can be continuously transmitted;
the maximum delay is: tdelay _ send _ max(s) ═ 32+ 255/baud rate (4)
It should be noted that, after any device on the communication bus starts to transmit data, other devices need to follow the data collision prevention mechanism 1) to 4) above.
In addition, if the data received by the receiving device is not in accordance with the expectation due to the data collision, that is, the verification fails, the subsequent processing mode may be determined according to the type of the problem, for example: discard the data, or notify the sending device to resend the data, etc.
According to the single-bus communication method provided by the embodiment of the invention, accurate sending and receiving of data among different communication units can be ensured by setting the corresponding communication data frame format. Furthermore, by setting corresponding timeout control mechanisms at the data sending end and the data receiving end respectively, not only the effective sending of the data is ensured, but also the invalid waiting of the receiving end after the sending timeout of the data sending end is avoided. Furthermore, aiming at the characteristics of single bus communication, a corresponding data transmission anti-collision mechanism is set, so that data collision on a communication bus is effectively avoided.
It should be noted that, the devices mentioned in the embodiments shown in fig. 3 and fig. 4 may specifically be communication devices, communication units, chips, and the like, and the embodiments of the present invention are not limited thereto.
In a specific implementation, the adaptive delay-and-spread unit may correspond to a Chip in a network device, such as a System-On-a-Chip (SoC), a baseband Chip, a Chip module, and the like.
In a specific implementation, each module/unit included in each apparatus and product described in the foregoing embodiments may be a software module/unit, may also be a hardware module/unit, or may also be a part of a software module/unit and a part of a hardware module/unit.
For example, for each device or product applied to or integrated into a chip, each module/unit included in the device or product may be implemented by hardware such as a circuit, or at least a part of the module/unit may be implemented by a software program running on a processor integrated within the chip, and the rest (if any) part of the module/unit may be implemented by hardware such as a circuit; for each device or product applied to or integrated with the chip module, each module/unit included in the device or product may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components of the chip module, or at least some of the modules/units may be implemented by using a software program running on a processor integrated within the chip module, and the rest (if any) of the modules/units may be implemented by using hardware such as a circuit; for each device and product applied to or integrated in the terminal, each module/unit included in the device and product may be implemented by using hardware such as a circuit, and different modules/units may be located in the same component (e.g., a chip, a circuit module, etc.) or different components in the terminal, or at least part of the modules/units may be implemented by using a software program running on a processor integrated in the terminal, and the rest (if any) part of the modules/units may be implemented by using hardware such as a circuit.
An embodiment of the present invention further provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transitory storage medium, and a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the method provided in the corresponding embodiment of fig. 3 or fig. 4.
The embodiment of the present invention further provides another single-bus communication apparatus, which includes a memory and a processor, where the memory stores a computer program that can be executed on the processor, and the processor executes the steps of the method provided in the embodiment corresponding to fig. 3 or fig. 4 when executing the computer program.
The embodiment of the present invention further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program that can be executed on the processor, and the processor executes the steps of the method provided in the embodiment corresponding to fig. 3 or fig. 4 when executing the computer program.
In the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a and b, a and c, b and c, or a, b and c, wherein each of a, b, c may itself be an element or a set comprising one or more elements.
In the present application embodiments, "exemplary," "in some embodiments," "in another embodiment," and the like are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, the term using examples is intended to present concepts in a concrete fashion.
It should be noted that the terms "first," "second," and the like in the embodiments of the present application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or order. The terms equal to or greater than or equal to in the embodiments of the present application may be used with greater than or equal to, and are applicable to the technical solutions adopted when greater than or equal to, and may also be used with less than or equal to, and are applicable to the technical solutions adopted when less than or equal to, it should be noted that when equal to or greater than or equal to, it is not used with less than; when the ratio is equal to or less than the combined ratio, the ratio is not greater than the combined ratio.
In the embodiments provided in the present invention, it should be understood that the disclosed method, apparatus and system can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative; for example, the division of the unit is only a logic function division, and there may be another division manner in actual implementation; for example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (16)

1. A single bus communication unit, comprising: the UART interface is characterized in that a transmitting port TX and a receiving port RX of the UART interface are connected to serve as a single-bus communication interface; the single-bus communication interface is used for connecting a communication bus so as to realize data interaction with other communication units on the communication bus.
2. The single-bus communication unit according to claim 1, wherein a level shift circuit is further provided between the single-bus communication interface and the communication bus, and the level shift circuit is configured to keep an input level and an output level of the single-bus communication interface consistent.
3. The single-bus communication unit of claim 2, wherein the level shift circuit comprises: and (4) resistance.
4. A communication unit according to any of claims 1 to 3, wherein the single bus communication unit is any of: communication equipment, communication module, chip.
5. A single bus communication system, the system comprising: at least two single-bus communication units according to any one of claims 1 to 3, each single-bus communication unit being assigned a unique device ID, the reference grounds of all single-bus communication units being connected, and the baud rates of all single-bus communication units being the same.
6. The single-bus communication system according to claim 5, wherein the number of the single-bus communication units connected to the communication bus is less than or equal to 252.
7. The single bus communication system as claimed in claim 5, wherein said device ID is one byte in length.
8. The single-bus communication system according to any one of claims 5 to 7, wherein the single-bus communication unit comprises any one or more of: communication equipment, communication module, chip.
9. A single-bus communication method for realizing data exchange between single-bus communication units connected to a communication bus, the single-bus communication units having UART interfaces whose transmission ports TX and reception ports RX are connected as a single-bus communication interface to the communication bus, the method comprising:
the method comprises the steps that a first single-bus communication unit receives a first data frame transmitted on a communication bus byte by byte, and determines whether a receiving equipment ID is the same as the self equipment ID or not after receiving the receiving equipment ID in the first data frame;
if the data are the same, continuing to receive the next byte of data until the byte of data is received and checked;
checking the first data frame to determine whether the first data frame is correct;
if the data frame is correct, sending a response frame to the sending equipment ID in the first data frame;
otherwise, sending an error frame to the ID of the sending equipment in the first data frame to inform the sending equipment of the first data frame to resend.
10. The single-bus communication method according to claim 9, further comprising:
after determining that the ID of the receiving equipment in the first data frame is the same as the ID of the self equipment, the first single-bus communication unit starts timing;
and if the checksum byte data is not received after the first delay, determining that the sending equipment of the first data frame is overtime, and discarding the received data.
11. The single-bus communication method according to claim 9, further comprising:
the first single-bus communication unit sends a second data frame to the communication bus byte by byte, and starts timing and waiting after finishing sending and checking byte data;
and if the response frame sent by the receiving equipment of the second data frame is not received after the maximum waiting time is reached, the second data frame is sent again until the maximum waiting time is reached again, and the second data frame is stopped being sent.
12. The single-bus communication method according to claim 11, further comprising:
when the first single-bus communication unit sends the second data frame, if the start mark code of a third data frame sent by other single-bus communication units is received, the first single-bus communication unit stops sending the second data frame, and waits to continue sending the second data frame after delaying for a certain time.
13. The single-bus communication method according to claim 12, wherein the delaying to continue transmitting the second data frame after a certain time comprises:
if no data is received in the time interval of reaching the maximum delay, continuing to send the second data frame after reaching the maximum delay;
and if the ending mark code of the third data frame is received within the time interval of reaching the maximum delay, continuing to delay for waiting for the set time and then sending the second data frame.
14. The single-bus communication method according to claim 13, further comprising:
the first single-bus communication unit determines the set time according to the own device ID.
15. A computer-readable storage medium, being a non-volatile storage medium or a non-transitory storage medium, having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the steps of the method according to any of the claims 9 to 14.
16. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program being executable on the processor, wherein the processor, when executing the computer program, performs the steps of the method of any of claims 9 to 14.
CN202111122351.6A 2021-09-24 2021-09-24 Single bus communication unit, system and method Pending CN113792003A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111122351.6A CN113792003A (en) 2021-09-24 2021-09-24 Single bus communication unit, system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111122351.6A CN113792003A (en) 2021-09-24 2021-09-24 Single bus communication unit, system and method

Publications (1)

Publication Number Publication Date
CN113792003A true CN113792003A (en) 2021-12-14

Family

ID=78879345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111122351.6A Pending CN113792003A (en) 2021-09-24 2021-09-24 Single bus communication unit, system and method

Country Status (1)

Country Link
CN (1) CN113792003A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301732A (en) * 2022-03-08 2022-04-08 深圳市驰普科达科技有限公司 Circuit for realizing bus communication, bus communication system and power supply energy storage device
CN116578521A (en) * 2023-07-14 2023-08-11 深圳中安辰鸿技术有限公司 Single-bus communication method, device, system and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671141A (en) * 2005-02-28 2005-09-21 邹润民 Multi-host communication system
CN106453383A (en) * 2016-11-07 2017-02-22 深圳拓邦股份有限公司 UART (universal asynchronous receiver/transmitter)-based master-slave multi-processor communication system and method
CN107104866A (en) * 2017-04-25 2017-08-29 无锡睿思凯科技股份有限公司 A kind of intelligent data bus protocol and system
CN112612739A (en) * 2020-12-17 2021-04-06 深圳慧能泰半导体科技有限公司 Digital communication bus of multi-module system and control method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1671141A (en) * 2005-02-28 2005-09-21 邹润民 Multi-host communication system
CN106453383A (en) * 2016-11-07 2017-02-22 深圳拓邦股份有限公司 UART (universal asynchronous receiver/transmitter)-based master-slave multi-processor communication system and method
CN107104866A (en) * 2017-04-25 2017-08-29 无锡睿思凯科技股份有限公司 A kind of intelligent data bus protocol and system
CN112612739A (en) * 2020-12-17 2021-04-06 深圳慧能泰半导体科技有限公司 Digital communication bus of multi-module system and control method thereof

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301732A (en) * 2022-03-08 2022-04-08 深圳市驰普科达科技有限公司 Circuit for realizing bus communication, bus communication system and power supply energy storage device
WO2023168965A1 (en) * 2022-03-08 2023-09-14 深圳市驰普科达科技有限公司 Circuit for realizing bus communication, bus communication system, and power source energy storage device
CN116578521A (en) * 2023-07-14 2023-08-11 深圳中安辰鸿技术有限公司 Single-bus communication method, device, system and equipment

Similar Documents

Publication Publication Date Title
CN106453383B (en) UART-based master-slave multi-machine communication system and method
US8694710B2 (en) Conversion of a two-wire bus into a single-wire bus
Peña et al. Uart: A hardware communication protocol understanding universal asynchronous receiver/transmitter
CN107832250B (en) Master-slave communication time sequence method based on SPI
JP6878300B2 (en) Improved virtual GPIO with multi-mode modulation
CN113792003A (en) Single bus communication unit, system and method
US20110087914A1 (en) I2c buffer clock delay detection method
CN103460201A (en) Serial interface
CN108234267B (en) Communication system based on M-LVDS real-time multi-master high-speed bus
US9524265B2 (en) Providing a serial protocol for a bidirectional serial interconnect
WO2022021869A1 (en) Single-level single-line full-duplex bus communication method and system
CN108011692A (en) A kind of data communications method for microcontroller
CN106649171B (en) Single-bus full-duplex data communication method and system
CN102929830A (en) Software simulation rapid communication protocol
CN109284248A (en) UART bus communication method, equipment and its functional module using UART bus communication
CN112269749A (en) I2C communication system
CN109062850B (en) Data sending and receiving method of single chip microcomputer
CN114500159B (en) Wired communication method and device of central range hood system and electronic equipment
US20110087812A1 (en) Multi-master bi-directional i2c bus buffer
CN209860929U (en) Communication bus structure
CN111966623A (en) Method for real-time full-duplex reliable communication between MCU and multiple FPGAs by using SPI
US4728754A (en) Inter-bus system
CN111597017A (en) Synchronous control method for double microprocessors
CN116684389B (en) Address automatic allocation method and host, slave and communication equipment with same
CN217467655U (en) Single IO mouth two-way communication structure of singlechip

Legal Events

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