Hello,
In my hardware I have used FT230X. PC software is developed in Java. I decided to add X series support to
https://github.com/akuhtz/JavaFTD2XXI have read eeprom with status OK but have problem with write to. Function FT_EEPROM_Program returns status 12 = FT_EEPROM_WRITE_FAILED but in FT_PROG I see new programmed values. Why this function returns error? What should I check?
Function prototype in FTD2XX interface:
int FT_EEPROM_Program(
Pointer ftHandle, Structure eepromData, int eepromDataSize, Pointer Manufacturer, Pointer ManufacturerId,
Pointer Description, Pointer SerialNumber);
My eeprom structure:
public class FT_EEPROM_HEADER extends Structure {
public int deviceType = 0;
public short vendorId;
public short productId;
public byte serNumEnable;
public short maxPower;
public byte selfPowered;
public byte remoteWakeup;
public byte pullDownEnable;
}
public class FT_EEPROM_X_SERIES extends Structure {
public FT_EEPROM_HEADER header;
public byte acSlowSlew;
public byte acSchmittInput;
public byte acDriveCurrent;
public byte adSlowSlew;
public byte adSchmittInput;
public byte adDriveCurrent;
public byte[] cBus = new byte[7];
public byte invertTxd;
public byte invertRxd;
public byte invertRTS;
public byte invertCTS;
public byte invertDTR;
public byte invertDSR;
public byte invertDCD;
public byte invertRI;
public byte bcdEnable;
public byte bcdForceCBusPWREN;
public byte bcdDisableSleep;
public short I2CSlaveAddress;
public int I2CDeviceId;
public byte I2CDisableSchmitt;
public byte FT1248Cpol;
public byte FT1248Lsb;
public byte FT1248FlowControl;
public byte RS485EchoSuppress;
public byte powerSaveEnable;
public byte driverType;
public FT_EEPROM_X_SERIES() {
this.header.deviceType = (short)DeviceType.DEVICE_X_SERIES.ordinal(); // 9
}
}