Electrical – Single master I2C with multiple target devices

busi2cinterfacelineslave

I have a one I2C master with 14 I2C target devices connected on the bus.

I want to clarify the order of things that happen on the I2C bus.

Let say the master send an ADDRESS. All the target devices will hear, then target A will respond with ACK since the address matched.

Then master will detect that it got an ACK and send some bytes. Let's say the master sends bytes X, Y, and Z onto I2C bus.

Is it possible, during the sending of bytes X, Y, and Z, that if byte X, Y, or Z matched one of the other target device addresses then that target would respond it?

For example, byte Y coincidentally matched the target B address, then during the transmit of byte Y, target B also responds with ACK, even though we expect only target A to hear it?

Best Answer

To expand on the comment from @Oldfart: all I2C transactions starts with a START condition. This signals the bus target devices to listen for a 7-bit address. Once those seven bits, plus the R/W bit are sent, the targets stop listening for addresses and, unless they saw their address, start ignoring all bytes that go by on the bus.

This continues until the master sends a STOP condition. At that point, all of the targets wake up and start looking for another START condition.

(There is also a way to stack transactions to a single target, called a repeated START. This happens when a START is sent without a STOP to terminate the previous transaction. This start is followed by an address but only the targets that was already communicating actually listens for its address. This is used to combine reads and writes within a single transaction.)

I should add that START and STOP conditions are signalled on the bus in ways that will never occur during normal data. This way, it is impossible to mistake data for a STOP, assuming the bus is functioning correctly.