javausbi2cserial-communicationftdi

Java Library for FTDI FT260 USB-I2C Bridge


I am attempting to communicate with some I2C-controlled IO expanders on a circuit board over a USB/I2C bus from my PC with the aid of the FTDI FT260Q USB to I2C bridge IC. Below are a couple of useful documents I was able to locate:

The FTDI website mentions a Java implementation of the D2XX drivers, and provides the following links:

Now comes my problem: I have no idea where to begin. I already have a Java project I am working on and have reached the point where I click a button inside a JFrame which is supposed to configure the IO expanders, but the event listener is empty. That is to say, now that the JButton can be pressed, I need it to send commands to configure the devices for the proper I/O settings. I have a general idea of how to format I2C commands, so what I am looking to do now is to somehow have my Java program connect to the COM port (enumerated when the circuit board is plugged in via a USB cable), and be able to send I2C commands from the PC to the USB side of the bridge chip, so that they can then be properly translated to the I2C bus on the other side of the bridge chip.

I downloaded the FTD2xxj file from the SourceForge link I found on the FTDI website, but that is as far as I have gotten. I was unable to find any instructions for how to set up the library (are specific locations required for the different items in the downloaded ZIP file? Which ones do I need? How do I add them to my project? Is it the same as I would add another external JAR, by going to Project -> Properties -> Java Build Path -> Libraries and adding them from there? Will this even work for the FT260?

It has been a long time since I last worked in Eclipse (or Java, for that matter), so I am having to re-learn as I go. Please pardon my ignorance.

The contents of the ZIP file downloaded form SourceForge can be seen in the screenshots below:

Top level:

enter image description here

Features:

enter image description here

Plugins:

enter image description here

Web:

enter image description here

I would have tried the forum mentioned on SourceForge, except it does not appear to be well maintained, and the last activity seems to have been in 2013.


Solution

  • I recently found a library that not only has all of the required Java files, but also includes examples and a variety of other resources. Documentation is quite good as well. It's "Yet Another D2xx Library", or "yad2xx" for short. I definitely recommend it!

    https://github.com/aushacker/yad2xx/tree/master

    Using the files in that repository I was able to get everything set up and running in my Eclipse environment, and was able to make function calls from my own program.