gpuguy
Newbie level 5
- Joined
- Jun 18, 2012
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,341
.
Hi.
The board is Lattice MACHX02 1200 ZE.
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:
1- Since I am getting correct value of device ID, does that mean my SPI interface is working 100% fine.
2- I wrote
WriteControlBuffer[0]=224; //0xe0
because the **broken link removed** 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 **broken link removed** and screenshot above.
Thanks in advance for spending your precious time.
Hi.
The board is Lattice MACHX02 1200 ZE.
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:
1- Since I am getting correct value of device ID, does that mean my SPI interface is working 100% fine.
2- I wrote
WriteControlBuffer[0]=224; //0xe0
because the **broken link removed** 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 **broken link removed** and screenshot above.
Thanks in advance for spending your precious time.