Software for Parallax Servo Controller (PSC) USB
Oualid
Posts: 12
I would like to send some commands to Parallax Servo Controller (PSC) USB.
For example to identify Firmware Version Number:
My question is: Which software should I use to send the code above to PSC?
For example to identify Firmware Version Number:
'{$PBASIC 2.5} Sdat PIN 15 ' Serial Data I/O pin Baud CON 396 ' Constant for 2400 baud buff VAR Byte(3) ' temporary variable FindPSC: ' Find and get the version DEBUG "Finding PSC", CR ' number of the PSC. SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SCVER?",CR] SERIN Sdat, Baud, 500, FindPSC, [noparse][[/noparse]STR buff\3] DEBUG "PSC ver: ", buff(0), buff(1), buff(2), CR STOP
My question is: Which software should I use to send the code above to PSC?
Comments
I'm not sure you're really asking the question you want to. The reason I say that is the question you asked pretty much has a self-defining answer, based on the sample code you provided.
You have shown an example of a Parallax PBASIC Program, so the answer to your question as to what software to use, is Parallax PBASIC. If on the other hand you're wondering which VERSION of PBASIC to use, always use the latest version available. At present, that's Version 2.2 which can be downloaded from here:
http://www.parallax.com/html_pages/downloads/software/software_basic_stamp.asp
If your confusion is in justifying the "'{$PBASIC 2.5}" compiler directive, and the present Version number of the Editor/Compiler (2.2 as noted above) the two DO NOT necessarily coincide. The latest PBASIC Compiler Version is 2.2 and the example program was written to be run on ANY PBASIC Compiler which supports the PBASIC 2.5 syntax level. I hope that clears that up.
Just as an aside, you will need the baudmode parameters to be the same in both your SERIN and SEROUT commands before the example program will operate properly.
Regards,
Bruce Bates
My question was "what software to use" and you gave me the answer.
Do you mean "BASIC Stamp Windows Editor version 2.2" ?
In fact I downloaded "BASIC Stamp Windows Editor version 2.2" but I couldn't connect to the PSC.
I know that the PSC works fine because I tested it with my own application that I wrote in Delphi.
For instance the code that I wrote down is taken from the PDF document "Parallax Servo Controller (#28023) – Rev B" on page 4.
Is it incomplete?
Regards.
/Oualid
As I noted earlier, the sample program which you listed will NOT work the way it is, although it WILL compile correctly.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
That's why I can't connect to the PSC!
Do you know if the following command works correctly on the PSC?
RSP Command – Report the Position of a Servo Channel
Syntax: “!SCRSP” x $0D
Reply: x y z(where x is the channel number, and z:y is the value reported)
I send:
"!SCRSP","1","char(13)" by using an application that I wrote in Delphi to get the position of the servo connected to channel 1.
What I receive from PSC is x=1 but the values of y and z are missing.
The firmware version of PSC is 1.4
Any idea?
··· The documentation at the following web page really has everything you need.· You will need to send the ASCII string !SC which is 3 characters, followed by the binary value (one byte) of the channel number, followed by the binary value (one byte) of the ramping value, followed by two bytes for the lowbyte and highbyte of the pulsewidth, followed by a carriage return character.· This comes out to 8 characters being sent.· Other commands follow a similar structure.· As long as you have the USB Driver installed, then the PSC is assigned a COM Port, and can be communicated with just as any serial device, from any application that can open a COM channel at the appropriate speed and parameters.
http://www.parallax.com/detail.asp?product_id=28023
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
RSP Command – Report the Position of a Servo Channel
Syntax: “!SCRSP” x $0D
Reply: x y z(where x is the channel number, and z:y is the value reported)
What I receive from PSC is x (channel number) but I don't receive any z:y value.
My question is: Does PSC software work correctly?
Post Edited (Oualid) : 10/21/2005 7:38:27 AM GMT
(The above code was modified to add the channel specification that I missed, sorry)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (Chris Savage (Parallax)) : 10/21/2005 4:07:55 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Now it works.