Micro Maestro from ATMega128

Hi All
I would like to control my new fancy Micro Maestro from a microcontroller.
I have checked out the command protocols here
pololu.com/docs/0J40/5.c

And am using a printf function from my microcontroller in c.
fprintf(com1, “255, 0, 140, 255, 1, 140, 255, 2, 140 \n\r”)

I am receiving this data
255, 0, 140, 255, 1, 140, 255, 2, 140
255, 0, 127, 255, 1, 127, 255, 2, 127
255, 0, 140, 255, 1, 140, 255, 2, 140
255, 0, 127, 255, 1, 127, 255, 2, 127

from the microcontroller through a USB to serial adapter to my pc.
The data is received at 9600bps.
When I plug the TX line of the microcontroller into the RX line of the maestro, I dont get any movement. I have tested the maestro via USB though to confirm that my servos work.
Am I doing something wrong with the command protocal or do I need a converter etc?
Thanks for all help!

Hello. It looks like you are trying to send Mini SSC commands to your Maestro. Each Mini SSC Command is supposed to simply be three bytes, but you are actually sending an ASCII-encoded string that contains the decimal representations of three numbers, separated by comma characters and space characters. For example, you should send the byte 255 to start the command, but instead you are sending the ASCII string "255, " which is actually 5 bytes.

You should find a function available in your environment, such as fputc, that lets you write arbitrary bytes to the COM port, including 0x00.

Also, you should go into the Maestro Control Center software and configure your Maestro be in “UART, fixed baud rate” mode with a baud rate of 9600.

–David

Hi David
I have implemented the following into my code
My understanding is that now the servo on port 0 should move back and forth

fputc(com1, “255”);
fputc(com1, “0”);
fputc(com1, “127”);
_delay_ms(1000);
fputc(com1, “255”);
fputc(com1, “0”);
fputc(com1, “135”);
_delay_ms(1000);

Do I have to send the 255 twice? Do I have to have commas like in the manual?
Thanks for the reply mate

I think you are getting the arguments of fputc wrong. Please consult the documentation of fputc online, or if there is some documentation of it specific to your programming environment then consult that. This link will probably be relevant to you:
nongnu.org/avr-libc/user-man … 3ccaed9014

Yes, you need to send the 255 every time you send a Mini SSC command because it is part of the format of that command.

No.

–David