Basic Stamp examples for Micro Servo Controller

I received my micro servo controller recently and have been trying, in vain, to get it to work my servos through a Basic Stamp (BS2Px24) microcontroller.

I’ve tried both MiniSSC mode as well as Pololu mode - i am gettign different combination of LED activity but the servo just wont repond correctly the way its instructed to.

Here is my program

Pololu mode:
' {$STAMP BS2px}
' {$PBASIC 2.5}
SEROUT 6, 1646, [$80, 1, 2,0,120]       

MiniSSC mode:
' {$STAMP BS2px}
' {$PBASIC 2.5}
SEROUT 6, 1646, [$FF, 0, 128]

The manual does not give enough example instructions. A little examples would be appreciated to get us started with this nice device.



Your code looks like it could be correct (we haven’t used a BS2px). I recommend sticking to the miniSSC protocol (don’f forget to put the shorting block on) since it is more simple. What do the LEDs do? What is your power setup?

- Jan

Thanks for your quick reply, Jan.
Here is further information about my setup.


5V and GND to the two pins near the servo connectors. This power is derived from the regulated power that goes to the BS2Px24.

VIN - not connected.
GND near the VIN goes to same GND as servo power mentioned above.

Logic Serial Input pin goes to one of the stamps output pin.

Logic Serial Output and Reset - not connected.

I am getting different LED combinations.

In MiniSSC mode (with shorting block ON) and this program:

' {$STAMP BS2px}
' {$PBASIC 2.5}
SEROUT 6, 1646, [$FF, 0, 128]

I get a momentarily green LED ON (for a fraction of a second) and then yellow LED ON afterwards. The servo shows slight movement (just a jerk) but its not straining when I apply load to it, which means its not getting power or signal.

Please advice. Do I need to put the SEROUT command in a DO…LOOP or just one statement takes care of the servo. I determined that the correct baud number for the BS2PX24 is 1646 (for 2400baud) and 396 (for 9600baud).


It sounds like you have a power problem. Just yellow on is what you usually get on power-up; if you get back to that after something else has happened, the servo controller most likely reset. I’m not even clear on how you’re powering the controller since you say you’re leaving VIN disconnected. It sounds like you’re powering the servos from a regulated supply, which is usually not a good way to go. I suspect that your supply cannot give the servo what it needs, so as the servo begins to move, the voltage drops and the servo controller resets.

- Jan

Hi Jan.
Thanks for your reply.
Can you please explain to me how to power the servo controller and the servos from ONE power supply?

I have a 5V,2A power supply.

  1. Where do i connect this power supply?

  2. Do i need to jumper the Vcc=Vss terminals?

  3. What is the Vcc=Vss for?

I appreciate your time.

You can connect your supply to the servo power connection and put in the Vcc = Vs jumper. This connects the on-board logic power (Vcc) to the servo power (Vs). Keep in mind that servos can draw a lot of current, so your setup might not work beyond one or two servos. A quick check is to see what happens without the servo connected and comparing that to what happens with the servo connected. If there is a difference, you most likely have a power problem.

- Jan

Hi Jan,

Wanted to thank you for your online support. I finally got my micro servo controller to work now. It responds nicely to my BS2PX24 commands. I even got it to work with my microcontroller through a visual basic application that I am writing for my robotic arm project.

I misunderstood the power wiring explained in the manual. Right now I am providing both a higher current rated 5V supply for the servos and a 5V supply to Vin.

Thanks so much.

aaqil khan

By the way, what is the meaning of Steady YELLOW LED and flashing RED LED?


The flashing red indicates a fatal error due to bad serial input. When are you seeing that?

- Jan