Parallax Servo Controller with AVR
Hi,
I am trying to control the servo controller serially with atmega128 microcontroller.
I am sending the commands as mentioned in the documentation e.g "!SC"+ c+r+pwl+pwh+$0D at 2400 8 N 2.
I am sending the channel number, the ramping rate and the position ( high and low byte) as unsigned 8 bit integers.
I checked my output from the microcontroller with my pc at 2400 and the required configuration, and i can see the desired output.
the servo controller works fine with my stamp.
Is there anything that i am missing that needs to be addressed?
Thank you.
hussain
I am trying to control the servo controller serially with atmega128 microcontroller.
I am sending the commands as mentioned in the documentation e.g "!SC"+ c+r+pwl+pwh+$0D at 2400 8 N 2.
I am sending the channel number, the ramping rate and the position ( high and low byte) as unsigned 8 bit integers.
I checked my output from the microcontroller with my pc at 2400 and the required configuration, and i can see the desired output.
the servo controller works fine with my stamp.
Is there anything that i am missing that needs to be addressed?
Thank you.
hussain
Comments
You might try monitoring the connection between the atmega128 and the servo controller using your PC. Most I/O pins can drive several inputs and the atmega128 should be able to drive both the servo controller and the input to a TTL to RS232 converter or TTL to USB serial adapter (don't connect the outputs together).
when i send int c= 1, r=1, pwl=1 pwh =1 i get this output. i wonder what it means.
!SC^A^A^A^A
apparently it is interpreting 1 as ^A (2 bytes).
If so, do they light/blink in the same pattern as when you connect the PSC to your Stamp?
Also, what position value do you expect (want) the servo to get from·the combined pwl=1,pwh=1 when you send the two unsigned 8-bit integers?
PAR
After checking it with my computer and using the USB GUI, i observed that the led only blink while the transmission is in progress and it readily turns off. With my AVR the led is always ON and it blinks when i send the serial data and goes back to On.
I am going to test it with the stamp today and observe how that behaves, and get the serial output to my computer and observe any changes.
Post Edited (Mouse_Matrix) : 4/11/2007 2:34:51 PM GMT
i make sure that i dont send any command that makes the controller write anythin on the line( enough for my purposes)
is that fundamentally correct approach?