Shop OBEX P1 Docs P2 Docs Learn Events
Parallax USB servo controller — Parallax Forums

Parallax USB servo controller

stuart007stuart007 Posts: 3
edited 2007-07-29 15:34 in Robotics
Hello everyone

I am new to parallax and was wondering if someone could point me in the right direction.
I just got my parallax usb servo controller and have tested it under winxp using the PSCI application, all works well. I would like to be able to send commands to the controller via a linux box.
I have compiled the kernel module for FTDI interface and the machine can see it...

gentoo ~ # lsmod | grep ftdi
ftdi_sio·············· 33544· 0
usbserial············· 27684· 1 ftdi_sio
gentoo ~ # lsusb
Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd 8-bit FIFO
I have the following code snippet from the PSC manual,
'{$PBASIC 2.5}
Sdat PIN 15 ' Serial Data I/O pin
Baud CON 396 ' Constant for 2400 baud
buff VAR Byte(3) ' temporary variable
SetBaud:
DEBUG "Setting Baudrate", CR
SEROUT Sdat, Baud+$8000, [noparse][[/noparse]"!SCSBR",1,CR]
SERIN Sdat, 6,500, SetBaud, [noparse][[/noparse]STR buff\3]
DEBUG "Baud reply: ", buff(0), buff(1), DEC1 buff(2), CR
STOP

But, how do I issue this to the controller? Do I need to compile this first? Using what?
Im a newby here ;-) so any help would be well appreciated.

Thank you
Stuart

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-29 15:34
    The PSC just looks like a serial device to Linux. You should be able to use any program / utility / command that sends data out a serial I/O channel and receives data back from that channel. The serial version of the PSC shares a single I/O pin between the transmit and receive side, but USB doesn't do that, so I think the USB PSC uses the two halves (transmit and receive) of the USB virtual serial port separately. The documentation isn't clear on this, but data sent to the PSC may also be echoed back to the PC. You'll have to try it yourself. The serial PSC manual gives the format of the messages sent back and forth. You'll be sending strings like "!SCVER?\r" to the PSC (where "\r" is the return character) and receiving (in this case) the version number of the firmware.

    If you don't understand how to send and receive serial data under Linux, then you'll have to figure that out first using whatever your programming language of choice is ... and that's beyond the scope of this forum.
Sign In or Register to comment.