Parallax Servo Controller (Serial) problem???
Hi all!
ı use the parallax servo controller(serial) http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/ServoControllerManualRev%20B%20v2_4.pdfdevice to connect 16 Hi_tech servo motor..
I programmed 2400baud rate no problem. ı can control all servos..
but ı try the servo controller device in 38400baud rate between Pic18f452..
in datasheet tell me if ı want to use in 38400 baud rate first send !SCSBR after 0 or 1(0 for 2400 1 for 38400) and $0d for end.
I use PICC compiler
ı programmed for 2400
printf("!SCSBR");
putc(0) (for 2400 baud)
putc(13)
......
....
printf("!SC");
putc(0); for 0.channel
putc(0); for ramp value=0
putc(0xE2);servo position low
putc(0x03);servo position high
putc(0x0D);break
it is working...
but ı want 38400 baud rate...
ı changed program this
printf("!SCSBR");
putc(1) (for 38400 )
putc(13)
......
....
printf("!SC");
putc(0); for 0.channel
putc(0); for ramp value=0
putc(0xE2);servo position low
putc(0x03);servo position high
putc(0x0D);break
it isnt't working.oscillator is 8MHZ...
thank you for your help!!!
ı use the parallax servo controller(serial) http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/ServoControllerManualRev%20B%20v2_4.pdfdevice to connect 16 Hi_tech servo motor..
I programmed 2400baud rate no problem. ı can control all servos..
but ı try the servo controller device in 38400baud rate between Pic18f452..
in datasheet tell me if ı want to use in 38400 baud rate first send !SCSBR after 0 or 1(0 for 2400 1 for 38400) and $0d for end.
I use PICC compiler
ı programmed for 2400
printf("!SCSBR");
putc(0) (for 2400 baud)
putc(13)
......
....
printf("!SC");
putc(0); for 0.channel
putc(0); for ramp value=0
putc(0xE2);servo position low
putc(0x03);servo position high
putc(0x0D);break
it is working...
but ı want 38400 baud rate...
ı changed program this
printf("!SCSBR");
putc(1) (for 38400 )
putc(13)
......
....
printf("!SC");
putc(0); for 0.channel
putc(0); for ramp value=0
putc(0xE2);servo position low
putc(0x03);servo position high
putc(0x0D);break
it isnt't working.oscillator is 8MHZ...
thank you for your help!!!
Comments
you can get more help if you attach your COMPLETE code to a posting.
the easiest way to attach your COMPLETE code is to use the archive-function of the propellertool.
Make your main spin-file th topobjectfile and then click file - archive - project
This will create a zip-file that contains ALL files that are nescessary for compiling your code
so everything will be included.
With the complete code it is much easier to analyse the problem.
Other ways it is just guessing through the fog.
one quick guess from me is
do you use a serial driver written in SPIN or written in PASM?
SPIN-drivers are only useful for maximum 19200 baud. 38400 is to fast for them
Did you try to switch the baudrate using a serial terminal program running on a PC?
best regards
Stefan
You didn't show anything in your program that changes the PIC's Baud. Do keep in mind that the PIC, depending on how the serial timing is done, may not handle 38400 Baud accurately. That may be part of the problem.
Best regards