Working with FTDI library for accessing FPGA memory

Thread Starter


Joined May 15, 2013

I am a bit new in embedded programming. I am having MACHX02 1200 ZE breakout board.
I am using FTDI Library FTCSPI to access Lattice FPGA UFM through FTDI chip FT2232H. I configured the FPGA in SPI slave by using IPExpress. I am confident that teh FPGA is now configured well as the following code is giving me correct value of device Id.
WriteControlBuffer[0]=224; //0xe0

Status = SPI_ReadHiSpeedDevice(ftHandle, &ReadStartCondition, true, false, NUM_LATTICE_CMD_CONTOL_BITS, &WriteControlBuffer, NUM_LATTICE_CMD_CONTOL_BYTES, true, false, NUM_LATTICE_CMD_DATA_BITS, &ReadDataBuffer, &dwNumDataBytesReturned, &HighPinsWriteActiveStates); if (Status == FTC_SUCCESS) { printf(" success "); } else { printf("failed"); } printf(" ID read = %x%x%x%x", ReadDataBuffer[0],ReadDataBuffer[1], ReadDataBuffer[2], ReadDataBuffer[3]);

This prints:

I wrote
WriteControlBuffer[0]=224; //0xe0
because the Lattice FPGA UFM programming guide on page no. 17-61 says that the command for reading device Id is E0 or 224 in decimal.
Now the next problem I am facing is regarding the usage of the code for verifying device ID i.e 0xE2 00 00 00 01 2B 20 43. Below is a screen shot of the page I am talking about:

Now I am unable to understand which function from FTDI library I have to use for this purpose. SPI_ReadHiSpeedDevice is used for reading some data. But here I have to verify, so wondering if the library has any other function for such purpose.
If not then what could be the other way to pass the command E2 with the inputs 01 2B 20 43 as is shown in the Lattice programming guide and screenshot above.