Page 1 of 1

Multiple timers problem

Posted: Wed Dec 11, 2013 5:39 pm
by midihenry
Hello,

I'm building a line-following robot that also avoids obstacles. So, I wanted to use an ultra-sound sensor mounted on a servomotor to check for the obstacles. However, i encountered a problem when trying to assign 4 timers: 1 for the motors TIM4 (pwm output), 1 for the servomotor (pwm output), and 2 for the ultra-sound sensor(icu and pwm output).
I couldn't get the timers 1,2 and 8 to work along with the timers 3,4 and 5.
Could someone please tell me if there is something that I missed because I'm really stuck...

Thank you in advance

Re: Multiple timers problem

Posted: Wed Dec 11, 2013 5:46 pm
by Tectu
Probably you could give some more information? For example, we don't know what MCU you are using. Furthermore, please describe the problem you are having. We don't know where what exactly failed.


~ Tectu

Re: Multiple timers problem

Posted: Wed Dec 11, 2013 5:54 pm
by midihenry
Well I'm using the STM32 F4 Discovery board using chibios 2.4.2
I need to configure 4 timers but I could only use 3 at a time.

Re: Multiple timers problem

Posted: Wed Dec 11, 2013 5:55 pm
by Tectu
What exactly happened? By "could just use three at a time", do you mean that you got some compiler error? Did all of them stopped working once you added a fourth or did the three keep running and the others didn't start up?
Could you also please provide us with some of your code.


~ Tectu

Re: Multiple timers problem

Posted: Wed Dec 11, 2013 7:13 pm
by midihenry
It wasn't a compiler error it's just that timers 1,2 and 8 wouldn't work for me even when I tried to use them one at a time.
They wouldn't give me any output..

Re: Multiple timers problem

Posted: Wed Dec 11, 2013 8:58 pm
by Giovanni
Are timer callbacks being invoked? you could place breakpoints. If callbacks are invoked but you just don't see output PWM signals then it could be a pin conflict or a pin setup problem, you have to assign the correct alternate function to pins (see datasheet, not reference manual).

Giovanni