2024-04-04 12:40 PM
I’m using an STM32G473 and I have TIM20 CHANNEL1 configured in output compare mode. When the compare value is reached, I want to move CNT values from TIM1, TIM5, TIM6, TIM7 and TIM15 to 5 static locations in memory.
I’m not sure if I can use DMA to streamline this. I’m using CubeMX and HAL and I’m looking for examples of something like this, but so far I only see DMA examples for transferring to and from the triggering peripheral. Can DMA do this?
Solved! Go to Solution.
2024-04-04 01:39 PM
You'd need multiple DMA triggered by a common source, say TIMx_UP or TIMx_CCx at zero phase
The transactions wouldn't occur at the same instant.
You might be able to create an Input Capture case where TIMx->CNT moves to TIMx->CCx and then recover the latched value at your leisure.
2024-04-04 01:39 PM
You'd need multiple DMA triggered by a common source, say TIMx_UP or TIMx_CCx at zero phase
The transactions wouldn't occur at the same instant.
You might be able to create an Input Capture case where TIMx->CNT moves to TIMx->CCx and then recover the latched value at your leisure.
2024-04-04 10:09 PM - edited 2024-04-04 10:10 PM
> You might be able to create an Input Capture case
... based on master-slave connection between TIM20 and the "target" TIMx...
> where TIMx->CNT moves to TIMx->CCx and then recover the latched value at your leisure.
... or you use the target TIM's CCx signal to trigger DMA of that TIM's CCRx into memory buffer.
> I’m using CubeMX and HAL
That may make your task harder.
JW
2024-06-21 01:11 PM
I changed the design a bit to allow it to do basically what you're proposing.