2022-02-15 10:58 AM
Hello,
I am trying to trigger each DMA read of my SPI to happen on update event Trigger output of my Timer but I don't think I have it setup correctly.
I've seen this done using the internal ADC, where you can set the external conversion trigger source to the Timer Trigger output, but I don't know how you can do this with the SPI.
If anyone has any ideas and could explain this I would really appreciate it. I have attached my Timer and SPI CUBE MX settings here.
Thanks very much.
2022-02-15 11:44 AM
The hardware supports it, but I don't think it's something supported by CubeMX.
Setting the timer update event to trigger the DMA, and having the DMA transfer a dummy byte/word into SPI->DR would do the trick.
HAL_TIM_Base_Start_DMA is close to what you want but the destination is TIM_ARR, not the SPI_DR.
2022-02-15 12:48 PM
So would I need DMA setup for the timer as well as the SPI? Would you happen to be able to show me the lines of code that would be needed for this?
Thanks for the response
2022-02-15 12:50 PM