4
« 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!