I2C Bus Arbitration

Quad

Golden Member
Nov 18, 2000
1,222
0
0
I've done some reading about I2C bus arbitration and I've learned that a device tests to see if the bus is busy by trying to drive it HIGH, then checking to see if it actually went high. If the bus signal is LOW, then some other master is using the bus.

But say when Master2 (M2) tries to drive the line HIGH, and Master1 (M1, the current bus master) is also driving it HIGH, then won't M2 mistakenly assume that the bus is free? Then M2 could initiate a START condition by driving SCL HIGH (say, at the same time that M1 is driving it high for the rising edge of its clock), then pulling SDA LOW while keeping SCL HIGH. And from what I can see, nothing is stopping M2 from doing this...completely disrupting the current data transfer and gaining control of the bus.

What am I misunderstanding here? Thanks in advance!

 

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
(Simplified my explaination)

If the bus is busy, the other masters are acting like a slave and are actively listening to the bus. It will not assert a START condition until after it hears a STOP condition on the bus. So if one master already owns the bus, other masters will not jump in during transmission.

The only case of confused ownership is if the bus has a STOP condition and two masters simultaneously exert a START condition. They'll both keep transmitting and thinking they own the bus until there is a difference between what they sent and what appears on the bus. The loser is are the masters that tried to pull high and the winner of the bus is whoever tried pulling the bus low. All the losers back off and retransmit later and the winner keeps going.
 

Quad

Golden Member
Nov 18, 2000
1,222
0
0
Originally posted by: TuxDave
(Simplified my explaination)

If the bus is busy, the other masters are acting like a slave and are actively listening to the bus. It will not assert a START condition until after it hears a STOP condition on the bus. So if one master already owns the bus, other masters will not jump in during transmission.

The only case of confused ownership is if the bus has a STOP condition and two masters simultaneously exert a START condition. They'll both keep transmitting and thinking they own the bus until there is a difference between what they sent and what appears on the bus. The loser is are the masters that tried to pull high and the winner of the bus is whoever tried pulling the bus low. All the losers back off and retransmit later and the winner keeps going.

What if M2 comes out of reset (and say the bus is not in use) and does not know the status of the bus. Does it wait until it sees a STOP condition before trying to gain ownership? That would mean it would have to wait until some other device uses the bus first, which would prevent M2 from ever using the bus if no other device ever uses the bus again.
 

Peter

Elite Member
Oct 15, 1999
9,640
1
0
Devices can't drive the lines High. It's an open drain bus, devices can drive low or release. A "High" level happens when no one drives the signal "Low", courtesy of a pullup resistor somewhere.

But yes, blocked bus is something that can happen. Which is particularly nasty since some devices crash and don't ever release the bus again. To add insult to injury, most devices don't even have a hardware reset, so you need a power cycle to bring the system back to working state.
 

TuxDave

Lifer
Oct 8, 2002
10,571
3
71
Originally posted by: Quad
Originally posted by: TuxDave
(Simplified my explaination)

If the bus is busy, the other masters are acting like a slave and are actively listening to the bus. It will not assert a START condition until after it hears a STOP condition on the bus. So if one master already owns the bus, other masters will not jump in during transmission.

The only case of confused ownership is if the bus has a STOP condition and two masters simultaneously exert a START condition. They'll both keep transmitting and thinking they own the bus until there is a difference between what they sent and what appears on the bus. The loser is are the masters that tried to pull high and the winner of the bus is whoever tried pulling the bus low. All the losers back off and retransmit later and the winner keeps going.

What if M2 comes out of reset (and say the bus is not in use) and does not know the status of the bus. Does it wait until it sees a STOP condition before trying to gain ownership? That would mean it would have to wait until some other device uses the bus first, which would prevent M2 from ever using the bus if no other device ever uses the bus again.

Ahh.. good point. I forgot to mention about that scenario. So let's say M2 just came out of a reset and does not know the bus is occupied. I believe M2 will assume it's not occupied and may exert a START condition. If M1 was transmitting on that line and since M1 is actively monitoring the line, it'll notice that one of the lines is not being pulled high when it's supposed to due to the double pulldown in a START condition. So M2 will 'steal' the line from M1 and M1 will back off.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |