AnsweredAssumed Answered

STM32F103RBT6 complimentary output polarity problem

Question asked by minthemerciless on Oct 10, 2016
Latest reply on Oct 10, 2016 by FTITI.Walid
Hi,
I am trying to get complimentary output working with the same polarity on both the OCx and OCxN.  I have successfully done this with TIM_OCPolarity_High, and TIM_OCNPolarity_Low.  

The next step is to be able to disable and re-enable either the OCx or OCxN outputs.  I am able to set up everything as I want, with the desired polarity on the desired outputs.  However when I disable the OCx output using 
TIM_CCxCmd(TIM1, TIM_Channel_1, TIM_CCx_Disable);

and then re-enable it using

TIM_CCxCmd(TIM1, TIM_Channel_1, TIM_CCx_Enable);

 the OCxN output polarity reverts back to TIM_OCNPolarity_High.  

I am currently using an STM32F103RBT6 Nucleo board with ST Link debugger.
I have checked the CCER register and the OCxN polarity bit is high (=1), but the output is reversed.

If I disable and re-enable the OCxN output, it retains the correct polarity.

Very confused, any help would be great, thanks in advance

Rob

Outcomes