AnsweredAssumed Answered

timer Dma burst transfer

Question asked by do.khiem on Nov 27, 2014
I found an example in the stm firmware. It is TIM DMA Burst. The configuration code is as in this link https://github.com/devthrash/STM32F4-workarea/blob/master/Project/STM32F4xx_StdPeriph_Examples/TIM/TIM_DMABurst/main.c
But I dont understand how it works. Here is my questions:
_ From

TIM_DMACmd(TIM1, TIM_DMA_Update, ENABLE);

I am not sure what TIM_DMA_update is? Is it that: when the timer reload CNT register, it will trigger DMA to run? How about in the case TIM_RepetitionCounter!=0?

_What if I change to 
TIM_DMACmd(TIM1, TIM_DMA_CC1, ENABLE);
How does it suppose to behave?????

_my final objective is to update both ARR and CCR1 at runtime by using DMA. So I modify the code so that it can change aSRC_Buffer at a certain time. I guess it has to do with DMA_Mode_Circular so I change the configuration to follow

DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
and 

uint16_t aSRC_Buffer[6] = { 10000, 1, 1000, 10000, 0, 9000 };

so the first set will make arr=10000, rcr=0, ccr1=1000. It will create a wave: short low and long high. (lets call it wave A). After 1 wave cycles, the TIM1 will be updated to arr=10000, rcr=0, ccr1=9000, and draws the next 1 wave cycles: long low n short high (waveB). It is expected that there are 1 wave  A+ 1 wave B n go on. However, when I observe on the my scope, I see 1 wave  A but 2 wave B. I tried to change the array value but still cannot guess what the principle is. Can you help me to explain my observation?

Outcomes