If you haven't got this working yet: Here is my explanation of how my Batch file control of the PSC worked, I hope this helps, I have a feeling what you are doing is not outputting the high byte low byte thing correctly. This is most likely a case of the blind leading the blind, but I hope it helps:
I have been able to control the servos using simple batch files such as this test.bat file which turns servo #1 to position 700:
@echo off
mode com3:2400,N,8,1 >nul
echoo $21$53$43$01$00$BC$02$0d> com3
echoo is the program off the zoomkat page that redirects DOS echos to the com port, but it only works for hex numbers
$21$53$43 is hex for "!SC" which tells the Servo Controler to wake up and pay attention, I'm going to say things you should be paying attention to. This always goes at the beginning of a command
$01 is servo #1 this ranges from $00 to $0F
$00 is the ramping function...I have not messed with it yet, so the servo gets to the specified position as fast as it can
$BC$02 is the position this is expressed by the lowbyte and highbyte of the number 700
basicly hex for 700 is 2BC
for some reason the BC goes first and the 2 goes second
you can also look at it as:
700=
1010111100
10 | 10111100
2 | BC
high byte | Low Byte
the range for position is around 300 to 1200
I can explain what these numbers actually signify but surfice it to say that 300 is the servo rotated all the way left and 1200 is the servo rotated all the way right
or if I plug the ESC in 300 is full reverse and 1200 is full forward...stop is somewhere in between.
$0d is hex for carriage return and always goes at the end of the command
I don't immagine any of you would have as much trouble with this as I did, but just in case here is a table:
Int Bin Hex High Byte Low Byte
0 0 0
1 1 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
50 110010 32 0 32
100 1100100 64 0 64
150 10010110 96 0 96
200 11001000 C8 0 C8
250 11111010 FA 0 FA
300 100101100 12C 1 2C
350 101011110 15E 1 5E
400 110010000 190 1 90
450 111000010 1C2 1 C2
500 111110100 1F4 1 F4
550 1000100110 226 2 26
600 1001011000 258 2 58
650 1010001010 28A 2 8A
700 1010111100 2BC 2 BC
750 1011101110 2EE 2 EE
800 1100100000 320 3 20
850 1101010010 352 3 52
900 1110000100 384 3 84
950 1110110110 3B6 3 B6
1000 1111101000 3E8 3 E8
1050 10000011010 41A 4 1A
1100 10001001100 44C 4 4C
1150 10001111110 47E 4 7E
1200 10010110000 4B0 4 B0
Based on a question that came up in the following forum I’m wondering if anyone has tried running the PSC at 3.3V? Then you should be able to connect the serial line directly to the Propeller I/O line.
I got a chance to test the PSC on a Propeller Demo Board from 3.3V and was able to talk directly to it, get the firmware version and move a servo, so you won’t need to worry about connections anymore. Just power the PSC from the 3.3V supply and there will be no 3.3V/5V issues. I hope this helps out anyone wanting to use the PSC from a Propeller. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
Comments
If you haven't got this working yet: Here is my explanation of how my Batch file control of the PSC worked, I hope this helps, I have a feeling what you are doing is not outputting the high byte low byte thing correctly. This is most likely a case of the blind leading the blind, but I hope it helps:
I have been able to control the servos using simple batch files such as this test.bat file which turns servo #1 to position 700:
@echo off
mode com3:2400,N,8,1 >nul
echoo $21$53$43$01$00$BC$02$0d> com3
echoo is the program off the zoomkat page that redirects DOS echos to the com port, but it only works for hex numbers
$21$53$43 is hex for "!SC" which tells the Servo Controler to wake up and pay attention, I'm going to say things you should be paying attention to. This always goes at the beginning of a command
$01 is servo #1 this ranges from $00 to $0F
$00 is the ramping function...I have not messed with it yet, so the servo gets to the specified position as fast as it can
$BC$02 is the position this is expressed by the lowbyte and highbyte of the number 700
basicly hex for 700 is 2BC
for some reason the BC goes first and the 2 goes second
you can also look at it as:
700=
1010111100
10 | 10111100
2 | BC
high byte | Low Byte
the range for position is around 300 to 1200
I can explain what these numbers actually signify but surfice it to say that 300 is the servo rotated all the way left and 1200 is the servo rotated all the way right
or if I plug the ESC in 300 is full reverse and 1200 is full forward...stop is somewhere in between.
$0d is hex for carriage return and always goes at the end of the command
I don't immagine any of you would have as much trouble with this as I did, but just in case here is a table:
Int Bin Hex High Byte Low Byte
0 0 0
1 1 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
50 110010 32 0 32
100 1100100 64 0 64
150 10010110 96 0 96
200 11001000 C8 0 C8
250 11111010 FA 0 FA
300 100101100 12C 1 2C
350 101011110 15E 1 5E
400 110010000 190 1 90
450 111000010 1C2 1 C2
500 111110100 1F4 1 F4
550 1000100110 226 2 26
600 1001011000 258 2 58
650 1010001010 28A 2 8A
700 1010111100 2BC 2 BC
750 1011101110 2EE 2 EE
800 1100100000 320 3 20
850 1101010010 352 3 52
900 1110000100 384 3 84
950 1110110110 3B6 3 B6
1000 1111101000 3E8 3 E8
1050 10000011010 41A 4 1A
1100 10001001100 44C 4 4C
1150 10001111110 47E 4 7E
1200 10010110000 4B0 4 B0
Based on a question that came up in the following forum I’m wondering if anyone has tried running the PSC at 3.3V? Then you should be able to connect the serial line directly to the Propeller I/O line.
http://forums.parallax.com/showthread.php?p=657595
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I got a chance to test the PSC on a Propeller Demo Board from 3.3V and was able to talk directly to it, get the firmware version and move a servo, so you won’t need to worry about connections anymore. Just power the PSC from the 3.3V supply and there will be no 3.3V/5V issues. I hope this helps out anyone wanting to use the PSC from a Propeller. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My computer, http://forums.parallax.com/showthread.php?p=630466
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support