AnsweredAssumed Answered

STM32F SPI DMA transfer, triggered by Timer

Question asked by gurrieri.francesco on Mar 14, 2016
Latest reply on Mar 14, 2016 by nielsen.kristian
Hi everyone,

I have some cpu-load issue on my design, so I am trying to redesign an high frequency Rx spi transfer. (24bit)

I would like to setup a timer that at a certain frequency triggers the Rx SPI transfer.

Right now I have a timer (TIM8) that triggers a DMA stream (TIM8_UP)(DMA2_Stream4).
I am using SPI1 (DMA2_Stream2)
I saw in this forum some possible solutions (set the peripheral address as SPIx->DR) but I think it doesn't work (I would probably read a stream of 0s... wouldn't I?).

So am figuring out to setup a number of timers (all synch each other with TRGO/ITR functionality), which will trigger a number of dma streams to:
 A)disable SPI_DMA_Req
 B) disable the DMA2_Stream2 (SpiRx)
 C.a) setup the size of the transfer (NDTR register)
 C.b) enable the DMA2_Stream2 (SpiRx)
 D) enable SPI_DMA_Req

So, I need to use 4 timers.
My application doesn't requires the usage of a lot of timers, so it wouldn't problem, but I am wondering if it'd be a more readable/easy solution.

Many thanks,
Francesco

Outcomes