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.

OMAP SPI slave with very long word length

We are using OMAP SPI in slave mode, receiving only. Periodically, the master is sending a very large sequence of data which is not interrupted by CS0.

In other words, CS0 goes down, MOSI and CLOCK are going up and down for x thousands of bytes. CS0 goes up and everything repeats. CS0 doesn't go up and down like every 32 bits.

OMAP TRM says: 

"In slave mode, the MCSPI initiates data transfer on the data lines (mcspim_simo and mcspim_somi) when it is selected by an active control signal (mcspim_csx) and receives an SPI clock (mcspim_clk) from the external SPI master device. Only channel 0 can be configured as a slave. In slave mode, the MCSPI uses the edge of mcspim_csx to detect word length. For this reason, mcspim_csx must become inactive between each word. The MCSPI does not support mcspim_csx active between SPI words. It uses the edge to detect word length."

Right now, without FIFO, we don't manage to read well data.

Question: what is happening at the MCSPI block level when data continues to arrive especially after 32 bits. Will new data be shifted in the RX buffer on the right side of SYNCHRO, erasing previous data? Or are the current 32 bits passed to the FIFO (de facto, word is 32-bit long) and the RX buffer is filled again with new data?

  • Hello,

    OMAP won't understand these transfers (very large data sequences) correctly, as its MCSPI controller works with 32bit words. So data will be lost as you suspect.

    You can transmit such large data as successive words in spi multi-word transfer.

    If you need to keep mcspi_cs signal low during successive words, then you need to set MCSPI_MODULECTRL[1]PIN34 bit to 0x1 (spi will work in 3 pin mode). This way the cs signal is ignored and the master can set mcspi_cs signal low and initiate a multi-word transfer.

    If PIN34 is not set to 0x1 then mcspi_cs signal should be toggled between successive words, in order to receive correct data.

    Best Regards,

    Yordan

  • Thank you Yordan. Very interesting answer. I will give it a try.