View Full Version : Servo control-Basic Atom?

09-10-2008, 06:59 PM
Hello to all.

I have been loooking around a lot and I can't seem to find how to control servos with a Basic atom 28. The pro has the Hservo command. I assumed I coudl control some servos with the Basic Atom. I only have 4-5 so it's not that bad.

I can always connect the SSC-32 to the bot board, but I find it useless to have two board to control less than 5 servos. I also wanted to control it with a Ps2 so the bot board was interesting for this matter.

Can anyone help me on this matte?

Thanks a lot :D


09-10-2008, 07:47 PM

Page 138 explains the syntax. You have to pull the I/O pins low first, syntax is:

pulsout (port #),(position 1000-2000, etc)

The below sample code would center servos on channel 0, 1, & 2. Remember to always have that 20 ms pause after a servo command.

low 0
low 1
low 2

pulsout 0,1500
pulsout 1,1500
pulsout 2,1500
pause 20
goto loop

09-11-2008, 05:38 PM
Well, I can't make it work with the Basic ATom, it won't connect.

Anyway I tried with the BS2 and it won't work! I don't know what I'm doing wrong!


09-11-2008, 08:00 PM
Exactly what won't connect?

09-11-2008, 08:05 PM
Well, I tried both on the mini-ABB just to have the same board. I put the power, the light lights up. Then I use the Basic micro compiler for the atom 28. It doesn't detect anything with my USB to serial or just serial. Then I put in the Basic stamp with it's compiler and it works great (exept that it doesn't seem to control the servos, but that's probably my code that isn't correct) and compiles the program.


09-29-2008, 12:41 AM
On a related note:

What does the code look like for getting a servo to sweep from left to right? basic atom code pls

09-29-2008, 12:44 AM
and change of subject again, this code seems awfully similar to PICAXE programming? am i right?

09-29-2008, 12:48 AM
Specs say basic atom 28 is built around the 16F876 PICmicro MCU.

09-29-2008, 12:56 AM
ooooooooowwwwwwwww............. yum yum........... that might be some potential fun....

09-29-2008, 12:57 AM
does it use the same three pin serial download cable...? gnd pos & serial comms?

09-29-2008, 01:02 AM

09-29-2008, 01:03 AM

09-29-2008, 01:30 AM
obviously not... this is the basic command manual for PICAXXE ICs, not sure on how much help it will be, but it might be something to look at.


just uploaded it to my website now.

09-29-2008, 10:07 PM
Elios ty for all your help.

I ended up with this:
'Basic Atom 28
range var word
range = 1500
low p0
pulsout p0,1500
pause 40
pulsout p0,range
pause 40
range = range +10
if range < 2200 then sweep
pulsout p0,range
pause 40
range = range -10
if range > 600 then sweepl
goto sweep

That pause 40 made the motion of the servo way less twitchy...

It works, since I'm a complete noob.. I do not think it too elegant or efficient. Varying the +10 , -10 to diff numbers lets me control the speed of the sweep.

Maybe someone can rewrite it for me. The servo I am using is a hs-311 datasheet says max values for rotation are 600 and 2200.

I'm using a Bot Board II.

09-29-2008, 11:08 PM
ok, great that i was a help.... lolz