ATMEL AVR Opens Source Software

PWM / Servo controllers with GPIO and serial interface

Support This Project
SourceForge.net Logo

These modules allow you to control servo motors the same way Pontech.com modules do, but for MUCH less money ! They are based on an Atmel AVR 2313:

  • servo/servo1.c: Generic PWM and Servo signal generator with RS232 interface.

To use the servo controller you just need to add a few components and a MAX232 for the RS232 interface (use this schematic for example).

You'll find on the CVS Repository:

You can also post your questions on this forum: Atmel AVR projects on SF.net

P.S.: Why Atmel AVR and not Microchip PIC ? 'Cause: It's much faster (10 MIPS @ 10Mhz), cheaper, it has much more registers (32), more features, nicer instruction set, open tools (gcc works nicely)... Go to www.atmel.com for technical evidence. And if you need USB support, use can now use a cheap AVR2313 as a firmware only USB controller thanks to the AVR USB project !

Palm Cybot

Control a Cybot from your PalmOS based device and SmallBASIC using the servo controller below.

If you have comments or questions about my hardware pages, try this forum.

Gallery


Cybot and a Palm running SmallBasic

The motor/PWM controller (on the white board) and the MAX232 based serial interface. The controller is powered directly by the 6V supply

With a small HotSync cable, you can even put the Palm in the Cybot

What You Need

Support This Project
SourceForge.net Logo

Warning ! Using any non free programming language could be fatal for
your Cybot (lockups, viruses, transistors blowing ...). 
For cool open source on PalmOS visit www.palmopensource.com ;-)

Programming

Below, you can take a look at a SmallBasic program which shows you the basics to move your Cybot with the Palm.

'0Px xx' commands are described in the servo controller's documentation. As the AVR controller is able to generate PWM signals, you can control the motors speed with a 8 bits precision.

In my setup, outputs 0 to 3 of the AVR based controller are wired to pins 0 to 3 of motor board. So with a:

  • '0P0 xx' command you set the forward speed (to xx in hexadecimal) of the right motor,
  • '0P1 xx' command you set the backward speed of the right motor,
  • '0P2 xx' command you set the forward speed of the left motor,
  • '0P3 xx' command you set the backward speed of the left motor.

Warning !!! As always do not turn on forward AND backward pins (i.e. '0P0 xx' and '0P1 xx' with xx>=01), or you will burn the motor controller board !

' pwm.bas
' open the serial port at 9600 bauds
OPEN  "COM1:9600" AS #1
' reset all outputs
print #1, "0P0 00\n"
print #1, "0P1 00\n"
print #1, "0P2 00\n"
print #1, "0P3 00\n"
delay 3000
10 print #1, "0P0 00\n"
print #1, "0P1 00\n"
print #1, "0P2 00\n"
print #1, "0P3 00\n"
' move forward slowly during 1 sec
print #1, "0P0 30\n"
print #1, "0P2 30\n"
delay 1000
' move forward at full speed during 2 sec
print #1, "0P0 ff\n"
print #1, "0P2 ff\n"
delay 2000
'  move forward slowly during 1 sec
print #1, "0P0 30\n"
print #1, "0P2 30\n"
delay 1000
' make a U Turn
print #1, "0P0 47\n"
print #1, "0P2 00\n"
print #1, "0P3 47\n"
delay 400
goto 10
close #1

Of course, you can use the 5 General Purpose Inputs/Outputs of the AVR controller to implement object avoidance, and so on ...

Cool links

You can also post your questions on this forum: Atmel AVR projects on SF.net