Thursday, August 30, 2007

Servos and more...

I found some code from the Netburner forum for sending R/C servo pulses. It uses the Gerneral Purpose Timers to send the pulses. Once the timers are initialized all the work is done in an interrupt service routine. There are four GPT channels so there are four R/C servo channels available.
The Sabertooth motor controller can use R/C pulses as input, so having the servo code working allows me to test that as well. The only real question was whether or not the Sabertooth would accept the 3.3v pulses. Since the MOD5213 is a 3.3v device all output voltages are 3.3v. I hooked up the motor controller using a few jumpers and booted the Netburner.
To test it I just used the routines from the R/C code to change the pulse widths using a terminal emulator connected to serial port 0. After a few presses of the '+' key the 'bot lurched forward. A few '-' and it crept back. Awesome!

No comments: