Micro Serial Servo Controller (8)

for some reason, when i try to run Command 4 (absolute), i get a flashing red LED. does anyone have an explaination on what i could be doing wrong, a sample program for the BS2pe, or both?

I’m having the same problem. My servocontroller was working fine, including responding to command 4, then I hooked power up to it backwards (d’oh!) and it gave out a little puff of smoke. It stll lights up yellow when I power it, and the green light flashes when I sned data. It even commands the servos to their home positions, but it won’t do more than that. When I try sending command 4, among other things, the yellow light comes back on and the red flashes. Any possibility you did the same thing? Does your controller have any other functionality currently?

could you send your coding? i made a few changes, and i started using the “3” command and it’s working fine

Sure, here is my method in C:

void put(int servo, int angle) {
unsigned char buff[6];
DWORD len;

unsigned short int temp;
unsigned char pos_hi,pos_low;

temp=angle & 0x1f80;
pos_low=angle & 0x7f;

buff[0]=0x80;//start byte
buff[1]=0x01;//device id
buff[2]=0x04;//command number
buff[3]=servo;//servo number
WriteFile(fd, &buff, 6, &len, 0);



Put is my coding holdover from putc, the method for moving servos in the library included with the mini-sscII servocontrollers. They seem so huge now!

Glad your controller is working, I think mine is toast. It gives me the red flashey for all sorts of commands, like checking the servo numbers. I tested all the connections and resistors, and the PIC is still doing some things. It might be the transistor in the RS-232-to-TTL part. I’ll try using the TTL input one of these days.

uh… I used Pbasic V. 2.5. what did you use?

I’m running the controller directly from a PC serial port, with a program written in C.

The method takes a servonumber and a position as integers. It converts the position integer into hex for the serial port and splits that number into it’s upper and lower bits. It then sends the data to the serial port, along with start byte, device id, command number and servo address number. FD is the handle of the com port, which is set and opened by another method earlier in the program.

To give credit where credit is due, an ECE friend helped me with the communications protocol part of the code. I understand how it works, but I really couldn’t have written something so short and sweet myself.