Q. I recently got a wireless PS2
controller from eBay to
remotely control one of my
robots. The problem I have is that I
can’t get it to work with my BASIC
Stamp. I have tried using the example
programs that you showed in the July
‘06 issue, but they don’t work. I know
the controller works fine since it works
on my Playstation. Do you have any
idea why your example program works
with a regular PS2 controller, but doesn’t work with a wireless PS2 controller?
— Mark Martin
A. Thanks for pointing this out.
When I wrote that article, I
assumed that a wireless controller
would work the same way as a regular
PS2 controller. Since I didn’t have a
wireless controller to test at that time, I
made this incorrect assumption. The
code I presented was based on the code
by Aaron Dahlen on his PS2 controller
article controlling a five-axis Lynxmotion
( www.lynxmotion.com) arm published in June ‘03 in Nuts & Volts
Magazine ( www.nutsvolts.com), and
Jon Williams’ PS2 article that was
published in September ‘03 in Nuts &
Volts. These example programs all work
well with a regular wired PS2 controller.
Lynxmotion has quite a few example
programs using the PS2 controller with
their robots. Most of the example
programs from Lynxmotion use the
Basic Atom microcontroller (www.
basicmicro.com), which is fast and
In order to try to figure out why a
wireless controller doesn’t work the
same way as a regular wired PS2
controller, I obtained one of the new
wireless controllers that Lynxmotion
sells (model number RC-01); see Figure
1. At $19.95, it is a pretty good deal
for a wireless controller, cheaper than
the regular PS2 controller I have. As a
side note, I like the feel of Lynxmotion’s
wireless controller in my hand because
it is a little larger in size and is easier to
hold. Lynxmotion also has a very handy
adapter cable for the Playstation
compatible controllers (Model Number
PS2C-01) that has the odd shaped connector that plugs into the controller
and has a set of regular 0.1 inch
spacing connectors that easily interface
with other electronics; see Figure 2.
Their $4.95 price tag make this connector cable a better choice than buying
and hacking the six foot extension
cable I mentioned in my July article.
When I got the controller, I hooked
it up to the same test setup
shown in my July article, and to
my surprise, it did not work.
And just like you mentioned, it
worked perfectly when I
plugged it into my Playstation game
console. This was very puzzling.
To try to figure out what is going
on, I tapped into the test circuit with my
Parallax USB Oscilloscope ( www.paral
lax.com part number 28119) to analyze
the signals going between the controller
and the BASIC Stamp. I discovered
something very different than what was
expected (see http://sophiateam.undr
spec says the data signal begins when
the clock signal changes from high to
low (leading edge); see Figure 3. But
with the wireless controller, the data
signal actually begins before the clock
signal, and changes state when the
clock signal changes from low to high
(trailing edge); see Figure 4. Figure 5
shows a screen capture of the first two
bytes of data, device ID $73 analog
mode, and ready $5A.
With this bit of knowledge, it
becomes obvious that the previous program shouldn’t work with a wireless controller since the SHIFTIN function’s Mode
was configured to use the LSBPOST
(read the data Least Significant Bit first
after sending the clock signal) mode.
Since the data bits actually occur before
Figure 3. Standard (wired) PS2 Data Signal.
Figure 5. Screen capture of the Parallax USB Oscilloscope.
Blue line is the clock line, and the red line is the data line.
Figure 4. Wireless PS2 Data Signal.
SERVO 01.2007 17