Question
PWM with TIM1 lags
Posted on February 10, 2012 at 20:00
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 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 ? #tim1-channel-1-pwm