Part Number: TMS320F28335
Hello,
The module 12 of the following resource is for I2C communication.
http://www.ti.com/lit/zip/ssqc019
I understand that after sending the address SCD is polled. Because SCD will be set when the internal data counter (Value in I2CCNT) counts down to 0.
Also, hen STT is not set ARDY is polled as an indication that the counter has counted down to 0.
But why can't we initially set the NACK bit and then poll the NACK bit (I2CSTR.1)? Thus, if it becomes 0, then it means acknowledgement has been sent by the receiver.
According to the I2C manual:
"NACK applies when the I2C module is a transmitter (master or
slave). NACK indicates whether the I2C module has detected an
acknowledge bit (ACK) or a no-acknowledge bit (NACK) from the
receiver. The CPU can poll NACK or use the NACK interrupt
request."
1. But NACK is never polled. It is the SCD/ARDY that is polled. Why is that so?
2. Also, only if we poll the NACK bit, we can actually know if the acknowledgement has been sent by the receiver and we can proceed on to sending the next data. But how can polling SCD/ARDY be indicative of whether ACK is sent by the receiver and whether the next data can be sent? SCD/ARDY can indicate only if the number of bytes set in I2CCNT has been transmitted. Without polling NACK how can we know if the slave has received the data?
Thanks in advance!