2025-08-05 1:25 AM - last edited on 2025-08-05 1:45 AM by Andrew Neil
HI I AM FACING ISSUE WITH TIMER SYNC WITH SAME LENGTH TIM2 MASTER AND
TIM8 SLAVE HAL_TIM_PWM_Start_DMA(&htim2, TIM_CHANNEL_4, (uint32_t *)gPWMData1, gPWMData1LastIdx); // IN THIS SAME ARRAY PWM ALWAYS GENERATED IN DMA
HAL_DMA_Start_IT(&hdma_tim8_up, (uint32_t)&gPWMData2[row], (uint32_t)&(GPIOB->BSRR), gPWMData2LastIdx);//IT HAS TO BE IN SYSNC WITH TIM2
TIM2 START--------UEVTIM2 (AFTER TIM2 DMA FINISH WAIT FOR DMA COMPLETION IN WHILE WE STOP IT LATENCY OCCURS)THEN TIM8STARTS-----WE HAVE TO WAIT IN WHILE FOR DMA TO COMPLETE THEN AGAIN WE START TIM2
ISSUE IS IN NORMAL DMA ABOVE IS WORKING BUT I AM REQUIRING IT IN CONTINUOUS MANNER WITHOU TCPU INTERVENTION LOOKS TO BE COMPLEX PROBLEM TO ME
2025-08-05
4:46 AM
- last edited on
2025-08-19
4:34 AM
by
Maxime_MARCHETT
Duplicate:
TIM2 and TIM8 sync issue with DMA in circular ... - STMicroelectronics Community
Still think you need to clearly describe the waveform you want. It's impossible to decipher from what you've presented. Perhaps put some pen to paper and describe signals and relative timing.
*Link edited*
2025-08-05 6:52 AM
hello,I have given exact pulse Also what i am doing also given Basically after sck or clock pulse one tran pulse given This is repeated 15 times then after last 3 sck pulse trans is kept high all work is done by arrays.Then some padding 3 pulse gap to prevent overlap of pulses.Basically sending all through Timers and dma.
Total array index is around 5550 same for both timers
(Yes earlier post was having some technical issue)
2025-08-05 8:15 AM
Okay:
So you want 15 pulses of SCK, then a pulse of TRANS and SCK at the same time. Easy enough.
But wait...
You also want 2 (or 3?) SCK pulses within a single TRANS pulse (which doesn't match the first plot).
Can you see why this is confusing? All delays and frequencies are also not specified.
There's definitely a way to do this. You may need to involve an additional 1-2 timers and utilize gated slave mode.
2025-08-05 8:40 AM
Hello after 15 pulses its 3 sck ,trans high how to do in gated mode But i have prepared array for the same and with Strart tim2 dma then stopping .THen In oc mode tim8 start then after tim8 completion again start tim2 pwm
How to do it in gated mode?Please provide any example or any other example where i can see two dma timers sync in continuous manner?Thanks in advance
2025-08-12 10:05 PM
Any examples for dma sync with timer available with arbitrary array