I have some questions for using I2C communication.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
HamburgSteak
Level 2
Level 2
10 replies posted 25 sign-ins 10 sign-ins

Hi, I'm a software engineer using FX3/CX3 products and have some questions about I2C.

I referenced an75779 and cyfxusbi2cregmode for implementing application.

But there are difference between that examples and so I'm wondering why those example different.

In an75779, SensorI2CAccessDelay() function is used after CyU3PI2cTransmitBytes() function.

In SensorI2CAccessDelay() function, this is just loop I think.

But in cyfxusbi2cregmode example source code,  CyU3PI2cWaitForAck() function is used after CyU3PI2cTransmitBytes(). 

What are different between those?

0 Likes
1 Solution
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

In CyU3PI2cWaitForAck, just the preamble is sent without the data phase (i.e. just the device address). If we get the ACK for preamble that means the device is responsive Its just the way to check if device is responsive after write. This is mentioned in description of transmit API "the API will return when FX3 has transmitted the data. If the slave device requires additional time for completing the write operation, then either
sufficient delay must be provided; or the CyU3PI2cWaitForAck API can be used.
Refer to the I2C slave datasheet for more details on how to identify when
the write is complete."

Best Regards,
AliAsgar

View solution in original post

0 Likes
2 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

In CyU3PI2cWaitForAck, just the preamble is sent without the data phase (i.e. just the device address). If we get the ACK for preamble that means the device is responsive Its just the way to check if device is responsive after write. This is mentioned in description of transmit API "the API will return when FX3 has transmitted the data. If the slave device requires additional time for completing the write operation, then either
sufficient delay must be provided; or the CyU3PI2cWaitForAck API can be used.
Refer to the I2C slave datasheet for more details on how to identify when
the write is complete."

Best Regards,
AliAsgar

0 Likes

Thanks a lot.

0 Likes