0
\$\begingroup\$

I have a one I2C master and 14 I2C slave 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, then all the slave devices will hear, then slave A will respond with ACK since the address matched.

Then master will detect that it got an ACK, and the master begin send some bytes, let's say the master send byte X, Y, and Z to I2C line.

Is it possible that during sending byte X, Y, and Z, if coincidentally byte X, Y, or Z matched one of the other slave address, then that slave will respond it??? For example byte Y coincidentally matched with slave B address, then during the transmit of byte Y slave B too is reponding with ACK, eventhough we expect only slave A that hear it?

\$\endgroup\$
  • \$\begingroup\$ No, because there is also something called 'stop'. The bus is reserved for the transaction unitl a STOP occurs. \$\endgroup\$ – Oldfart Feb 16 at 10:44
2
\$\begingroup\$

To expand on the comment from @Oldfart: all I2C transactions starts with a START condition. This signals the slaves to listen for a 7-bit address. Once those seven bits, plus the R/W bit are sent, the slaves 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 slaves wake up and start looking for another START condition.

(There is also a way to stack transactions to a single slave, 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 slave 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 signaled 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.

\$\endgroup\$
1
\$\begingroup\$

As long as all slaves have different addresses, there is no confusion as the address byte is the first byte sent after the start condition.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.