This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI Inter-byte delay issue?

Guru 15580 points
Other Parts Discussed in Thread: OMAP-L138

I am using the OMAP-L138 SPI interface to communicate with an external chip. The external chip clocks out a status word at the same time the OMAP is sending a data byte to the external chip. However, there is some sort of fixed 4.667 uSec delay between the end of transmitted byte from the OMAP and the beginning of the subsequent transmitted byte from the OMAP. My code (Logic BSL) waits for the receive data to arrive from the external chip, but from my perspective there should be zero wait time since the external chip is sending a byte to the OMAP as the OMAP is sending a byte to the external chip.

 

// wait for data to arrive.

  while (CHKBIT(spi->SPIBUF, RXEMPTY)) {}

 

Since I am not toggling CS between bytes, I suspect that the various SPIDELAY values do not apply and should therefore not cause a delay between transmitted bytes.

Here is a capture of the SPI lines. The mysterious gap between the two consecutive bytes is 4.667 uS. I need to reduce this gap. My SCLK is 2MHz. Can anyone shed some light on this?

Thx,

MikeH

 

  • Have you tried zeroing out the SPIDELAY register to see if that shortens the delay?

    Also you might want to try using EDMA rather than CPU polling in order to optimize the timings.

    Jeff

  • Jeff,

    jc said:
    Have you tried zeroing out the SPIDELAY register to see if that shortens the delay?

    Yes, I have set SPIDELAY to zero and it does not seem to shorten this delay. I'll give EDMA a try to get rid of the CPU polling.

    Thx,

    MikeH