I have pololu.com/products/pololu/0727/ that servo controller. And I am having a few problems with it. First off I have the servo power hooked up to a 4AA cell battery pack. I have the board power hooked up to my stk500. and the serial (ttl) is hooked up to my stk500. And I am using avrstudio 4. For my oscillator I am using the stk500 osc at 3.686 mhz and using 9600 baud.
Now I am using the servo controller in mini-ssc mode. and I am send the right string to it but when I turn my stk500 off then back on again i get an error on the lights ON THE SERVO CONTROLLER. I get a solid yellow and a flashing red. I am guessing this means that there is some kind of transmission error, since it really doesn’t say what a flashing red light means in the manual for the servo controller.This mostly happens for some reason when I sed 0x40 as the position. if I do 0x4F or 0x6F or 0x7F or 0x8F or 0x9F it works fine most of the time. but for some reason it doesnt always work. and it almost never works with 0x40 as the position.
Could this be because I still have some % error in the baud rate? it is .0005% error I believe.
The flashing red LED indicates a serious error, which in your case is being caused by turning off your main microcontroller. This makes the serial line go low, which is an invalid state since it should be high when idle. To reset the servo controller, pull the reset line low. If you don’t have an extra I/O line available to control the servo controller reset, you can tie the servo controller reset to your microcontroller’s reset line.
The baud rate doesn’t have to be a standard baud rate; you just need to keep it the same once you begin. The error you have is so negligibly small that I wonder if you mistyped it. Up to a few percent in the error (4% might be pushing your luck) is okay.
Is your problem limited to when you power-cycle your microcontroller?
After reading what you said, I went and tryed it. I tied the reset line directly to gnd so I can physucally control when to reset it. still having some trouble. In my code I have 255,2,40 being sent to the servo controller over USART in a while(1) loop so it does it forever.
When I tryed to see if what you said would work I turn on my microcontroller and kept it running through everything. I took the jumped I had connected directly to ground and put it on the servo controller reset pin. This cause all the LEDs on the board to go off. I removed the jumper from the reset pin of the servo controller and the LEDs relit to the same thing. a solid yellow and flashing red. If I did this 10 times I could only get the green LED to work maybe once or twice.
Now just to double check I am doing it right. while sending the info for this, I am sending it one character at a time over the USART.
I recalculated the % error and it is 1^-4
Also, is it ok to reset this while data is being sent in a way like shown above
The reset while transmitting will cause errors because the servo controller expects to see the 0xFF first (that’s how it figures out the baud rate). If it sees the 0x02 or 0x7F first, it will interpret that as 0xFF at a different baud rate.
Ok, Now I got that to work. But now I am trying to set the speed in pololu mode. I send the 0x80, 0x01, the mode bit servo # and data bit for the speed then I send a new set thats tells the servo where to go. and I go from speed 1 to speed 127 and it doesn’t seem to change.
The servo speed is different for each servo, so make sure you are setting and looking at the same servo. Also, the speed settings are held in RAM, so make sure you’re not resetting the servo controller between setting the speed and setting the position(s).
Since you didn’t explicitly specify all of what you’re sending, make sure it’s something like
0x80, 0x01, 0x01,<servo number>, 0x01, which will give you the slowest speed for the servo channel you are setting.