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

USB superspeed peripherals Forum Discussions

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

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 50 likes received 500 replies posted 250 replies posted
Moderator

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 50 likes received 500 replies posted 250 replies posted
Moderator

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
HamburgSteak
Level 2
10 replies posted 25 sign-ins 10 sign-ins
Level 2

Thanks a lot.

0 Likes