Microservo Board, Pololu and Bascom

Hello!

I despair straight of the Microservo board, Pololu and Bascom.
With the mini SSC II mode the servo moves correct. (0-5° is adjusted, more goes also)

Now i write the same function with the Pololu mode. Not good … The yellow LED is flashing and the red LED is always on. The jumper is removed for the Pololu mode.

The docu for this board doesn’t help me

Here is my code for the 2 modes, i hope you can help me to write a bascom code for the pololu mode.

Mini SSC II Code

$regfile = "m128def.dat"
$framesize = 32
$swstack = 32
$hwstack = 32
$crystal = 16000000
$baud = 19200
$baud1 = 9600

Open "com2:" For Binary As #2                               'Output over second serial interface

Sound Portg.2 , 100 , 450

Dim Servonumber As Byte
Dim Servoposition As Byte

Do
   Servonumber = 7                                          'Servonumber
   Servoposition = 5                                        'Position
   Print #2 , Chr(255) ; Chr(servonumber) ; Chr(servoposition);
   Waitms 100
   Servonumber = 7                                          'Servonumber
   Servoposition = 0                                        'Position
   Print #2 , Chr(255) ; Chr(servonumber) ; Chr(servoposition);
   Waitms 100
Loop
End[/code]

[u]<font color="green">Pololu Code</font>[/u]
[code]$regfile = "m128def.dat"
$framesize = 32
$swstack = 32
$hwstack = 32
$crystal = 16000000
$baud = 19200
$baud1 = 9600

Open "com2:" For Binary As #2                               'Output over second serial interface

Sound Portg.2 , 100 , 450

Dim Servodevice As Byte
Dim Servocommand As Byte
Dim Servonumber As Byte
Dim Servodata1 As Byte

Do
   Servodevice = 1                                          'Device-Number
   Servocommand = 4                                         'Command
   Servonumber = 7                                          'Servonumber
   Servodata1 = 5                                           'Position
   Print #2 , Chr(128) ; Chr(servodevice) ; Chr(servocommand) ; Chr(servonumber) ; Chr(servodata1);
   Waitms 100
   Servodevice = 1                                          'Device-Number
   Servocommand = 4                                         'Command
   Servonumber = 7                                          'Servonumber
   Servodata1 = 0                                           'Position
   Print #2 , Chr(128) ; Chr(servodevice) ; Chr(servocommand) ; Chr(servonumber) ; Chr(servodata1);
   Waitms 100
Loop
End

Hello,

Red LED on with the yellow flashing means that the controller thinks the baud rate is too slow. I’m not sure how the baud rate is being determined, so you might check on that or try some other speeds. Also, try sending one byte at a time and see when the problem occurs.

- Jan

Yeah thanks!

Can you also tell me how i can run 2 or more servos at the same time?

I’m not sure what you mean. To run multiple servos, just send commands to the appropriate servo numbers. The servo controller will automatically control all servos at the same time.

If you want two servo controllers off of the same serial line, you have to change the servo numbers on one of the units. You would then have one controller control servos 0-7, and the other 8-15. After that, you can connect the same serial line to both controllers.

- Jan

Sure.

I can send 2 commands (2 lines of code) for 2 servos.
But i want to know if there is 1 command (1 line) for 2 or more servos.

Like this damn example:

Print #2 , Chr(255) ; Chr(1,2,3) ; Chr(20,40,60);

Servo 1 - 20°
Servo 2 - 40°
Servo 3 - 60°

would be nice :wink:
… and very nice at Pololu mode

Sorry, but you’ll have to send one command per servo.

- Jan

Ah ok, no problem! Thanks for your info and help.
Greetings