cancel
Showing results for 
Search instead for 
Did you mean: 

Question regarding timer1 lib functions

Bogdan
Senior
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

1 REPLY 1
Khouloud GARSI
Lead II
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.