FTDI Community

General Category => Discussion - Software => Topic started by: Mikexx on February 06, 2023, 01:44:06 AM

Title: Fast SPI from a FT2232 in Windows
Post by: Mikexx on February 06, 2023, 01:44:06 AM
I have discovered the MPSSE library as per:
  https://ftdichip.com/software-examples/mpsse-projects/libmpsse-spi-examples/

I would like to use the SPI_ReadWrite() function.

While this works from the last clock to the CS going high is some 250ms, which is unusable.
I also had to fix an issue with cmdBuffer[] size, implying this library function has never been debugged. Furthermore the CS pin goes high for just 1.8us between sending a SPI_Write() and a SPI_ReadWrite().

I would like to use the Read/Write facility as it saves a resending of a message where the STM32F4 device I am interfacing might miss the odd packet.

The alternative is a SPI_write() followed by multiple SPI_Reads() and an overall retry which isn't going to be so efficient.

There are seemingly a number of other libraries such as "FT2232HS_SPI->VC++_200" but some of these go back 13 years and haven't been updated to current Visual Studio standards so don't instil any confidence.

Is there another way forward? I would be grateful for others' experiences.