Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 10 months ago.
Communication I2C
My slave try communication with master without being asked, that is, o slave send WRITE to master but my master is currently WRITING on another slave. my slaves don't have same address
1 Answer
7 years, 10 months ago.
Not sure I understand the question correctly, but I2C slaves are never allowed to initiate a communication. They may only respond to a request by a master.
Yes, but in my program I put a WAIT in the master code, and then I send a READ but my slave is sending the WRITE before and giving ACKNOWLEGDE. Example:
//master code
if(x==8&&y==0&&xa4==0){
wait(5.0);
xa5 = 2;
xa5 = mestre.read(address,respo3,7);
if(xa5==0){
S.printf("\r3M.RECEBEU<%s> \r\n ",respo3);
x = 5;
}
}
if(x==5&&y==0&&xa5==0){
xa6 = 2;
[...]