LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FT260 I2C using LibFT260.dll & UMFT260EV1A Evaluation Board -- No I2C traffic

Solved!
Go to solution

Hello LabVIEW Community,

 

I'm working on code to perform I2C writes via the FT260 USB HID-to-I2C bridge device.  I'm using the LibFT260.dll provided by FT.  My hardware for initial development is the UMFT260EV1A eval board.

 

When I attempt to execute an I2C write I see no traffic on the I2C bus, which I'm probing with an o'scope.

 

I'm following the sequence outlined by example code from FT to initialize the I2C interface and attempt a write:  

1. Discover and open HID interfaces using FT260_OpenByVidPid function.

2. Reset the I2C Master using FT260_I2CMaster_Reset function.

3. Initialize the I2C Master with 100kHz clock using FT260_I2CMaster_Init function.

4. Write to slave address 56 using FT260_I2CMaster_Write function.

5. Close the HID interfaces.

 

Things I have verified:

  • I successfully see I2C traffic when I use a coworker's utility that was developed for Linux using raw HID packets and does NOT use the LibFT260.dll.  I know my hardware is good.
  • Using other functions in the LibFT260.dll to do other things works.  For example, I can toggle GPIO and get status data from the FT260.  I know I can communicate to the FT260.
  • All I2C function calls to the DLL respond with OK status.  The functions seem happy with my arguments.

The facts above lead me to believe something about my usage of the DLL, specifically the I2C functions, is not quite correct.  I just cant figure out what it is.

 

I have attached my code, along with the DLL.  Drill down in I2C 64bit Troubleshooter.vi for the sequence outlined above.  Can you see any errors in what I have so far?  Where could I be going wrong?

 

Thank you,

Aaron

0 Kudos
Message 1 of 4
(3,010 Views)
Solution
Accepted by topic author acramer

I resolved my issues.  I incorrectly defined the enumeration values for FT260_I2C_FLAG.  In the FT260Lib .h file, the enums go 0, 2, 3, 4, 6:  

acramer_0-1676937798790.png

I went 0, 1, 2, 3, 4.  So when I intended to send a Start and Stop condition (0x06), I was telling it to send a stop condition (0x04) which apparently appeared as no traffic on the bus.  Oops.

Anyway, maybe this info will help someone in the future.

0 Kudos
Message 2 of 4
(3,001 Views)

can you give me you library LibFT260.lib with the functions i am working with the same board UMFT260EV1A

i have a question did you manage how to get all the different code error from the ftdi in a separated vi ?   

0 Kudos
Message 3 of 4
(2,930 Views)

good lucky! execuse me, could you share here the your source vi code of LabVIEW 2017 32bit?

0 Kudos
Message 4 of 4
(1,982 Views)