Skip to main content
YSall.1
Senior
June 24, 2022
Solved

How to change periode using timer DMA PWM?

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?

This topic has been closed for replies.
MM..1
MM..1Best answer
Super User
June 24, 2022

3 replies

MM..1
Super User
June 24, 2022

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

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

YSall.1
YSall.1Author
Senior
June 24, 2022

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

MM..1
MM..1Best answer
Super User
June 24, 2022