TMS320F2800157: I2C detect whether slave is ready with Data.

Part Number: TMS320F2800157

Tool/software:

Hi TI Team,

Considering two TMS320F2800157 boards, 1. Master as Receiver and 2. Slave as Transmitter configuration connected using I2C.

What code snippet we need to use in Master side to detect if the slave device have put the data in its own Transmitter (TX) FIFO Buffer so that I can send start condition on Master side ?

Considering two TMS320F2800157 boards, 1. Master as Transmitter and 2. Slave as Receiver configuration connected using I2C.

What code snippet we need to use in Master side to detect if the slave device have received the data in its own Receive (RX) FIFO buffer so that I can send stop condition on Master side?

  • Hi Kaustuv,

    Is this question related to the other thread created as well?

    Best Regards,

    Aishwarya 

  • Hi Aishwarya,

    It is partially related.

    Consider a case. Controller transmitter has transferred some integer value to the target receiver. Then in the target receiver side it will take some time to process the value, make some calculation and put the result in its transaction buffer of FIFO. Other side, the controller should weight as well as change its configure to controller receiver. As the time for the whole calculation and processing of the data in Target side is unknown so from the controller side, how can controller be able to know that some data has already been put on the transaction buffer of slave so that it can proceed with the command for data?

    Regards

    Kaustuv

  • Hi Aishwarya,

    It is partially related.

    Consider a case. Controller transmitter has transferred some integer value to the target receiver. Then in the target receiver side it will take some time to process the value, make some calculation and put the result in its transaction buffer of FIFO. Other side, the controller should weight as well as change its configure to controller receiver. As the time for the whole calculation and processing of the data in Target side is unknown so from the controller side, how can controller be able to know that some data has already been put on the transaction buffer of slave so that it can proceed with the command for data?

    Regards

    Kaustuv

  • Kaustuv,

    Once the target finishes receiving, processing, and storing data, it sends an ACK/NACK to the controller and then enters the I2C RX ISR, if using interrupts. Controller can send command for data at this point. The status flags also keep track of what is happening in the I2C module at any given moment. What I’ve described here is the basic I2C protocol. 

    Best Regards,

    Aishwarya