cancel
Showing results for 
Search instead for 
Did you mean: 

TIM2 & TIM8 DMA in master slave sync issue with same length: STM32F446

MGOEL.1
Associate II

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 

5 REPLIES 5
TDK
Super User

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*

If you feel a post has answered your question, please click "Accept as Solution".

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)

TDK
Super User

Okay:

TDK_0-1754406763450.png

So you want 15 pulses of SCK, then a pulse of TRANS and SCK at the same time. Easy enough.

 

But wait...

TDK_1-1754406799617.png

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.

If you feel a post has answered your question, please click "Accept as Solution".

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

Any examples for dma sync with timer available with arbitrary array