Skip to main content
Graduate
May 15, 2024
Solved

How to continously (without time gaps) stream bytes to SPI interface (Transmit only) ?

  • May 15, 2024
  • 1 reply
  • 858 views

Hello,

I'm trying to generate continous stream of random bits on SPI MOSI (for eye pattern analysis).

I'm making tests with 2 byte sequences.

I'm starting DMA transfer with : 

 

HAL_SPI_Transmit_DMA(&hspi2, &spi_outdata, 2);

 

 

in the HAL_SPI_TxCpltCallback I start another SPI transfer.

 

I notice few tenths (cca. 60) of microseconds gaps on clock and data signals on SPI MOSI output.

Is there any way to achieve continuous clock and data signals on SPI ?

If I try to send on Half Callback, DMA is busy - it doesn't send. 

Can I somehow only add to output buffer on half-complete callback or any other solution?

 

Thanks in advance,

regards.

 

    This topic has been closed for replies.
    Best answer by waclawek.jan

    Which STM32?

    > Is there any way to achieve continuous clock and data signals on SPI ?

    Yes - use circular DMA.

    JW

    1 reply

    Super User
    May 15, 2024

    Which STM32?

    > Is there any way to achieve continuous clock and data signals on SPI ?

    Yes - use circular DMA.

    JW