I am using pspdrivers_01_30_01 drivers to communicate over the SPI to 4 other devices. I am using four of the chip select outputs. I need to read 32 bytes of data from each device in a quick sequence. Running the SPI port at 10MHz, the actual data read is approximately 27 micro seconds. but the total time from the start of one read to the next is over 188 micro seconds. What could be causing this much overhead? I do not have any other processes interrupting between the reads. The PSP example code I started with uses the GIO_write() to execute the data transfer. The code sequence is simply:
dataparam->inBuffer = loopRead1;
dataparam->outBuffer = loopWrite;
dataparam->bufLen = 32u;
dataparam->dataFormat = Spi_DataFormat_0;
dataparam->flags = Spi_CSHOLD;
dataparam->chipSelect = CHIPSELECT_1;
GIO_write (spiHandle, dataparam, &size);
dataparam->chipSelect = CHIPSELECT_2;
dataparam->inBuffer = loopRead2;
GIO_write (spiHandle, dataparam, &size);
dataparam->chipSelect = CHIPSELECT_3;
dataparam->inBuffer = loopRead3;
GIO_write (spiHandle, dataparam, &size);
dataparam->chipSelect = CHIPSELECT_4;
dataparam->inBuffer = loopRead4;
GIO_write (spiHandle, dataparam, &size);
This does correctly read all four devices - but it is too slow. If the overhead was 30 micro seconds or less instead of 161 micro seconds than my application would work. The code is running on an OMAP L-138, 300Mhz, CCS3.3.81.6, CGT 6.1.7, DSPBios 5.33.03
The SPI Delay register is set to all zeros. The WDELAY is also set to zero.
We are using the 4-pin with CS mode.
Can you help explain the overhead of using the GIO_write driver for the SPI transfer?