cancel
Showing results for 
Search instead for 
Did you mean: 

How to change periode using timer DMA PWM?

YSall.1
Senior

I watched a tutorial using this code:

  pwmData[0] = 10;
  pwmData[1] = 20;
  pwmData[2] = 30;
  pwmData[3] = 40;
  pwmData[4] = 50;
  pwmData[5] = 60;
  pwmData[6] = 70;
  pwmData[7] = 80;
  pwmData[8] = 90;
  pwmData[9] = 100;
 
  HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t *)pwmData, 10);

With it you can change the duty cycle of many signals, I would like to know a way to put also successive periods in an array, in order to change, not only the duty cycle but the periode as well. The problem with this code is that ARR doesn't change? Is there a proper way to realize what I would like?

1 ACCEPTED SOLUTION
3 REPLIES 3
MM..1
Chief III

HAL_TIM_PWM_Start_DMA = PWM control for constant frequency pwm ~`duty change.

If yoou need other setup configure DMA for your reg...

I saw that there is special function, i will look into to know how it works using TIM with DMA Burst Transfer