Go Down

Topic: Wire.h questions (Read 428 times) previous topic - next topic

kazekun

I have a question about the Wire.h library.  Hope someone could help this newbie to I2C.
1) If I place 2 masters on the same I2C bus and they send data simultaneously (i.e. issue Wire.send() simultaneously), after one of the masters lost arbitration, will the master having lost the arbitration attempt to resend again automatically after a certain amount of backoff? Or do I need to write code to handle the retransmission myself?

Thanks.

Osgeld

Quote
If I place 2 masters on the same I2C bus


you fail to understand the reason behind the concept of a master
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

kazekun

But I read about the multi-master arbitration procedure from an I2C specs (http://www.nxp.com/documents/user_manual/UM10204.pdf).  At the bottom of p.7, it says "If two or more masters try to put information onto the bus, the first to produce a 'one' when the other produces a 'zero' loses the arbitration."  And the specs talks further about arbitration in Section 3.1.8 (pp. 11-12)

Does this not mean that it is possible to have two devices on the I2C bus trying to become master and put info onto the at around the same time, and that the I2C has the arbitration mechanism to resolve the potential conflict? Or am I misunderstanding the concept of multi-master arbitration in the I2C spec?

pylon

Quote
Or am I misunderstanding the concept of multi-master arbitration in the I2C spec?


No, but the Wire library does not support the multi-master feature. The AVR hardware does support it but to use it you have to write your own library.

Go Up