28830 Parallax Inc, 28830 Datasheet - Page 6

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
If either the BASIC Stamp or the PSC was reset without the other resetting they could be left in the state
of different baud rates. When checking the firmware version using the VER? command, the BASIC Stamp
2 should employ its timeout feature. At the timeout label you can then attempt to VER? the PSCU at the
other baud rate. Once identified the baud rate could then be set properly and the program can resume.
RSP – Report Servo Position
Syntax: “!SCRSP” <channel> <CR>
Reply: <channel> <highbyte> <lowbyte>
The RSP command returns the pulse width value last set for the specified channel. When the RSP
command is sent to the PSCU it replies with three bytes. The first byte is the channel, the second and
third bytes are the highbyte and lowbyte of the pulse width, respectively.
' {$STAMP BS2}
' {$PBASIC 2.5}
ch VAR Byte
pw VAR Word
ra VAR Byte
x VAR Byte
Buff VAR Byte(3)
Sdat CON 15
baud CON 396
Init:
DO
LOOP
WRservo:
Within the DO…LOOP, this program sets the pulse width (pw) to one extreme or the other and writes this
value to the PSCU. The ramp value (ra) was set to give the program time to poll the servo position
several times. Within the WRservo subroutine the new pw is sent and the position is polled five times,
once per second. A DEBUG command is used to format the reply and print it to a window for you to
view.
Copyright © Parallax Inc.
ra = 15: ch = 0
pw = 1100: GOSUB WRservo
pw = 300: GOSUB WRservo
SEROUT Sdat, Baud+$8000,["!SC", ch, ra, pw.LOWBYTE, pw.HIGHBYTE, CR]
FOR x = 0 TO 4
NEXT
RETURN
PAUSE 1000
SEROUT Sdat, Baud+$8000, ["!SCRSP", ch, CR]
SERIN Sdat, Baud, 1000, Init,[STR Buff\3]
DEBUG "Servo ", DEC buff(0), " ", HEX2 buff(1), " :", HEX2 buff(2), CR
Propeller Servo Controller USB (#28830)
v1.0 8/24/2009 Page 6 of 12

Related parts for 28830