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
Multiple timers problem
Moderator: RoccoMarco
Re: Multiple timers problem
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
~ Tectu
Re: Multiple timers problem
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.
I need to configure 4 timers but I could only use 3 at a time.
Re: Multiple timers problem
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
Could you also please provide us with some of your code.
~ Tectu
Re: Multiple timers problem
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..
They wouldn't give me any output..
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Multiple timers problem
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
Giovanni