AnsweredAssumed Answered

PWM with TIM1 lags

Question asked by pavelm on Feb 10, 2012
Latest reply on Sep 4, 2013 by Clive One
Hello
STM32RBT6 should control 1 servo with PWM output. For all TIM2 - TIM4 I tested it seems to be OK, but for TIM1 Channel 1 which is one I need it is working only occasionally what is very strange.
Sometime I just recompile same code and it is working correctly, until I recompile it again.
Well, it works, but output is very laggy - cca 1 second shoots.
It should control brushless regulator, it use same output as servos, so I testing it with some servos ..
Here is my code http://pastebin.com/hN2EsGH7
There are 2 servos, one with TIM2 which works smoothly as expected, second with TIM1. Notice, that it is controlled by same code.
I wonder TIM1 CH1 is used by something, but I can't find what, when throttle_init() is called right after RCC_APB2PeriphClockCmd() in main()..
Next thing, TIM1 CH1 servo don't react at all without TIM_CtrlPWMOutputs (TIM1, ENABLE);

Somebody know, where could be a problem ?

Outcomes