Skip to main content
Bogdan
Senior
December 29, 2016
Question

Question regarding timer1 lib functions

  • December 29, 2016
  • 1 reply
  • 375 views
Posted on December 30, 2016 at 00:28

Hello,

i am working on a BLDC motor control, based on hall sensors for rotor position.

I am starting to write some code, and came across a example on google

the function i am refering is this : TIM_SelectOCxM(TIM1, TIM_Channel_1, TIM_ForcedAction_Active);     

From what i understand so far, is that this function disables the timer channel1 before changing the OC mode, but the forced action parameter?  It forces the output in high level state ( logic 1) ? 

Thanks

    This topic has been closed for replies.

    1 reply

    Khouloud GARSI
    Technical Moderator
    December 30, 2016
    Posted on December 30, 2016 at 11:11

    Hello

    Anton.Bogdan

    ,

    The function 'TIM_SelectOCxM'disables the selected channel before changing the Output Compare Mode.

    If you're using a logic high (polarity bit CCxP=0), then YES, the 'TIM_OCMode_Active' parameter forces the OCx to high level state.

    If this answers your question, please click on correct

    :)

    .

    Regards,

    Khouloud.