1
\$\begingroup\$

I have an I2C interface with multiple Slaves and a Single master. If master wants to communicate with any of the slave it sends its address and read from the same. But what should be done if one of the slave wants to communication with the master?

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

Case 1: Slave has an interrupt pin

You need to connect this interrupt pin to master microcontroller. Every time the slave has some data, it should raise an interrupt. At that point, master will read the available data.

Case 2: Slave doesn't have an interrupt pin

Polling is the only option in this case. Master keeps reading all the slaves at regular interval and keeps comparing the received data with old one. If the data has changed, master will take appropriate action. You need to decide the interval according to your application.

\$\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.