1 Reply Latest reply on Apr 10, 2017 12:50 AM by AnkitaS_51

    I2C master without slave



      i have copied some code from the examples. My problem is that without an Slave is connected, the code is not halted in the loop.




      I expect that the first do-while loop should run until a slave acknowldged / the statusbyte should be 0x20 (I2C_MSTAT_ERR_ADDR_NAK  /* Slave did not ACK */) .


       thanks a lot




      Heres the code:




      //Write to Slave


          temp = I2C_MasterWriteBuf(slAddress,(uint8 *)i2c_txArray,i2c_TxBufferSize,I2C_MODE_COMPLETE_XFER);   
      while (temp != I2C_MSTR_NO_ERROR);


      /* Wait for the data transfer to complete */
      while(I2C_MasterStatus() & I2C_MSTAT_XFER_INP){};


      temp = I2C_MasterClearStatus();