To update DMA (array buffer) during runtime for changing duty cycle of TIMER 1 pwm complementary channels on STM32F103C8T6(bluePill).
My question is regarding HAL library in STM32F103C8T6(blue Pill) , I've just started using stm32 , I've good knowledge about arduino.
I am trying to make sine PWM for a single phase inverter. For that i need channel1 of timer1 to generate complementary pwm signal Which i ve done using DMA (array of duty cycles), to vary duty cycle.
I've used :
HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t *) sinebuffer, 60);
HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);
to generate PWM.
but this circular DMA buffer contains values to generate 100% sine amplitude only.(max duty cycle).
So to implement feedback to the project , I have to update DMA array Values (into some percentage of initial values)
Now i don't know how to implement it,
if there is a way like for example CCR = ( array[x] * percentage)
or any other method to multiple DMA array values (1 to 100%).
I will read percentage from analog pin.
THANK YOU