Skip to main content
Ravi1
Associate II
August 18, 2020
Solved

How to use timers complementary output is for regular peripherals programming?

  • August 18, 2020
  • 1 reply
  • 1704 views

I've been trying to use TIM1CH2N to generate PWM to control ws2812b RGB LED. I have got one working library for TIM1CH2, but I'm unable to generate the same signals in the CH2N pin (STM32H750VB)​. Can anyone help me out to resolve this issue?

This topic has been closed for replies.
Best answer by Ravi1

Issue was with my function, earlier I used HAL_TIM_PWM_Start(); function to start pwm, the actual one i should use is HAL_TIMEx_PWMN_Start(); to generate pwm signal on complementary configuration.

1 reply

waclawek.jan
Super User
August 18, 2020

To get both complementary outputs working, all you need is to set TIM1->CCER.CC2NE and set up the respectve pin in GPIO.

JW

Ravi1
Ravi1AuthorBest answer
Associate II
August 19, 2020

Issue was with my function, earlier I used HAL_TIM_PWM_Start(); function to start pwm, the actual one i should use is HAL_TIMEx_PWMN_Start(); to generate pwm signal on complementary configuration.