2018-06-21 04:47 AM
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 ?
#stm322018-06-21 05:31 AM
'
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.
2018-06-21 09:27 AM
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.