Data transfer rate SPI -> PC very low?

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
R.K.
Posts: 1
Joined: Mon Aug 09, 2010 9:07 am

Data transfer rate SPI -> PC very low?

Post by R.K. »

Hi,
I want to use the SUB-20 module as SPI slave. The master is a DSP board sending data via the SPI-20 module and USB to the PC at a medium data rate of minimum 1Mbit/s. On the PC I use the C API.
Actually I have a test running at low data rate (circa 10 kbit/s). If I increase the data rate I get many errors (lost data) in the received data.

My configuration:
SPI_SlAVE, SPI_CLK_2MHz, SPI_CPOL_RISE, SPI_SETUP_SMPL.
On the PC I have an application written with Visual C saving the received data to a log-file with the API function “rc = sub_fifo_read( hndl, in_buff, 128, 2000 )”.
I send little blocks of data (2-6 bytes) from the SPI master (DSP) to the SUB-20 module and then I wait without sending data. Variaring the pause I vary the medium data rate.
It seems that the bottle neck is the USB-transfer or the small buffer in the module. But if in one USB-frame (1ms) a block of 128Bytes (or 2 blocks of 64 bytes) will be transferred a data rate of 1024kbit/s should be possible. Someone has reached this or a higher performance?
Why is my data rate performance low?

Thanks your help.

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: Data transfer rate SPI -> PC very low?

Post by xol »

HI,
First of all you can try to increase read size.

In next release we will have special flag FIFO_READ_FULL that will guaranty 64 bytes divisible reads. It will increase performance.

Post Reply