CN112069114A - I2C arbitration method and device - Google Patents

I2C arbitration method and device Download PDF

Info

Publication number
CN112069114A
CN112069114A CN202010926738.6A CN202010926738A CN112069114A CN 112069114 A CN112069114 A CN 112069114A CN 202010926738 A CN202010926738 A CN 202010926738A CN 112069114 A CN112069114 A CN 112069114A
Authority
CN
China
Prior art keywords
bus
signal
controller
control
arbitration
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
CN202010926738.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.)
Beijing Toyou Feiji Electronics Co ltd
Original Assignee
Beijing Toyou Feiji Electronics 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 Beijing Toyou Feiji Electronics Co ltd filed Critical Beijing Toyou Feiji Electronics Co ltd
Priority to CN202010926738.6A priority Critical patent/CN112069114A/en
Publication of CN112069114A publication Critical patent/CN112069114A/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/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bus Control (AREA)

Abstract

The invention provides an I2C arbitration method and device. The method comprises the following steps: sending an I2C bus control request; judging whether the I2C bus is in an idle state; if the I2C bus is idle, an busy identification signal is sent to another controller on the I2C bus. The I2C arbitration method and the device provided by the invention improve the system reliability through distributed arbitration on the premise of not increasing the number of backboard components.

Description

I2C arbitration method and device
Technical Field
The invention relates to the technical field of I2C bus interconnection, in particular to an I2C arbitration method and device.
Background
When a plurality of controllers are arranged in one device, the I2C buses are often interconnected, and then other devices are controlled, at this time, two main devices are arranged in the same I2C bus, double-main competition I2C control right inevitably occurs, the I2C bus communication efficiency is low, the problem of competition failure easily occurs, and the system is unstable.
To solve the above problem, an arbitration function in the I2C protocol stack may be used. However, the disadvantage of using the arbitration function is that the arbitration efficiency is low, and the problem of contention failure is easy to occur, thereby causing system instability.
An arbitration unit can also be independently arranged, the double controllers initiate the demand, the arbitration unit judges which controller sends the demand first, and the control right of the I2C is determined to belong to. This solution has the drawback that there is only one arbitration unit, and that this arbitration unit has to be placed on the backplane, increasing the number of backplane active devices and reducing the reliability of the backplane.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an I2C arbitration method and device, which can improve the system reliability through distributed arbitration on the premise of not increasing the number of backplane components.
In order to solve the technical problem, the invention provides an I2C arbitration method, which comprises the following steps: sending an I2C bus control request; judging whether the I2C bus is in an idle state; if the I2C bus is idle, an busy identification signal is sent to another controller on the I2C bus.
In some embodiments, the busy signal of the I2C bus is used to determine whether the I2C bus is idle.
In some embodiments, if the busy signal is high, the I2C bus is determined to be idle.
In some embodiments, the occupancy-identification signal comprises: get signal low.
In some embodiments, further comprising: if the I2C bus is not in idle state, judging whether the I2C bus control right belongs to the controller; if the I2C bus control right belongs to the controller, the state of the unoccupied identification signal sent to the other controller is changed to occupied.
In some embodiments, changing the state of an unoccupied-flag signal sent to another controller to occupied includes: the high get signal is pulled low.
In some embodiments, further comprising: judging whether the two controllers obtain control right or not by reading a get signal sent by the other controller; and if both controllers obtain the control right, releasing the control right.
In some embodiments, the determining whether both controllers are controlled by reading the get signal sent by the other controller comprises: and acquiring a get signal of the other controller, and judging whether the get signal is low level or not.
In some embodiments, releasing control if both controllers gain control comprises: if the get signal is low, a release signal is sent to the I2C bus.
In addition, the invention also provides an I2C arbitration device, which comprises: the CPU is used for sending an I2C bus control requirement; and the CPLD logic device is used for judging whether the I2C bus is in an idle state or not and sending an occupation identification signal to another controller on the I2C bus if the I2C bus is in the idle state.
After adopting such design, the invention has at least the following advantages:
under the condition of no participation of a back plate component, a completely symmetrical arbitration scheme is realized, and the system reliability is improved.
Drawings
The foregoing is only an overview of the technical solutions of the present invention, and in order to make the technical solutions of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and the detailed description.
FIG. 1 is a flow chart of an I2C arbitration method according to an embodiment of the present invention;
fig. 2 is a structural diagram of an I2C arbitration device according to an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
The main core of the invention comprises two parts, namely arbitration hardware and arbitration control logic.
Fig. 1 shows a flowchart of an I2C arbitration method provided by an embodiment of the present invention. In the execution of the I2C arbitration method shown in FIG. 1, participating in I2C arbitration includes two controllers simultaneously connected to the I2C bus. Hereinafter, these two controllers are referred to as an a controller and a B controller, respectively, and are referred to as an a control and a B control for short. Each controller includes a CPU and a CPLD. Referring to fig. 1, the I2C arbitration method includes the steps of:
1. the dual controllers are interconnected through a backboard, and a CPU and a CPLD logic device are arranged on the controllers.
2. After the control right request (request) of I2C is sent out by the control A or the control B, the control A or the control B CPLD checks whether the busy signal is low level (the low level indicates that the I2C bus is in a busy state, and the high level indicates an idle state), if the busy signal is high level, the control A or the control B CPLD pulls the GET (I2C control right indication) signal low, and the control A or the control B does not reach the I2C bus control right.
3. When the control right request (request) of I2C is sent by the control A or the control B, if the busy signal is low level, the control A or the control B CPLD judges that the control A or the control B CPLD obtains the control right, and the GET (I2C control right indication) and the busy signal which are sent to the opposite side are pulled down.
4. And reading the GET signal sent by the opposite side, if the GET signal is low level, judging that the double-control arbitration fails, releasing the control right, and re-extracting the request signal by the system.
5. If the level is high, the arbitration is judged to be successful, and a GET signal sent to the CPU is pulled down to obtain the control right.
Fig. 2 shows a structure of an I2C arbitration device according to an embodiment of the present invention. Referring to FIG. 2, to the left of the I2C bus is a controller, referred to as the A controller; to the right of the I2C bus is another controller, referred to as the B controller.
Each controller includes a respective CPU and CPLD. The CPU is used to send an I2C bus control request to the bus, as well as a release signal. The CPLD is used to determine if the I2C bus is idle and to send an occupancy identification signal to another controller on the I2C bus if the I2C bus is idle.
In some embodiments, the CPLD uses the busy signal from the I2C bus to determine whether the I2C bus is idle.
In some embodiments, if the busy signal is high, the I2C bus is determined to be idle.
In some embodiments, the occupancy-identification signal comprises: get signal low.
In some embodiments, further comprising: if the I2C bus is not in idle state, CPLD judges whether the I2C bus control right belongs to the controller; if I2C bus control is owned by the controller, the CPLD changes the state of the unoccupied-flag signal sent to the other controller to occupied.
In some embodiments, changing the state of an unoccupied-flag signal sent to another controller to occupied includes: the high get signal is pulled low.
In some embodiments, further comprising: the CPU judges whether the two controllers both obtain the control right or not by reading a get signal sent by the other controller; if both controllers get control, the CPU releases the control.
In some embodiments, the CPU determines whether both controllers are controlled by reading a get signal sent by the other controller, including: the CPU obtains a get signal of another controller and judges whether the get signal is low level.
In some embodiments, if both controllers gain control, the CPU releases control, including: if the get signal is low, the CPU sends a release signal to the I2C bus.
The I2C arbitration method and the device provided by the invention utilize two arbitration units respectively connected to the I2C bus to replace the original centralized arbitration logic, and realize a completely symmetrical arbitration scheme and improve the system reliability by reasonably designing the control logic operated in the distributed arbitration units.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the present invention in any way, and it will be apparent to those skilled in the art that the above description of the present invention can be applied to various modifications, equivalent variations or modifications without departing from the spirit and scope of the present invention.

Claims (10)

1. An I2C arbitration method, comprising:
sending an I2C bus control request;
judging whether the I2C bus is in an idle state;
if the I2C bus is idle, an busy identification signal is sent to another controller on the I2C bus.
2. The I2C arbitration method of claim 1, wherein the busy signal of the I2C bus is used to determine whether the I2C bus is idle.
3. The I2C arbitration method of claim 2, wherein if busy is high, I2C bus is determined to be idle.
4. The I2C arbitration method of claim 1, wherein the occupancy identification signal comprises: get signal low.
5. The I2C arbitration method of claim 1, further comprising:
if the I2C bus is not in idle state, judging whether the I2C bus control right belongs to the controller;
if the I2C bus control right belongs to the controller, the state of the occupation identification signal sent to another controller is changed to occupation.
6. The I2C arbitration method of claim 4 or 5, wherein changing the state of an unoccupied-flag signal sent to another controller to occupied comprises:
the high get signal is pulled low.
7. The I2C arbitration method of claim 4 or 5, further comprising:
judging whether the two controllers obtain control right or not by reading a get signal sent by the other controller;
and if both controllers obtain the control right, releasing the control right.
8. The I2C arbitration method of claim 7, wherein determining whether both controllers are controlled by reading a get signal sent by the other controller comprises:
and acquiring a get signal of the other controller, and judging whether the get signal is low level or not.
9. The I2C arbitration method of claim 7, wherein releasing control if both controllers gain control comprises:
if the get signal is low, a release signal is sent to the I2C bus.
10. An I2C arbitration device, comprising:
the CPU is used for sending an I2C bus control requirement;
and the CPLD logic device is used for judging whether the I2C bus is in an idle state or not and sending an occupation identification signal to another controller on the I2C bus if the I2C bus is in the idle state.
CN202010926738.6A 2020-09-07 2020-09-07 I2C arbitration method and device Pending CN112069114A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010926738.6A CN112069114A (en) 2020-09-07 2020-09-07 I2C arbitration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010926738.6A CN112069114A (en) 2020-09-07 2020-09-07 I2C arbitration method and device

Publications (1)

Publication Number Publication Date
CN112069114A true CN112069114A (en) 2020-12-11

Family

ID=73663174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010926738.6A Pending CN112069114A (en) 2020-09-07 2020-09-07 I2C arbitration method and device

Country Status (1)

Country Link
CN (1) CN112069114A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5872939A (en) * 1996-06-05 1999-02-16 Compaq Computer Corporation Bus arbitration
CN101667165A (en) * 2009-09-28 2010-03-10 中国电力科学研究院 Bus sharing method and device for distributed multi-master CPUs
CN101894088A (en) * 2010-07-21 2010-11-24 中兴通讯股份有限公司 Method and device for solving conflict of multiple hosts on I2C bus
CN102023953A (en) * 2009-09-17 2011-04-20 研祥智能科技股份有限公司 Control method of system having many inter-integrated circuit (I2C) buses
CN102298562A (en) * 2008-08-15 2011-12-28 华为技术有限公司 Method, device and system for interconnecting line and arbitration bus
CN103617138A (en) * 2013-12-16 2014-03-05 深圳市兴威帆电子技术有限公司 Multi-mainframe arbitration method and multi-mainframe communication system
CN107766267A (en) * 2017-10-12 2018-03-06 郑州云海信息技术有限公司 A kind of referee method and system of I2C buses

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5872939A (en) * 1996-06-05 1999-02-16 Compaq Computer Corporation Bus arbitration
CN102298562A (en) * 2008-08-15 2011-12-28 华为技术有限公司 Method, device and system for interconnecting line and arbitration bus
CN102023953A (en) * 2009-09-17 2011-04-20 研祥智能科技股份有限公司 Control method of system having many inter-integrated circuit (I2C) buses
CN101667165A (en) * 2009-09-28 2010-03-10 中国电力科学研究院 Bus sharing method and device for distributed multi-master CPUs
CN101894088A (en) * 2010-07-21 2010-11-24 中兴通讯股份有限公司 Method and device for solving conflict of multiple hosts on I2C bus
CN103617138A (en) * 2013-12-16 2014-03-05 深圳市兴威帆电子技术有限公司 Multi-mainframe arbitration method and multi-mainframe communication system
CN107766267A (en) * 2017-10-12 2018-03-06 郑州云海信息技术有限公司 A kind of referee method and system of I2C buses

Similar Documents

Publication Publication Date Title
US5430442A (en) Cross point switch with distributed control
CN107547281B (en) Main/standby competition method, device and application equipment
DE69108434T2 (en) Multi-group signal processor.
DE69123104T2 (en) Reporting and verifying changes of state in a data processing input / output system
US20060085669A1 (en) System and method for supporting automatic protection switching between multiple node pairs using common agent architecture
CN112887152B (en) Train communication network architecture and method based on Ethernet and rail train
CN107766267A (en) A kind of referee method and system of I2C buses
CN106230622A (en) A kind of cluster implementation method and device
US8108736B2 (en) Multi-partition computer system, failure handling method and program therefor
CN112069114A (en) I2C arbitration method and device
CN112073249B (en) Data transmission method, cluster switch system and related equipment
CN210324188U (en) Integrated circuit bus IIC master-slave competition automatic switching equipment and system thereof
WO2024027133A1 (en) Priority grouping polling arbiter and arbitration method therefor, and crossbar and chip
US20020009098A1 (en) Communication control method and device
CN111124964A (en) Communication control method and device for CPU and IIC bus
US20030018761A1 (en) Enhanced configuration of infiniband links
JP2550811B2 (en) Communication control method
CN111030950B (en) Topology construction method and device for stacking switch
CN107643990B (en) Communication device with configurable architecture
JP2000177943A (en) Elevator transmission controller
CN105264499A (en) Method and device for processing messages in shared queue and receiving core
US20040042496A1 (en) System including a segmentable, shared bus
JPH1188373A (en) Load distribution method by connection sorting
CN117061519A (en) Main node election method and device of target cluster and electronic equipment
CN113900984A (en) Circuit and server for interconnection and switching between single node and multiple nodes

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