cancel
Showing results for 
Search instead for 
Did you mean: 

TIM2 OC ACTIVE mode issue

RN
Senior
Posted on June 21, 2018 at 13:47

Hello 

I have been experimenting with OC mode of the TIMER2 and couldnt able understand the terms 

OCPolarity and Active and inactive mode. 

below trace i got from this configuration 

/* Common configuration for all channels */

sConfig.OCMode = TIM_OCMODE_ACTIVE;

sConfig.OCPolarity = TIM_OCPOLARITY_HIGH;

I was expecting OCMODE_ACTIVE means channel will be held HIGH , but on a match channel forced to low, 

why is that ? can you please help me to understand this ?

0690X0000060Bl2QAE.png

#stm32
2 REPLIES 2
henry.dick
Senior II
Posted on June 21, 2018 at 14:31

'

I was expecting OCMODE_ACTIVE means channel will be held HIGH'

no reason to expect anything. trace the code / macros and compare it to the datasheet to see how the OC  module is initialized and you will know for sure what that macro is.

Posted on June 21, 2018 at 16:27

Hello dhenry , Thanks for the reply , 

I indeed gone through the RM to get details and compared with Register programmed values values . 

since CC1P is 0, OCREF should come as non inverted. 

0690X0000060LMeQAM.png0690X0000060LMjQAM.png