General Category > Discussion - Software

LibMPSSE I2C Library ACK Issue

(1/1)

BigApple:
I downloaded the DLL libraries, examples, and source code from the following link
https://ftdichip.com/software-examples/mpsse-projects/libmpsse-i2c-examples/

After running the code I noticed that the library is having an issue reading the ACK bit.

In the attached scope capture, the slave successfully acknowledges the 9th bit.  However, the FTDI device does not see it.

In LibMPSSE-I2C, I noticed there's a function called: static FT_STATUS I2C_Write8bitsAndGetAck(FT_HANDLE handle, uint8 data, bool *ack)

The function appears to call


--- Code: ---status = FT_Channel_Write(I2C, handle, noOfBytes, buffer, &noOfBytesTransferred);
--- End code ---

which writes a byte a data along with the 9th clock for the acknowledge bit.

For some reason, the code then calls this

--- Code: --- {/*Get ack*/
noOfBytes = 1;
noOfBytesTransferred = 0;
INFRA_SLEEP(1);
status = FT_Channel_Read(I2C, handle, noOfBytes, inBuffer,
&noOfBytesTransferred);
--- End code ---

I'm confused about the
--- Code: ---/*Get Ack*/
--- End code ---
code.  Exactly where does the I2C library read the ACK bit?

From what I can tell the library reads the acknowledge bit AFTER the 9th clock.  Is this correct?

Based on my understanding of I2C, this is the wrong time to read the acknowledge bit.



FTDI Community:
Hi,

This is a known issue, and there is a fix. if you send an email to support1@ftdichip.com, we can send you a fixed version.

Best Regards
FTDI Community

BigApple:
Sounds good thank you!

Navigation

[0] Message Index

Go to full version