I am using Kinetis K64 with Processor Expert and running on RTOS with KSDK 1.2.0.
I am trying to write to the I2C Device(I2C port Expander) with the I2C_DRV_MasterSendDataBlocking function as per the KSDK sample example.
Looks at few instances I am running into a state where I get a return status of "kStatus_I2C_ReceivedNak" when i tried to Read/ Write a register of I2C device.
Here kStatus_I2C_ReceivedNak is received after I2C_HAL_WriteByte when I2C_DRV_SendAddress is called.
When I checked Through Saleae analyzer I came to know that the Stop bit is been issued before the Data is been written.
You can see in the below Image . The write 1 is success with start, adresss, cmd buffer , data buffer , stop
Is this a known behavior? Please let me know what I am missing. Currently I have a Timeout of 1000ms.
Also I want to know,
if I2C_DRV_SendAddress get a kStatus_I2C_ReceivedNak Is it supposed to be handled in I2C_DRV_MasterSend ??
Thanks,
Rufus
Solved! Go to Solution.
Hello Rufus:
Your issue seems very similar to the one discussed in the next thread (check in particular the last 2 replies):
I2C on KDS and configuring the component
Please confirm that you have the Open Drain setting enabled for the I2C pins that you are using. As mentioned in that discussion, the logical analyzers can sometimes hide important information from the analog signal.
Let me know if the issue is not resolved.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Rufus:
Your issue seems very similar to the one discussed in the next thread (check in particular the last 2 replies):
I2C on KDS and configuring the component
Please confirm that you have the Open Drain setting enabled for the I2C pins that you are using. As mentioned in that discussion, the logical analyzers can sometimes hide important information from the analog signal.
Let me know if the issue is not resolved.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------