28830 Parallax Inc, 28830 Datasheet - Page 4

Interface Modules & Development Tools Propeller Servo Controller

28830

Manufacturer Part Number
28830
Description
Interface Modules & Development Tools Propeller Servo Controller
Manufacturer
Parallax Inc
Datasheet

Specifications of 28830

Interface Type
USB, Serial
Data Bus Width
8 bit
Operating Supply Voltage
5 V
Product
Interface Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Communication Protocol
The PSCU supports several commands that are sent to it via serial protocol. These commands can come
from the TTL serial interface or the USB port. Both serial inputs run at 2400 bps by default at startup
and can be switched to 38.4 kbps by sending a command to the PSCU. The PSCU does not support auto-
baud with the default firmware installed. The data must be sent non-inverted (true) using 8 data bits, no
parity and 1 or 2 stop bits.
Command Set
Each command is preceded with an exclamation point (!) and the letters, “SC”, so every command will
appear as, “!SCxxxx” $0D, where, “!SC” is the preamble, “xxxx” are the command/parameter bytes and
$0D is a trailing carriage return. Every command message contains exactly eight (8) bytes including the
carriage return. All pulse width values are specified in 2 µs increments, so to send a 1 ms pulse to a
channel you would use a pulse width value of 500 (500 x 2 µs = 1000 µs = 1 ms).
Position Command – Set Position of a Servo Channel
Syntax: “!SC” <channel> <ramp speed> <lowbyte> <highbyte> <CR>
Reply: None
To move a servo to a location you must write a position command to the PSCU. Each position command
is comprised of the preamble, the channel, the ramp speed, lowbyte/highbyte of the pulse width in 2 µs
increments and a carriage return ($0D). The preamble is “!SC”. The channel is a byte value from 0 – 15
(16 – 31 if this is the second unit in a network). The ramp speed is a byte value from 0 – 63 that
controls the speed the servo moves to its new position.
' {$STAMP BS2}
' {$PBASIC 2.5}
ch VAR Byte
pw VAR Word
ra VAR Byte
Sdat CON 15
baud CON 396
ra = 7
ch = 11
DO
LOOP
Note: Not all servos have the same range limits. If your servos appear to strain when the
pulse width is set to 250 you should increase this value up to 260 or higher as needed to
prevent the servo from straining. Similarly, if your servo strains when the pulse width is set
to 1250 you should reduce this value as needed to prevent the servo from straining.
Copyright © Parallax Inc.
pw = 1100
SEROUT Sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 1000
pw = 300
SEROUT Sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
PAUSE 1000
Propeller Servo Controller USB (#28830)
v1.0 8/24/2009 Page 4 of 12

Related parts for 28830