Skip to main content
Tejashree
Associate III
November 30, 2021
Question

Complementary output is active high when disabled

I want to control output of complementary PWM.I am doing it as follows:

while (1)

 {

  /* USER CODE END WHILE */

 TIM1->CCR2 = 30000;

 HAL_Delay(15000);

 TIM1->CCER &= (uint16_t) ~TIM_CCER_CC2E;

 HAL_Delay(15000);

 TIM1->CCER|=TIM_CCER_CC2E;

  /* USER CODE BEGIN 3 */

 }

But when i disable my CH2N(marked in bold),it is active high by default.and i want it to be active low when i disable output.

below is my configuration:

0693W00000GZSEZQA5.png0693W00000GZSEyQAP.png

This topic has been closed for replies.

1 reply

TDK
November 30, 2021

> Complementary output is active high when disabled

>  TIM1->CCER &= (uint16_t) ~TIM_CCER_CC2E;

> But when i disable my CH2N(marked in bold),it is active high by default.

It's not clear if you're talking about OC2N or OC2 output, but in either case, the output state is dependent on several parameters as described in the reference manual:

0693W00000GZYtdQAH.png

"If you feel a post has answered your question, please click ""Accept as Solution""."