Sending commands to the Serial Servo Controller with the Propeller.
MarkUSF
Posts: 4
I've been trying to figure out the format for sending serial commands to the Parallax SSC but can't seem to get it right. Mainly I need to figure out how to translate the BS2:
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
to propeller format. I looked in the SSC manual and I couldn't figure out the sizes of ch, ra, and pw.lowbyte/pw.highbyte. i know there are objects which would allow servo control from the propeller alone but we have VERY limited time and that would create too many alterations from our design. We started with the BS2 and realized we needed the power of the Propeller late in the game.
Anyway this is what we tried and couldn't get to work:
obj
Servo : "FullDuplexSerialPlus"
Servo.init(2,3,2,2400)
Servo.str(string("!SC"))
Servo.bin(ch)
Servo.bin(ra)
Servo.bin(pw,16)
Servo.tx(13)
Also, does the SSC reset to 2400 baud everytime you press the hard reset button?
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
to propeller format. I looked in the SSC manual and I couldn't figure out the sizes of ch, ra, and pw.lowbyte/pw.highbyte. i know there are objects which would allow servo control from the propeller alone but we have VERY limited time and that would create too many alterations from our design. We started with the BS2 and realized we needed the power of the Propeller late in the game.
Anyway this is what we tried and couldn't get to work:
obj
Servo : "FullDuplexSerialPlus"
Servo.init(2,3,2,2400)
Servo.str(string("!SC"))
Servo.bin(ch)
Servo.bin(ra)
Servo.bin(pw,16)
Servo.tx(13)
Also, does the SSC reset to 2400 baud everytime you press the hard reset button?
Comments
What command are you trying to send? How did you define 'ch', 'ra' and 'pw'?
Jim-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent, only $1.
Send cash and signature to CannibalRobotics.
· pw_lowbyte := pw & $FF
· pw_highbyte := pw >> 4 & $FF
· Servo.str(string("!SC"))
· Servo.tx(ch)
· Servo.tx(ra)
· Servo.tx(pw_lowbyte)
· Servo.tx(pw_highbyte)
· Servo.tx(13)
Jeff T.
What is the sequence you are trying to send?
Jim-
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Signature space for rent, only $1.
Send cash and signature to CannibalRobotics.
The servo.bin won't work for you since it translates values into strings of "0" and "1" where these are the characters, not individual bits from the value. servo.bin(23,5) will give you the transmitted string of "10111".
Post Edited (Mike Green) : 2/26/2009 4:47:13 AM GMT