Skip to main content
Visitor II
September 14, 2022
Question

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

  • September 14, 2022
  • 4 replies
  • 1294 views

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.

    This topic has been closed for replies.

    4 replies

    Super User
    September 14, 2022

    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.3Author
    Visitor II
    September 14, 2022

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

    Graduate II
    August 21, 2024

    Hai did you find the solution ?