Wire.h questions

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.

If I place 2 masters on the same I2C bus

you fail to understand the reason behind the concept of a master

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?

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.