cancel
Showing results for 
Search instead for 
Did you mean: 

How to change pwm polarity or PWM mode after each DMA cycle.

HJang.3
Associate II

I am using STM32F103C8T6, timer 1 ch 1 to generate complementary PWM

with variable duty cycle Using DMA buffer

  HAL_TIM_Base_Start(&htim1);
  HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t *) base, 30);
  HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1);

Now i want to invert PWM polarity or PWM mode after each DMA transfer.

without changing Phase of PWM.

Thanks.

4 REPLIES 4

This probably can't be done without transients.Simply change polarity in the DMA transfer complete interrupt, or maybe delay it by some fixed time.

JW

HJang.3
Associate II

can you please tell how to change polarity during transfer complete interrupt.

thannara123
Senior

Hai did you find the solution ?