How to send miniSSC II protocol commands across softserial pin

I have an old SSC lite II that uses the miniSSC II protocol; it has a robotic arm attached with a total of 9 servos. I am trying to figure out how to send this simple 3 byte command structure to this servo controller board using an Uno R3; wake up byte of "255", then a servo number (0-7) followed by a position byte (0-254). The ultimate goal is to be able to program different movement routines that I can control using the Uno R3 with buttons and expand from there. I'm using the miniSSC controller because its a nice control chip to power servos from, etc. I know it is ancient stuff, but I was hoping someone would have some code I could get started with. Here is the code I have tried but am getting no response out of the board. I see no indication that it is receiving anything. I should see the LED on the servo controller blink as it receives data. On the Uno I see the RX light blinking but the TX light never does. Obviously I am new to arduino.

#include <SoftwareSerial.h>

const byte rxPin = 10;
const byte txPin = 9;

char sync = 255;
char pos = 127;
char servo = 0;

// Set up a new SoftwareSerial object
SoftwareSerial mySerial (rxPin, txPin);

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600); // set up Serial library at 9600 bps
}

void loop() {
  // put your main code here, to run repeatedly:
Serial.write(sync);
Serial.write(servo);
Serial.write(pos);
delay(1000);
pos = 254;
Serial.write(sync);
Serial.write(servo);
Serial.write(pos);

pos = 127;
delay(1000);
}

#include <SoftwareSerial.h>

const byte rxPin = 10;
const byte txPin = 9;

char sync = 255;
char pos = 127;
char servo = 0;

// Set up a new SoftwareSerial object
SoftwareSerial mySerial (rxPin, txPin);

void setup() {
  // put your setup code here, to run once:
mySerial .begin(9600); // set up Serial library at 9600 bps
}

void loop() {
  // put your main code here, to run repeatedly:
mySerial .write(sync);
mySerial .write(servo);
mySerial .write(pos);
delay(1000);
pos = 254;
mySerial .write(sync);
mySerial .write(servo);
mySerial .write(pos);

pos = 127;
delay(1000);
}

I tried this code and don't see the servo controller LED blinking to indicate that it is receiving any commands. I changed over to the arduino ports 0 and 1 to see what was being sent and all the serial monitor shows is a pattern of diamonds with a question mark in it and squares. I see people using "Serial.print(sync, BYTE);" to insure that the number is sent as a byte, which is what I need, but this doesn't seem to work anymore as it thinks that BYTE should be defined, is that old arduino code that is no longer supported? I have a program that sends commands to the servo controller that works and I have an old BS2 that will work, so I'm pretty sure the device is working. I think it must have something to do with it needing to receive a byte of 255 as a start of command identifier, then a byte of 0-254 as a servo identifier, and then a byte of 0-254 as a position identifier to move the servo to. I'm not even sure I should be seeing these numbers in the serial monitor or if the characters I am seeing indicate it is not being sent as a byte?

Yikes. I found my problem. The servo controller has a Serial in and ground that is normally connected. I connected the ground to the GND pin on the Uno R3 but it doesn't like that for some reason. Once I disconnected GND and just left the TX pin connected the servos moved. Is this a problem because I am powering the boards from two different sources? Anyway, now I just need to figure out the best way to send a prepackaged set of commands to the servo controller for each action I want and then attach that to a button. Thanks!

Well, that was short lived. I have movement but it starts doing the proscribed move and then just goes crazy moving servos that are not even called in the sketch. I'm not really sure its actually trying to do anything in the sketch, but its acting on whatever is coming over the serial line from the UNO R3. It will only move at all if I have it powered via the usb connection. If I power the Uno R3 from a separate 9v battery it does not move anything at all. Obviously I don't know enough to probably even be helped at this point. haha.

Did you connect ALL the grounds to a single point, including both power supplies?

The servo controller is powered by a power adapter giving 6v and the uno is being powered by the usb/serial connector. When I put the ground from the servo controller into GND on the Uno nothing would happen at all. After I took away that ground the servo controller moves the servos with the sketch, but it seems like random wacky movements on all servos and not just the one in the sketch, so its getting some kind of signal, I'm not sure what.

So, basically my problem is that as soon as I plug in the cable from the servo controller board "serial in" to the TX pin on the arduino all the servos start moving the arm erratically. Even If I put a blank sketch onto the Uno. Without plugging in the TX pin the servo controller starts and sets all servos to middle as normal. So something isn't right with my ports? If I power the Uno from a 9v battery then nothing happens at all; the servo starts and sets all servos to middle position and nothing else happens. I also tried to use the hardware serial and got the same result. The servo controller is only suppose to move anything if it receives the right 3 byte combination starting with 255 or 0xFF. So I'm not sure what could make it engage multiple servos and start moving erratically. I have other programs that interface with it via RJ11 and they control it fine. So I guess I'm not even at the point where I can determine if any code is working. LOL.

This is how I have things wired. Am I correct in assuming that this makes the GND shared? When I have it wired up this way the servos go to center and stay there as normal, but never move based on the sketch instructions. Also, I never see the LED on the miniSSC III blink to indicate it is receiving instructions. When I remove the GND pin the servos go crazy, the LED light blinks, but it isn't from the sketch instructions as a blank sketch produces the same results. So, is it that my sketch may not be working and that is why I see no commands being sent to the miniSSC III? Here is the program I am using. I could use any and all suggestions!

#include <SoftwareSerial.h>

const byte rxPin = 10;
const byte txPin = 9;

char sync = 255;
char pos = 127;
char servo = 0;

// Set up a new SoftwareSerial object
SoftwareSerial mySerial (rxPin, txPin);

void setup() {
  // put your setup code here, to run once:
mySerial .begin(9600); // set up Serial library at 9600 bps
}

void loop() {
 // put your main code here, to run repeatedly:
mySerial .write(sync);
mySerial .write(servo);
mySerial .write(pos);
delay(20000);
pos = 184;
mySerial .write(sync);
mySerial .write(servo);
mySerial .write(pos);

pos = 127;
delay(20000);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.