Skip to main content
Ravi1
Associate II
Aug 18, 2020 3:36 AM UTC
Solved

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

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.
Ravi1
Ravi1Best answer
Associate II
Aug 19, 2020 4:31 AM UTC

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.

2 replies

waclawek.jan
Super User
Aug 18, 2020 4:45 AM UTC

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
Aug 19, 2020 4:31 AM UTC

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.