Micro SSC using PIC16F877A and MikroBasic

Hi,
I am trying to do the following:

[Visual Basic] --> [PIC16F877A] --> [SSC]

So my VB application sends servo number and position data to the PICmicro via hardware UART and then i resend that information serially to the microSSC using miniSSCII mode like this:

SOFT_UART_WRITE(255)
SOFT_UART_WRITE(8)
SOFT_UART_WRITE(B1)

where B1 is the servo position data in decimal. This communication is setup at 9600, 8N1(non-inverted).

The SSC just blinks yellow at first and when I send data to it, it ends up like this: YELLOW = ON, RED = FLASHING, and the servo doesnt move.

Please help.

Thanks.

Having just the yellow light on at first is correct, but after the first successful command the yellow light should go out, and the green light should flicker only while receiving data. Yellow on and Red flashing indicates a general communication error. This can be caused by inverted logic (or switched serial and ground wires), a changing or out of range baud rate, or a properly formatted but unrecognized command.

A couple of quick things to check are:

  1. You have the MiniSSCII protocol selection jumper on.

  2. Your PIC is connected to the “Logic Level Serial Input” pin, not the “RS-232 Serial Input” pin on the SSC.

  3. Your SOFT_UART_WRITE function knows it is sending unsigned bytes (0-255 decimal).

  4. Your SOFT_UART_WRITE function is outputting actual bytes with your specified numerical values, not ASCII character codes of the number characters.

Do you have a way to actually look at the byte values of what your PIC is outputting, like a TTL->RS232 converter you could use to connect your PIC to a computer serial port?

-Adam