2021-11-30 02:06 AM
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:
2021-11-30 01:47 PM
> 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: