A method for a multi-channel I2C master device to access each node in a multi-node system

By recording and converting the information of the I2C master device and node in a multi-node system, the chaos caused by multiple I2C master devices accessing the same node simultaneously is solved, and the accuracy and reliability of I2C transmission are achieved.

CN119210658BActive Publication Date: 2025-06-24上海芯炽科技集团有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411341799.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-06-24
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

In a multi-node system, multiple I2C master devices may access the same node at the same time, resulting in confusion of I2C instructions, resulting in abnormal I2C transmission errors, and it is impossible to determine which node did not reply or reply to NAK during I2C broadcast.

Method used

By recording the information of the I2C master device and the access node, it is converted into a target address according to the matching relationship, stored in an instruction packet, and transmitted to the remote node through the transmission system. The remote node parses the information in the instruction package, decides whether to transmit it to the next node or access itself, and contains the I2C master device information when replying.

Benefits of technology

It effectively avoids the chaos when multiple I2C master devices are accessed simultaneously, ensures the accuracy and reliability of I2C transmission, and can correctly identify reply and NAK.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119210658B_ABST
    Figure CN119210658B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for a multi-channel I2C master device to access each node in a multi-node system, belonging to the field of communication. When accessing a remote node, the information of the I2C master device and the accessed node is recorded, converted into a corresponding target address according to the matching relationship, stored in the instruction packet, and transmitted to the remote end through the transmission system; after the remote node receives the instruction packet, it parses the I2C master device information and the target node information from the instruction packet, and decides whether to transmit to the next node or access itself according to the target node information; if an I2C instruction needs to be replied, the recorded I2C master device information group is included in the replied instruction packet; when accessing a proximal node, a reply is made to the corresponding I2C master device according to the I2C master device information in the reply packet. The present invention is applicable to the application scenario of I2C broadcast. By means of the master device information and the node address information carried in the transmission packet, the node that does not reply to the transmission packet or replies with a NAK transmission packet can be quickly located, facilitating the location of the problem node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and particularly to a method for a multi-channel I2C master device to access each node in a multi-node system. Background Art

[0002] In a multi-node system, multiple I2C master devices are usually connected. In practical applications, there are multiple I2C master devices that jointly access each slave device existing in the multi-node system.

[0003] These I2C master devices are independent of each other, and there is a situation where they simultaneously access the same slave device under the same node. Therefore, there may be a problem of I2C instruction confusion, resulting in abnormal errors in I2C transmission. Similarly, during I2C broadcasting, it is impossible to know which node did not reply, or the replied NAK (negative acknowledgment). Summary of the Invention

[0004] The purpose of the present invention is to provide a method for a multi-channel I2C master device to access each node in a multi-node system, so as to solve the problems in the background art.

[0005] To solve the above technical problems, the present invention provides a method for a multi-channel I2C master device to access each node in a multi-node system, including:

[0006] When accessing a remote node, record the I2C master device and the accessed node information, convert it into a corresponding target address according to the matching relationship, store it in the instruction packet, and transmit it to the remote end through the transmission system; after receiving the instruction packet, the remote node parses out the I2C master device information and the target node information from the instruction packet, and decides whether to transmit to the next node or access itself according to the target node information; if an I2C instruction needs to be replied, group the recorded I2C master device information in the replied instruction packet;

[0007] When accessing a proximal node, reply to the corresponding I2C master device according to the I2C master device information in the reply packet.

[0008] In an embodiment, the multi-node system includes I2C master device 0 to I2C master device N, node 0 to node N, where I2C master device 0 and I2C master device 1 are connected to node 0 through the I2C bus, and node 0 is connected to node 1 to node N through a cable following a transmission protocol; among them, node 1 to node N are externally connected with multiple similar systems through the I2C bus to form a cascaded system.

[0009] In one embodiment, when the I2C master device 0 and the I2C master device N access node 0 simultaneously, since it is a proximal access, node 0 preferentially completes the I2C transmission with the I2C master device 0 according to the priority, and simultaneously pulls down the clock line for interacting with the I2C master device N; after the transmission with the I2C master device 0 is completed, the clock line between node 0 and the I2C master device N is released, and the transmission with the I2C master device N begins.

[0010] In one embodiment, multiple I2C master devices respectively access proximal and distal nodes. Since they are respectively accessing different proximal and distal nodes, the two are independent of each other and do not interfere with each other, and no arbitration is required.

[0011] In one embodiment, multiple I2C master devices respectively access node 1 and node N under different distal cables. After receiving the access requests from the I2C master device 0 and the I2C master device N, node 0 respectively records the I2C master device information and the access node information, and translates them into the target address according to the rules. Thus, when node 0 transmits the I2C instruction packets to the distal nodes 1 and N respectively, it knows the source and target of this transmission.

[0012] In one embodiment, when multiple I2C master devices respectively access node 1 under the same distal cable, node 0 preferentially completes the I2C transmission with the I2C master device 0 according to the priority, pulls down the clock line for interacting with the I2C master device N, and simultaneously records the I2C master device information 0 and the access node information 1, and translates them into the target address in the transmission packet; the target address used by node 1 when replying to this I2C transmission should include the received I2C master device information and its own node information, so that node 0 can determine the correct I2C master device to reply according to the received target address information; after the transmission with the I2C master device 0 is completed, the clock line between node 0 and the I2C master device N will be released, and the transmission with the I2C master device N begins. Thus, the I2C master device 0 and the I2C master device N realize the access to node 1.

[0013] In one embodiment, if a timeout occurs when the I2C master device 0 accesses node 1, this I2C transmission is regarded as ended, and the transmission with the I2C master device N will start.

[0014] A method for each node in a multi-I2C master device multi-node system provided by the present invention needs to translate the master device information and the node address information into the target address in the transmission packet according to certain rules, thereby tagging the I2C transmission to distinguish the accesses of multiple I2C master devices, and avoiding the chaos caused by multiple I2C master devices accessing simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a schematic structural diagram of a multi-I2C master device multi-node system.

[0016] Figure 2 It is a schematic diagram of the structure of a multi-I2C master multi-node cascaded system.

[0017] Figure 3 It is a schematic diagram of the structure where multiple I2C masters access the same remote node simultaneously. Specific implementation manners

[0018] The following further elaborates in detail on a method for each node in a multi-channel I2C master accessing multi-node system proposed by the present invention in combination with the accompanying drawings and specific embodiments. According to the following description, the advantages and features of the present invention will be clearer. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise scales, only for conveniently and clearly assisting in explaining the purpose of the embodiments of the present invention.

[0019] The present invention proposes a method for multiple I2C masters to access each node in a multi-node system, which supports multiple I2C masters to access each node simultaneously. Whether it is the same sub-device of the same node, or different sub-devices of the same node, or sub-devices of different nodes, the I2C instructions can be correctly transmitted to the corresponding slave devices.

[0020] In the multi-node system mentioned in the present invention, in addition to the transmission system composed of a deserialiser and multiple serialisers, a cascaded system composed of multiple corresponding transmission systems should be included.

[0021] For the method of multiple I2C masters accessing each node in the multi-node system proposed by the present invention, when accessing a remote node, the I2C master and the accessed node information will be recorded, and according to a certain matching relationship, it will be converted into the corresponding target address and stored in the instruction packet, and then transmitted to the remote end through the transmission system. After the remote I2C node receives the instruction packet, it parses the master device information and the target node information from the instruction packet, and decides whether to transmit to the next node or access itself according to the target node information. If an I2C instruction needs to be replied, the recorded I2C master device information group will be included in the replied instruction packet. The proximal I2C node replies to the corresponding I2C master according to the I2C master device information in the reply packet.

[0022] Figure 1 It is a typical multi-node system of multiple I2C masters, including multiple I2C masters (I2C master 0 to I2C master N), and multiple node modules such as node 0 - N. Among them, I2C master 0 and I2C master 1 are connected to node 0 through the I2C bus, and node 0 and nodes 1 to N follow a certain transmission protocol and are connected by cables. Extensively, nodes 1 to N can be externally connected with multiple similar systems through the I2C bus to form a cascaded system, as Figure 2 shown.

[0023] The following takes Figure 1 as an example to introduce the present invention in detail. When multiple I2C master devices access a multi-node system, it can be divided into 5 types, which are respectively:

[0024] 1) I2C master device 0 and I2C master device N access node 0 simultaneously. Since it is a proximal access, node 0 will, according to the priority, first complete the I2C transmission with I2C master device 0, and at the same time pull down the clock line (SCL) for interacting with I2C master device N. When the transmission with I2C master device 0 is completed, the clock line between node 0 and I2C master device N will be released, and the transmission with I2C master device N will start.

[0025] 2) Multiple I2C master devices access proximal and distal nodes respectively. Taking I2C master device 0 accessing node 0 and master device 1 accessing node 1 as an example, since they are accessing different proximal and distal nodes respectively, the two are independent and do not interfere with each other, so arbitration is not required.

[0026] 3) Multiple I2C master devices access nodes under different distal cables respectively, such as accessing node 1 and node N respectively. After receiving the access requests from I2C master device 0 and I2C master device N, node 0 records the I2C master device information and the accessed node information respectively, and translates them into a target address according to certain rules. Thus, when node 0 transmits I2C instruction packets to distal nodes 1 and N respectively, it can know the source and target of this transmission. Taking the A-PHY transmission protocol as an example, for the target address field in the transmission packet, the following rules can be set: the high 4 bits record the I2C master device information, and the low 4 bits record the node information.

[0027] 4) Multiple I2C master devices access the same node under the same distal cable respectively, such as all accessing node 1. Figure 3 For the corresponding schematic diagram, node 0 will, according to the priority, first complete the I2C transmission with I2C master device 0, and pull down the clock line (SCL) for interacting with I2C master device N. At the same time, it records the I2C master device information 0 and the accessed node information 1, and translates them into the target address in the transmission packet. When node 1 replies to this I2C transmission, the target address used should include the received I2C master device information and its own node information, so that node 0 can determine the correct I2C master device to reply according to the received target address information. When the transmission with I2C master device 0 is completed, the clock line between node 0 and I2C master device N will be released, and the transmission with I2C master device N will start. Thus, I2C master devices 0 and N achieve the access to node 1.

[0028] Specifically, if a timeout occurs when I2C master device 0 accesses node 1, this I2C transmission is regarded as ended, and the transmission with I2C master device N will start.

[0029] 5) If I2C master device 0 broadcasts to nodes 1 to N, the node information should be the corresponding broadcast information. In the destination address field carried in the transmission packets replied by nodes 1 to N, the I2C master device information of this transmission and the node information of itself should be carried. Thus, node 0 will determine which node did not reply to the transmission packet and which node replied with a NAK transmission packet according to the number of received transmission packets and the corresponding destination addresses.

[0030] In the method for each node in the multi-channel I2C master device accessing multi-node system proposed by the present invention, the proximal node records a label for the I2C master device according to the transmission request sent by the I2C master device and the target node to be accessed, translates it into a destination address according to a certain rule, and writes the destination address into the transmission packet. Thus, the information carried in the transmission packet includes the I2C master device information and the target node information, and each I2C transmission can obtain a unique label.

[0031] When multiple I2C master devices access the same node, to avoid interference between multiple I2C transmissions and cause I2C transmission disorders. In addition to the above-mentioned labeling of I2C transmissions, it is also necessary to pull down the I2C clock line with a lower priority according to the priority, and release the I2C clock line with a lower priority after the I2C transmission with a higher priority is completed.

[0032] The above description is only a description of the preferred embodiments of the present invention, and does not limit the scope of the present invention in any way. Any changes and modifications made by those of ordinary skill in the art of the present invention according to the above disclosure are within the protection scope of the claims.

Claims

1. A method for multiple I2C master devices to access each node in a multi-node system, characterized in that: include: When accessing a remote node, the I2C master device and the node information to be accessed are recorded, converted into the corresponding target address according to the matching relationship, stored in the instruction packet, and transmitted to the remote end through the transmission system; after receiving the instruction packet, the remote node parses the I2C master device information and the target node information from the instruction packet, and decides whether to transmit to the next node or access itself according to the target node information; if the I2C instruction needs to be replied, the recorded I2C master device information group is included in the reply instruction packet; When accessing the proximal node, the corresponding I2C master device is replied according to the I2C master device information in the reply packet.

2. The method for multiple I2C master devices to access each node in a multi-node system as claimed in claim 1, characterized in that: The multi-node system includes I2C master device 0~I2C master device N, node 0~node N, wherein I2C master device 0 and I2C master device 1 are connected to node 0 through an I2C bus, and node 0 and node 1~node N are connected through cables following a transmission protocol; wherein node 1~node N are connected to multiple similar systems through the I2C bus to form a cascade system.

3. The method for multiple I2C master devices to access each node in a multi-node system as claimed in claim 2, characterized in that: When the I2C master device 0 and the I2C master device N access node 0 at the same time, due to proximal access, node 0 completes the I2C transmission with I2C master device 0 first according to the priority, and pulls down the clock line for interacting with I2C master device N at the same time; when the transmission with I2C master device 0 is completed, the clock line between node 0 and I2C master device N is released, and the transmission with I2C master device N is started.

4. The method for multiple I2C master devices to access each node in a multi-node system as claimed in claim 2, characterized in that: Multiple I2C master devices access the proximal and remote nodes respectively. Since the proximal and remote nodes accessed are different, the two are independent of each other and do not interfere with each other, and no arbitration is required.

5. The method for multiple I2C master devices to access each node in a multi-node system as claimed in claim 2, characterized in that: Multiple I2C master devices access node 1 and node N under different remote cables respectively. After receiving the access requests from I2C master device 0 and I2C master device N, node 0 records the I2C master device information and access node information respectively, and translates them into the target address according to the rules. In this way, when node 0 transmits I2C instruction packets to remote node 1 and node N respectively, it knows the source and target of the transmission.

6. The method for multiple I2C master devices to access each node in a multi-node system as claimed in claim 2, characterized in that: When multiple I2C master devices access node 1 under the same remote cable respectively, node 0 will complete the I2C transmission with I2C master device 0 first according to the priority, pull down the clock line interacting with I2C master device N, and record I2C master device information 0 and access node information 1 at the same time, and translate them into the target address in the transmission packet; the target address used by node 1 when replying to the I2C transmission should include the received I2C master device information and its own node information, so that node 0 can decide to reply to the correct I2C master device according to the received target address information; after the transmission with I2C master device 0 is completed, the clock line between node 0 and I2C master device N will be released, and the transmission with I2C master device N will be completed, so that I2C master device 0 and I2C master device N can achieve access to node 1.

7. The method for multiple I2C master devices to access each node in a multi-node system as claimed in claim 6, characterized in that: If a timeout occurs when I2C master 0 accesses node 1, the I2C transmission is considered to be completed and the transmission with I2C master N will begin.

Citation Information

Patent Citations

  • Multi-target machine parallel communication method based on redundancy

    CN106155637A