FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FT232H SPI continuous readout  (Read 82 times)

Tycho

  • Newbie
  • *
  • Posts: 3
    • View Profile
FT232H SPI continuous readout
« on: June 02, 2021, 09:05:10 AM »

Hi,
I'm using FTDI C232HM HiSpeed USB 2.0 cable to communicate with a SPI interface. The device is based on FT232H chip from FTDI. I would like to continuously read out a SPI device which has 800 kBaud data rate. It also has a RDY line, which is connected to GPIOL1 line of FT232H. After every conversion inside the device RDY line is toggled and I can wait on high/low with 0x88/0x89 MPSSE command.

To do a burst read out I'm sending
//single sequence start
0x88 //trigger on high

0x80 //Chip Select low
0x01
0x0B

0x20 //burst readout 8 bytes
0x07
0x00

0x80 //Chip Select high
0x09
0x0B
repeat, but now beginning with 0x89 //trigger on low
//single sequence end

I can send this sequence to MPSSE and it works fine. I'm getting two SPI readouts directly after every RDY line change (seen on oscilloscope). If I send the sequence x 1000 in one write to MPSSE it works fine, too.
The problem starts if I try to adapt this scheme for continuous readout. To do read outs continuously I tried to write to MPSSE a second time directly after the first write. But the second SPI start is delayed, I think due to USB bulk mode.

My idea was that there is a queue on MPSSE, it is processed continuosly and I can fill it during processing from time to time to have an endless data stream, so I increased the first write to 3200 sequences. The SPI sequence burst lasts 25 ms but the second sequence burst only begins after a 35 ms delay, although it is written directly after the first. With flush command 0x87, not waiting for availability of complete SPI readout but reading out only the actual received SPI bytes and other tricks it seems to work fine for some time, but only until I switch e.g. to a browser or Win10 starts to do other tasks in background, something like locking the screen due to inactivity. Then I get delays that are sometimes longer than 100 ms.

Is it possible to use MPSSE/FT232H for low latency continuous SPI readout? Maybe there is a driver which has isochronous transfer mode?

Thank you very much in advance!
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 612
    • View Profile
Re: FT232H SPI continuous readout
« Reply #1 on: June 03, 2021, 04:32:00 PM »

Hello,

This device operates in USB Bulk Transfer Mode.

There is no option to use it in Isochronous Transfer Mode.

You can refer to our MPSSE Examples here:

https://ftdichip.com/software-examples/mpsse-projects/

Best Regards,
FTDI Community
Logged

Tycho

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FT232H SPI continuous readout
« Reply #2 on: June 04, 2021, 10:31:52 AM »

If I understood it correctly, LibMPSSE DLL is built on top of FTD2XX.dll. This will not solve my problem because I already implemented SPI with FTD2XX.dll.

The question is: are the delays caused by USB bulk in general or is it wrong use of FTD2XX.dll on my side?
Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 612
    • View Profile
Re: FT232H SPI continuous readout
« Reply #3 on: June 04, 2021, 04:35:27 PM »

Hello,

FTDI devices use USB Bulk transfers and those are designed to transfer large amounts of data with error-free delivery, but with no guarantee of bandwidth.

You could try reducing the latency timer to 1ms to see if it helps.

Best Regards,
FTDI Community
Logged