I connected the FT2232D with python and can detect the device ID, but the problem of open failure occurs.
Channel A of FT2232D is used for JATG to download the program to FPGA, and channel B is used for 245 FIFO mode to communicate with FPGA.
The driver settings are shown in the screenshot(driver-set.png) below.
" alt="" class="bbc_img" />
The python test code is as follows(result is test_connect.png):
" alt="" class="bbc_img" />
from pylibftdi import Driver, Device
dev_list = Driver().list_devices()
if len(dev_list) != 0:
print "Following devices found:"
for device_ in dev_list:
print device_
# Create Device instance: Channel B in binary mode
dev = Device(mode='b', interface_select=2)
# Open the instantiated device
dev.open()
# Write value 16 to FTDI over USB, returns number of bytes written
dev.write(bytearray([16,]))
# Read one byte
rx_data = bytearray(dev.read(1))
# Print the byte received. Should be 16+1 i.e, 17
print rx_data[0]
# Close device after use
dev.close()