AnsweredAssumed Answered

Trigger DMA From CCR Timer

Question asked by shaw.jason on Mar 9, 2014
Latest reply on Mar 10, 2014 by Clive One
Greetings all, I'm new here so I hope I'm doing this right.


STM32F0


I'm trying to trigger a DMA transfer from TIM2 with CCR1


Here's my code for the timer portion


TIM_TimeBaseInitTypeDef timerInitStructure;
timerInitStructure.TIM_Prescaler = 0;
timerInitStructure.TIM_CounterMode = TIM_CounterMode_Up;
timerInitStructure.TIM_Period = 60;
timerInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;
timerInitStructure.TIM_RepetitionCounter = 0;
TIM_TimeBaseInit(TIM2, &timerInitStructure);


TIM_OCInitTypeDef outputChannelInit;
outputChannelInit.TIM_OCMode = TIM_OCMode_Timing;
outputChannelInit.TIM_OutputState = TIM_OutputState_Enable;
outputChannelInit.TIM_OCPolarity = TIM_OCPolarity_High;


outputChannelInit.TIM_Pulse = 41;
TIM_OC1Init(TIM2, &outputChannelInit);
TIM_OC1PreloadConfig(TIM2, TIM_OCPreload_Enable);


TIM2->DIER |= (0x01 << 14) | (0x01 << 9);
TIM_Cmd(TIM2, ENABLE);


So what I was looking for was being about to trigger a DMA transfer when the count register reaches 41 on DMA1_Channel5.
I can verify that a transfer is happening but it looks like it's happening on Update.
Thanks!
-Jason

Outcomes