28830 Parallax Inc, 28830 Datasheet - Page 9
![Interface Modules & Development Tools Propeller Servo Controller](/photos/15/89/158948/28830-l_sml.jpg)
28830
Manufacturer Part Number
28830
Description
Interface Modules & Development Tools Propeller Servo Controller
Manufacturer
Parallax Inc
Datasheet
1.28830.pdf
(12 pages)
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
Default Position Command – Set Default Position of a Servo Channel
Syntax: “!SCD” <channel> <lowbyte> <highbyte> <CR>
Reply: None
By default all servos move to the center position at startup (they receive a 1.5 ms pulse). The default
position of all servo channels can be customized and stored in the EEPROM to be used on startup in place
of the center positions. To set a new startup position for a servo channel the following must be sent to
the PSCU: “!SCD” followed by a byte value of 0 – 31 for channel, two bytes for the pulse width in 2 µs
units in lowbyte/highbyte format, and finally a carriage return ($0D). Each servo channel can be set
independently but for the PSCU to use these on startup you must have first sent the EDD command
(listed above) to 1. The following code can be used to set the default position for channels 0 through 31
to 500 (1 ms) using a BASIC Stamp 2. If you only have one PSCU connected only channels 0 – 15 will be
affected by this program.
' {$STAMP BS2}
' {$PBASIC 2.5}
ch
pw
Sdat
Baud
pw = 500
Set_Default:
The PSCU must be reset after this command is sent or power must be cycled to activate the change.
CLEAR – Clear Upper EEPROM
Syntax: “!SCLEAR” <channel> <lowbyte> <highbyte> <CR>
Reply: “CLR”
All of the custom settings such as Port Mode, Servo Disabled, Startup Mode and Default Positions are all
stored in the upper 32K of the EEPROM. The code below can be used to clear the upper EEPROM and
reset these values to their defaults.
' {$STAMP BS2}
' {$PBASIC 2.5}
Sdat
Baud
buff
Clear_EEPROM:
Copyright © Parallax Inc.
DEBUG "Setting Default Position...", CR
FOR ch = 0 TO 31
NEXT
DEBUG "Please reset PSCU or cycle power now.", CR
DEBUG "Be sure the Start Servo Mode is set to 1"
STOP
DEBUG "Clearing Upper EEPROM...", CR
SEROUT Sdat, Baud+$8000, ["!SCLEAR", CR]
SERIN
DEBUG
STOP
SEROUT Sdat, Baud+$8000, ["!SCD", ch, pw.LOWBYTE, pw.HIGHBYTE, CR]
DEBUG "Channel ", DEC ch, " set to ", DEC pw, CR
Sdat, Baud, 600, Clear_EEPROM, [STR buff\3]
"Reply: ", buff(0), buff(1), buff(2), CR
VAR
VAR
PIN
CON
PIN
CON
VAR
Byte
Word
15
396
15
396
Byte(3)
Propeller Servo Controller USB (#28830)
' Channel
' Pulse Width Value
' Serial Data I/O Pin
' Constant For 2400 Baud
' Serial Data I/O Pin
' Constant For 2400 Baud
' Temporary Variable (Array)
v1.0 8/24/2009 Page 9 of 12