+ Post New Thread
Results 1 to 10 of 10
  1. #1
    Member level 5
    Points: 1,117, Level: 7

    Join Date
    Jun 2017
    Location
    Bhubaneswar,Odisha,India
    Posts
    86
    Helped
    4 / 4
    Points
    1,117
    Level
    7

    I2C bus Arbitration conflicts

    while following the data sheet of i2c bus specification (philips 1995) pdf attached
    the below lines in bold are not giving me the clear visualization ..

    "If a master also incorporates a slave function and it loses arbitration
    during the addressing stage, it’s possible that the winning master is
    trying to address it. The losing master must therefore switch over
    immediately to its slave-receiver mode."


    my confusion is -
    if master 1 tries to address master 2 (so master 2 is slave for master 1) . So is it the case here, that master 2 trying to address itself and thats why it loses arbitration ?
    if yes,then where is the conflict ,if master 1 trying to address master 2 , and master 2 trying to address itself then both are addressing same ..

    where i am getting wrong in understanding?

  2. #2
    Super Moderator
    Points: 249,762, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    43,485
    Helped
    13214 / 13214
    Points
    249,762
    Level
    100

    Re: I2C bus Arbitration conflicts

    I2C master function isn't associated with an address, only slave function.

    Loosing arbitration in a multi master system only indicates that two masters are trying to access the bus simultaneously, it's no related to accessing a specific slave. The general case is e.g. master 1 accesses slave x and master 2 slave y.

    The discussed case is about master 2 implementing also a slave function. If master 1 wins the arbitration and x is the slave address of master 2, master 1 would erroneously assume slave x to be offline if it doesn't immediately activate the slave receiver function.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Advanced Member level 2
    Points: 4,071, Level: 15

    Join Date
    Feb 2014
    Posts
    526
    Helped
    191 / 191
    Points
    4,071
    Level
    15

    Re: I2C bus Arbitration conflicts

    No the spec is discussing an example where master 1 is addressing master 2 but master 2 is addressing something else. That will create a conflict.

    You're correct that if they were both addressing the same slave (master 2 in your example) there will be no arbitration lost. At least in the addressing phase.


    1 members found this post helpful.

  4. #4
    Member level 5
    Points: 1,117, Level: 7

    Join Date
    Jun 2017
    Location
    Bhubaneswar,Odisha,India
    Posts
    86
    Helped
    4 / 4
    Points
    1,117
    Level
    7

    Re: I2C bus Arbitration conflicts

    Quote Originally Posted by asdf44 View Post
    No the spec is discussing an example where master 1 is addressing master 2 but master 2 is addressing something else. That will create a conflict.

    You're correct that if they were both addressing the same slave (master 2 in your example) there will be no arbitration lost. At least in the addressing phase.
    yes ,that is where i was stuck and confused. ,but your explanation arises the question that if master 2 is engaged with another device , then certainly SDA line will be engaged in this , so master 1 definately monitor the SDA line ,and if it engaged (by master 2) then how will master 1 attempt to address master 2 (as a slave) .

    even if it(master 1) will be able to address it (master 2) ,how will master 2 loose the arbitration and master 1 win ??

    - - - Updated - - -

    Quote Originally Posted by FvM View Post
    I2C master function isn't associated with an address, only slave function.


    The discussed case is about master 2 implementing also a slave function.
    does it (BOLD WORDS) mean that master 2 attempted to address other slave device while master 1 attempted to address master 2(as slave) at same time ?

    and in case if master 1 win the arbitration ,master 2 would have to immediately activate the slave receiver function . (by pulling the SDA line low (ACK)) .

    AM I RIGHT ??

    sir u have explained nicely ,thanks.
    please acknowledge whether i understood correct or not ?



    •   AltAdvertisment

        
       

  5. #5
    Advanced Member level 2
    Points: 4,071, Level: 15

    Join Date
    Feb 2014
    Posts
    526
    Helped
    191 / 191
    Points
    4,071
    Level
    15

    Re: I2C bus Arbitration conflicts

    Quote Originally Posted by RAHUL_KUMAR View Post
    even if it(master 1) will be able to address it (master 2) ,how will master 2 loose the arbitration and master 1 win ??
    Quote Originally Posted by RAHUL_KUMAR View Post
    AM I RIGHT ??

    sir u have explained nicely ,thanks.
    please acknowledge whether i understood correct or not ?
    The open drain nature of I2C means you 'win' arbitration anytime you try to send a 0 when the other guy is sending a 1 because zeros win. So the addresses determine the winner. Master 2 loses and master 1 wins based only on their respective addresses.


    Quote Originally Posted by RAHUL_KUMAR View Post
    and in case if master 1 win the arbitration ,master 2 would have to immediately activate the slave receiver function . (by pulling the SDA line low (ACK)) .
    Well not quite, a master might lose arbitration at bit #3 so it needs to keep 'listening' to see if someone is addressing it before it pulls an ACK.


    This is all a pretty minor corner case by the way. Most busses don't have two masters. Most masters don't need to be a slave.

    It's also generally avoided by logically separating the slave implementation from the master implementation. Simply have the slave function/module/peripheral listening all the time regardless of what the master function/module/peripheral is doing. In many cases this is an easier way to implement it anyway.



  6. #6
    Super Moderator
    Points: 67,706, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,846
    Helped
    3158 / 3158
    Points
    67,706
    Level
    63

    Re: I2C bus Arbitration conflicts

    Hi,

    The first byte sent out by a master is the address byte.
    (a slave doesn't start an I2C communication, it just responds with ACK and DATA)

    It's just a therotical case that two master start a communication at the same time...
    Now as long as both master send out the same logic state, there is no problem.
    But as soon as the one outputs a "0", while the other with a "Z" releases the bus (usually causing a "H" by the external pullup)
    ...both will read back a "0"
    For the first one it is the value it expects,
    But the other expects a "H" ... and thus recognizes that an other member is pulling SDA --> "0".
    This is the situation, where the second has to release the bus and stop it's communication. It has lost arbitration.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  7. #7
    Member level 5
    Points: 1,117, Level: 7

    Join Date
    Jun 2017
    Location
    Bhubaneswar,Odisha,India
    Posts
    86
    Helped
    4 / 4
    Points
    1,117
    Level
    7

    Re: I2C bus Arbitration conflicts

    Quote Originally Posted by KlausST View Post
    Hi,

    The first byte sent out by a master is the address byte.
    (a slave doesn't start an I2C communication, it just responds with ACK and DATA)

    It's just a therotical case that two master start a communication at the same time...
    Now as long as both master send out the same logic state, there is no problem.
    But as soon as the one outputs a "0", while the other with a "Z" releases the bus (usually causing a "H" by the external pullup)
    ...both will read back a "0"
    For the first one it is the value it expects,
    But the other expects a "H" ... and thus recognizes that an other member is pulling SDA --> "0".
    This is the situation, where the second has to release the bus and stop it's communication. It has lost arbitration.

    Klaus
    SIR , what you have explained is the general theory of arbitration which is based on wire-and logic , the explanation is not in the context of the question i asked which is a special case of arbitration .
    kindly refer to my question...



    •   AltAdvertisment

        
       

  8. #8
    Super Moderator
    Points: 67,706, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,846
    Helped
    3158 / 3158
    Points
    67,706
    Level
    63

    Re: I2C bus Arbitration conflicts

    Hi,

    Which question do you see as not answered yet?

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  9. #9
    Member level 5
    Points: 1,117, Level: 7

    Join Date
    Jun 2017
    Location
    Bhubaneswar,Odisha,India
    Posts
    86
    Helped
    4 / 4
    Points
    1,117
    Level
    7

    Re: I2C bus Arbitration conflicts

    the question have the bold highlighted portion ,please go through the opening question sir



  10. #10
    Super Moderator
    Points: 67,706, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,846
    Helped
    3158 / 3158
    Points
    67,706
    Level
    63

    Re: I2C bus Arbitration conflicts

    Hi

    Iīm not sure what you mean. You speak in riddles.

    Maybe you want to know how a master(with slave capabilities) behaves when loosing arbitration while beeing accessed at the same time by another master.

    --> It depends on implementation, itīs capabilities and the current state.
    * If ready to answer immedialtely: it should show this with an ACK
    * if not ready to anwser immedately: it should show this by NACK.
    I think both scenarions are according I2C specification.

    But this case is not worth to spend much time, because itīs very very unlikely, even if you want this to happen. Itīs only theoretical.
    For this both masters need to start communication within a couple (maybe less) of microseconds and stay about synchronized for the entire addressing phase.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



--[[ ]]--