vandelay
Advanced Member level 4
usb to spi converter
I am using an FT2232 chip to provide an SPI interface over USB. When reading up on the provided SPI.dll documentation, I was surprised to find the two functions SPI_Read and SPI_Write. Since SPI is a full duplex transfer, how can it be that there are separate read and write functions provided? Could it be that (since USB communicates in packets), the command is sent to the SPI on write and the simultaneously recieved data dumped, then the expected response data (a given nr of bytes to be read) is read by writing dummy data the same size, transmitting the whole buffer back in a single USB packet? It would make sense as data could be transfered alot faster over USB, but in my case (reading very few response bytes at a time, many commands to many SPI slaves) I am left with alot less effective bandwidth than what the FT2232 datasheet first appeared to indicate.. I read it could do 6MHz SPI (IIRC), but I am starting to suspect that's a clock number I cannot base my bandwidth math on..
Any clarification on this would be great..
I am using an FT2232 chip to provide an SPI interface over USB. When reading up on the provided SPI.dll documentation, I was surprised to find the two functions SPI_Read and SPI_Write. Since SPI is a full duplex transfer, how can it be that there are separate read and write functions provided? Could it be that (since USB communicates in packets), the command is sent to the SPI on write and the simultaneously recieved data dumped, then the expected response data (a given nr of bytes to be read) is read by writing dummy data the same size, transmitting the whole buffer back in a single USB packet? It would make sense as data could be transfered alot faster over USB, but in my case (reading very few response bytes at a time, many commands to many SPI slaves) I am left with alot less effective bandwidth than what the FT2232 datasheet first appeared to indicate.. I read it could do 6MHz SPI (IIRC), but I am starting to suspect that's a clock number I cannot base my bandwidth math on..
Any clarification on this would be great..