28824 Parallax Inc, 28824 Datasheet - Page 3

SERVOPAL SERVO PULSER TIMER

28824

Manufacturer Part Number
28824
Description
SERVOPAL SERVO PULSER TIMER
Manufacturer
Parallax Inc
Datasheet

Specifications of 28824

Accessory Type
Servo Motor Control
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
BASIC Stamp®
For Use With
28803 - KIT BOARD OF EDU W/O PWR SUPP
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
' {$STAMP BS2}
' {$PBASIC 2.5}
nInp
Alarm PIN 13
Restart:
INPUT nInp
DO UNTIL nInp
LOOP
LOW nInp
PAUSE 100
HIGH nInp
This sequence accomplishes a couple things:
Programming Servo Pulses
Servo pulses are programmed in much the same way you’d send pulses directly to a servo motor, using
the PBASIC PULSOUT command. The only differences are that the pulses are negative-going instead of
positive and that both servos are programmed from the same pin. Here’s an example that will cause the
Servo 0 output to begin pulsing with 1.5mS pulses. These pulses are automatically repeated every 10-
15mS without further intervention from the BASIC Stamp.
PULSOUT nInp, 750
Notice that this is identical to the statement that would have been used, had the servo been connected
directly to the BASIC Stamp. Once the initialization code is executed, your program is primed for
negative-going pulses, and you don’t need to do anything special to send them. Here’s what the
waveforms look like that result from the above example:
But what about Servo 1? There’s only one pin, so how does it get programmed? That’s easy: just send
another pulse within 1mS of the first one, and that one will be assigned to Servo 1:
PULSOUT nInp, 750
PULSOUT nInp, 1000
The preceding code will program Servo 0 with a pulse width of 1.5mS and Servo 1 with a pulse width of
2.0mS. Here’s what the waveforms will look like:
© Parallax, Inc. • ServoPAL (2007.10.30)
Servo 0
1. In systems, like the BOE-Bot, where the servo power is switched on after the BASIC Stamp
2. In case the ServoPAL was already running, it then sends a long reset pulse to terminate any
/Inp
PIN 12
powers up, it will wait for the ServoPAL to be turned on. It does this by setting the nInp line to
an input and waiting for that line to go high, signifying not only that that the ServoPAL has
powered up, but that it has come out of reset and engaged its internal pull-ups.
servo pulses, to abort any pending alarm, and to ready the ServoPAL for further commands.
'Define the input pin.
'Define the alarm pin.
'Make sure nInp isn't being driven.
'Wait for ServoPAL to power up.
'Set pin to an output and hold it low
'
'Raise the pin.
for 100mS.
Page 3 of 9

Related parts for 28824