cancel
Showing results for 
Search instead for 
Did you mean: 

Timer using DMA

avbST
Associate II

Hi

I currently use a timer in interrupt mode that triggers every 50 µs and executes my function inside HAL_TIM_PeriodElapsedCallback. I also have another timer running every 1 second. To reduce CPU load, I want to replace the 50 µs interrupt-based timer with a DMA-based implementation. My goal is for the DMA-driven timer to invoke HAL_DMA_XferCpltCallback every 50 µs. Is this approach possible, and if so, how can I implement it? If there is any other approach to implement the timer to trigger every 50us using DMA please let me know.

NOTE: I am implementing using STM32CubeIDE on STM32F439ZIT6 Nucleo Board.

Thanks and Regards

@avbST

1 REPLY 1
Saket_Om
ST Employee

Hello @avbST 

If you want to transfer data between memory and a peripheral, you can use a timer to trigger DMA transfers. However, the HAL_DMA_XferCpltCallback is not triggered every 50 µs; instead, it is called only when the entire DMA transfer is complete.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om