3 years, 8 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

3 years, 8 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;
[...]
posted by Alan Silva 16 Jan 2018

But in the master it takes NACK and slave ACK

posted by Alan Silva 16 Jan 2018