Hi guys,
I have used tms320f28379d and configured its I2CA and I2C-B as Slaves. I have attached the configurations.I am supposed to receive 10 bytes from the Master. But during the transimmison , the TI controller sends a NACK after receiving certain bytes(sometimes 3 or 7, it is not repetitive) and the issue does not occur repeatedly but it is seen often.The same issue is not observed in I2CA.
I have also attached Picoscope captures of the I2C-B communication where the NACK is observed.
Could someone help to debug the issue.Also, what are the possible situations , a NACK is sent by the TI controller?
void Init_I2CB_FIFO(void) { // // Must put I2C into reset before configuring it // //I2C_disableModule(I2CB_BASE); I2C_disableModule(I2CB_BASE); // I2C slave configuration // I2C_setConfig(I2CB_BASE, I2C_SLAVE_RECEIVE_MODE | I2C_SLAVE_SEND_MODE); I2C_setDataCount(I2CB_BASE, 10); I2C_setBitCount(I2CB_BASE, I2C_BITCOUNT_8); I2C_setOwnSlaveAddress(I2CB_BASE, SLAVE_ADDRESS2); I2C_setEmulationMode(I2CB_BASE, I2C_EMULATION_FREE_RUN); I2C_enableFIFO(I2CB_BASE); I2C_clearInterruptStatus( I2CB_BASE, I2C_INT_RXFF | I2C_INT_TXFF | I2C_INT_STOP_CONDITION); // // Receive FIFO interrupt levels are set to generate an interrupt // when the 16 byte RX fifo contains 10 or greater bytes of data. // I2C_setFIFOInterruptLevel(I2CB_BASE, I2C_FIFO_TX6, I2C_FIFO_RX10); I2C_enableInterrupt(I2CB_BASE, I2C_INT_RXFF | I2C_INT_TXFF | I2C_INT_STOP_CONDITION); // // Configuration complete. Enable the module. // I2C_enableModule(I2CB_BASE); }
void Init_I2CA_FIFO(void) { // // Must put I2C into reset before configuring it // I2C_disableModule(I2CA_BASE); // I2C slave configuration // I2C_setConfig(I2CA_BASE, I2C_SLAVE_RECEIVE_MODE | I2C_SLAVE_SEND_MODE); I2C_setDataCount(I2CA_BASE, 10); I2C_setBitCount(I2CA_BASE, I2C_BITCOUNT_8); I2C_setOwnSlaveAddress(I2CA_BASE, SLAVE_ADDRESS1); I2C_setEmulationMode(I2CA_BASE, I2C_EMULATION_FREE_RUN); I2C_enableFIFO(I2CA_BASE); I2C_clearInterruptStatus( I2CA_BASE, I2C_INT_RXFF | I2C_INT_TXFF | I2C_INT_STOP_CONDITION); // // Receive FIFO interrupt levels are set to generate an interrupt // when the 16 byte RX fifo contains 10 or greater bytes of data. // I2C_setFIFOInterruptLevel(I2CA_BASE, I2C_FIFO_TX6, I2C_FIFO_RX10); I2C_enableInterrupt(I2CA_BASE, I2C_INT_RXFF | I2C_INT_TXFF | I2C_INT_STOP_CONDITION); // Configuration complete. Enable the module. I2C_enableModule(I2CA_BASE); }