Mystery uSSC lights

What do a solid yellow and flashing red LED mean?
Also, any idea why single-stepping through this C code (for 16 MHz AVR, 9600 baud) works (i.e., no LEDs light except a flash from the green one during transmission), while running at full speed doesn’t (i.e., produces the previously mentioned yellow-red combo)? Thanks.

		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0x80;	// Init byte
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0x01;	// Device type of servo controller
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0;	// Servo number
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 4;	// Command:  Set position, absolute
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = LEFT_0_D1;	// Send high bits of position
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = LEFT_0_D2;	// Send low bits of position
		   wait(1000);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0x80;	// Init byte
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0x01;	// Device type of servo controller
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0;	// Servo number
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 4;	// Command:  Set position, absolute
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = RIGHT_0_D1;	// Send high bits of position
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = RIGHT_0_D2;	// Send low bits of position
		   wait(1000);

Hello.

A flashing red LED indicates some kind of fatal error, usually caused by a serial port error. If the problem does not show up when stepping through your program, I would suspect a power supply problem. Are you running the servos from the same supply as the logic? If you have access to an oscilloscope, you should take a look at the serial line and servo controller power supply when you are running at full speed and getting the error.

By the way, we recommend the newer Micro Maestro unless you specifically need some feature of the older servo controller that the new one does not have.

- Jan

Thanks for the reply, Jan. I managed to get the LEDs to behave by waiting 2 msecs between writing successive bytes to the controller. Don’t know why it would matter, but waiting anything less triggers the flashes. I have a scope, so I can tell that everything echoes properly, except the last byte in a chain of 6, which gets slightly phase-shifted in the echo. Nevertheless, I still don’t get a signal on the signal pin for the targeted servo. Logic and servos run off the same 5V p/s (AC/DC, not batteries), with separate connections on the uSSC board. I’m running in Pololu mode, with absolute position (command 4), so I don’t send a command 0, or a command 1. Just 0x80, 1, 4, 0, 7, 104 (the last two numbers decode to 1000 by my reckoning). I ordered a Micro Maestro, but since I have some of these uSSCs already, I’d like to get them working and use them up.

Do you have servos connected when you’re having the problems? Do they go away when you remove the servos?

- Jan

I can’t really monitor the servo signal when the servo is connected as there’s no place to clip on to (at least, not without a lot of effort). All I can say is, there’s no servo signal I can detect when the servo isn’t connected, and the servo doesn’t do anything when it IS connected.

What about the other problem you were having, that you solved by adding the 2ms delays? Was that there whether the servos were connected or not? You might have inadvertently changed the servo IDs on your servo controller, so you should try setting them back to 0-7. Can you post some screen shots from your scope showing the serial line and power line?

- Jan

Yes.

In the attached screen shot, A1 is the serial line and A2 is the supply. If I’m using command 4 (absolute positioning), are there any other commands I’m supposed to use first? Doesn’t look that way from the documentation, but maybe I’m not setting up right.

Below is the relevant code. Not shown is my UART initialization routine which sends a 0 byte to get the baud rate set before I start sending real data.

		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0x80;	// Init byte
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 1;	// Device type of servo controller
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 4;	// Command:  Set position, absolute
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0;	// Servo number
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = LEFT_0_D1;	// Send high bits of position
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = LEFT_0_D2;	// Send low bits of position
		   wait(i);
		   wait(1000);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0x80;	// Init byte
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 1;	// Device type of servo controller
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 4;	// Command:  Set position, absolute
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = 0;	// Servo number
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = RIGHT_0_D1;	// Send high bits of position
		   wait(i);
		   while ((UCSR1A & (1 <<UDRE1)) == 0);  // Wait until UDR is empty
		   UDR1 = RIGHT_0_D2;	// Send low bits of position
		   wait(i);
		   wait(1000);


Are you saying a 0 gets sent out the serial port as your first byte? If so, that should be your problem since the controller needs the 0x80 first.

Command 4 works by itself, but you might want to use other commands for setting speeds or turning servos off.

- Jan

A 0 gets sent when the system powers up, but whenever I send a command chain of 6 bytes to the uSSC, the 0x80 is the first byte in the chain. Are you saying the first byte the uSSC sees on power up has to be a 0x80? It’s easy enough for me to send that instead of a 0, but will the uSSC then expect to see a complete, legitimate chain, so I need to add that to my initialization code? Or, if an isolated 0x80 is OK, when I next have to communicate with the uSSC, do I start again with a 0x80?

Got it working in Mini SSC mode which is adequate for my application. Don’t know why it was so finnicky in Pololu mode.

In both modes, the correct first byte is crucial since that is how the servo controller determines the baud rate.

- Jan