AnsweredAssumed Answered

STM32CubeMX failing to set PWM complment channel

Question asked by este on May 26, 2015
Latest reply on Jun 1, 2015 by Amel N
I have an F103-Nucelo, Kiel, and want to set Tim1 with PWM on Ch2,Ch2n,Ch3,Ch3n. I have this set as correctly as I can see in STM32Cube. I have a scope and can verify the Ch2/Ch3 work perfectly. The complmenet/negative channels do not initialize however.

////////////////////Things HAL does
 HAL_Init();
  SystemClock_Config();
  MX_GPIO_Init();
  MX_TIM1_Init();
 
 
/////////////////////My code
    printf ("PWM should be running");
    HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_2);
    HAL_TIM_PWM_Start(&htim1,TIM_CHANNEL_3);

Works fine to turn on TIM1 CC2E and TIM1 CC3E which set the PWM on those channels. But I can't seem to find a clean way to enable CC2NE/CC3NE. I can do this:

TIM1->CCER |= (TIM_CCER_CC2NE | TIM_CCER_CC3NE);

But no where is that documented as how I'm supposed to go about it, nor does that seem like how the HAL would "want" me to.

Am I just missing this option or functions somewhere?

Outcomes