REjSJO
willi
PA
wwON W
ams@
RAL
w.pUILL
efx
LAX
arallaR IAM
-tek.
, IN
x.coCS
com
C.
m ES
In playback mode, the green LED is lit and we pull a
new set of servo values from the EEPROM. Note that the
GET_EE2 function returns a word, but we’re placing the
result in a byte (pos0). The compiler is smart enough to put
the LSB of the returned value into pos0. We can get the
MSB of the return manually by copying __PARAM2. When
a function returns a word, the LSB is in __PARAM1; the
MSB is in __PARAM2.
After retrieving a movement record, we decrement the
records count and check for button presses. We can stop
the playback cycle or, by pressing the y axis button, put it
into a pause mode. Assuming no button presses, we check
to see if the playback cycle is complete. If not, then the EE
pointer is advanced to the next set of position values. When
we do get to the end, the program checks the loop-back
jumper. When this is installed, the records count is
reloaded, the EE pointer sent back to the beginning, and the
playback continues. With no loop-back jumper, the mode is
returned to idle and playback stops.
The pause mode doesn’t do anything except monitor
button presses. We can either resume the cycle by pressing
the y axis button again, or stop it by pressing the x
axis button.
Play_Paused:
IF btnTmr(1) = BtnOK THEN
runMode = M_PLAY
btnTmr(1) = 0
GOTO Main
ENDIF
IF btnTmr(0) = BtnOK THEN
runMode = M_IDLE
btnTmr(0) = 0
ENDIF
GOTO Main
And there we have it — a two-channel servo controller
that plays live, records, and plays back. Figure 6 shows my
final board. The six-pin header on the right edge is where
I connected my DB- 15 joystick adapter (using 0.025”
post-header sockets). Note that the SX28 proto board
has busses for Vdd and Vss so connecting the pull-ups
and pull-downs for the joystick connection is very easy at
this point.
Connections beneath the board are made with
wire-wrapping wire, except for the power connections to
the joysticks. Here’s a bit of a tip for your toolbox: Get a
roll of blue painter’s tape. It’s great for holding wires and
components while soldering, and won’t leave a sticky mess
when you pull it off — I always have it on hand when I’m
building circuit boards.
The board does work as well as I’d hoped, but one
STAMP APPLICATIONS
■ FIGURE 6.
Completed Waldo.
thing I will do is order an LTC1298 and replace the
ADC0832 with it. I didn’t happen to have an LTC1298 in
my supply, so I went with what I had. It’s a little pricey
(about $11), but I think the additional resolution will
be worth having, and the pin-out exactly matches
the ADC0832. Next up for me is to attach a neat little
pan-tilt servo head that I bought from Lynxmotion and
make it dance!
Have fun, and until next time, Happy Stamping! NV
September 2007 85