Updated 28 Sep 2023
There is an extremely useful Python library written by Emmanuel Blot [eblot]. Instead of writing your own C++ code to call the ftd2xx.dll, and if you are familiar with Python programming language, then just use PyFtdi which is like a wrapper for the dll.
It works for other FTDI devices as well. The GitHub documentation is clear and quite easy to understand. It does not officially support Windows. There is a USB driver that seems complicated to install but fortunately [Marius Greuel] made PyFtdi much easier to use with Windows. It is basically a version of PyFtdi that works with Windows.
The FTDI device will have a specific hardware identifier. I only have 1 device, there did not have any issues.
To show the FTDI device connected to your computer:
from pyftdi.ftdi import ftdi from io import StringIO out = StringIO() print(Ftdi.show_devices('ftdi:///?', out=out))
There are several functions which can be used in bit-bang mode. These functions can be found in the GPIO wrapper by [eblot] which I link here.
MPSSE Controller example:
from pyftdi.gpio import GpioMpsseController ioOut = GpioMpsseController() ioOut.configure (url=url, direction=0xFFFF, frequency=3E6) ioOut.write(out=[1,4,6,1,13,15]) ioOut.close()
Synchronous GPIO example:
from pyftdi.gpio import GpioSyncController ioOut = GpioSyncController() ioOut.configure(url=url, direction=0xFFFF, frequency=3E6) ioOut.exchange(out=[1,4,6,1,13,15])
The GpioSyncController function is much faster compared to GpioMpsseController. I was able to observe 600 bit stream with GpioSyncController vs 300 on GpioMpsseController.
This blog site by [iosoft] that uses ftd2xx Python package (another wrapper for FTDI dll).