Skip to main content
RN_it
Associate III
Jun 21, 2018 11:47 AM UTC
Question

TIM2 OC ACTIVE mode issue

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
    This topic has been closed for replies.

    2 replies

    henry.dick
    Associate II
    Jun 21, 2018 12:31 PM UTC
    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.

    RN_it
    RN_itAuthor
    Associate III
    Jun 21, 2018 4:27 PM UTC
    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