MCU: TM4C1294NCPDT
TI-RTOS: v2.01.00.03
CCS: v6.0.1.0040
I2C_device used: M41T62 from St Microelectronics
Hello,
QUERY 1:
I am using the function I2C_Transfer (in blocking mode) in my code. I want to know whether the CPU will be released or not while the function is blocking the execution of the task from where it is called. What I mean is that, if I2C_Transfer function is waiting for an ongoing transaction to complete, higher priority tasks can pre-empt the currently running task, but while I2C_Transfer function is waiting for some I2C communication to complete, will lower priority tasks be able to run?
QUERY 2:
Also, I am noticing that when I am connecting my I2C device to the Tiva MCU using two hook up wires (power supply permanently connected to the I2C device from EK-TM4C1294XL board, but SCL & SDA lines are detachable) two phenomena are being noticed:
Case 1:
The SCL & SDA wires are connected & the I2C_Transfer function is returning FALSE (here I have set a wrong device address/ID for test perposes).
Case 2:
The SCL & SDA wires are left unconnected & the I2C_Transfer function is getting blocked and never returns until I connect the SCL & SDA wires.
My query is how will the Tiva MCU know whether there was a I2C device ID mismatch or whether the I2C device is not present on the I2C bus? All I can re-collect is that the ACK & NACK (9th bit of a I2C communication byte) is used to detect presence of a correctly addressed I2C device. According to me, whether we connect an I2C device to the bus with a wrong device ID or we don't connect the device at all, both are going to give NACK result to the Tiva MCU. So, how is the difference occuring that is making I2C_Transfer function to decide whether to wait indefinitely or return FALSE?
Thanks
Regards
Soumyajit