0
\$\begingroup\$

I am working on Ti's EK-TM4C1294XL which is basically a Arm Cortex M4 evaluation board. I was going through I2C bus of the same and have the following question regarding the I2C bus.

I understand I2C support multi master multi slave configuration. So when we want to send data from a particular master to a particular slave we write first the slave address on the bus from that master and after receiving the Ack transmits the data to that slave.

So in the same situation i want to receive data from a particular slave to a particular master but can the slave start the communication? Like suppose slave is a ADC and once the conversion is done send the converted data to a particular master. Is this possible in I2C?

\$\endgroup\$
1
  • \$\begingroup\$ Just use an additional GPIO pin to flag which master is going to talk on the bus or directionaly, as long as you control the software for the masters this is possible. It is not part of the "spec". But, why not switch to spi? \$\endgroup\$
    – Voltage Spike
    Jul 26, 2016 at 19:26

1 Answer 1

3
\$\begingroup\$

So in the same situation i want to receive data from a particular slave to a particular master but can the slave start the communication? Like suppose slave is a ADC and once the conversion is done send the converted data to a particular master. Is this possible in I2C?

A device which is a pure I2C slave can not start an I2C transaction. This holds for both multi- and single-master I2C buses.

However, some slave devices can alert the master out of band, not through I2C. When the master sees the alert, it will initiate the transaction. For this purpose, some ADCs have discrete digital outputs which correspond to the state of the A/D conversion. (For example, the AD7998 has got an ALERT/BUSY pin and an I2C connection for readout and configuration.)

If there is a multi-master bus, then a device could switch its role on the fly from master to slave. Then it can initiate an I2C transaction as a master. It would have to be a microcontroller with its own firmware. The vast majority of hard I2C devices are bus slaves, although there are a handful of hard I2C devices that are bus masters. I've never heard of a hard I2C device that would switch from master to slave.

By the way, here's a related thread: https://electronics.stackexchange.com/a/232135 .

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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