
PSP Analog Stick
A couple of months back I came across these PSP analog sticks that were meant for replacing the ones in the first generation PSPs. (PSP1000) I thought it looked great, the connection pads were at the back and frankly i thought it looked better than the ones that were used for the subsequent generations of PSPs. So I purchased a couple and thought it’d be useful for some pet projects later on. So when we decided to have an internal “Show & Tell” at the workplace, I was like, Hey! Perfect excuse to start using the analog stick. I had plans to use it to control a Robot’s movement, but first i wanted to see the values plotted visually on the PC.

The Setup
This is how the setup looks like. Please ignore the LEDs and resistors and the whole bunch of wires on the left side. They’re a test bed for something else. It’s a four wire output from the Analog Stick; High, Ground, X & Y axis. So basically only 2 I/O s are required.

Analog Stick Pin Out
The pinout for the PSP Analog Stick is as shown above. Dead Center would be about 2K ohms on both X &Y axis. If you’re using a multimeter to check for the connections, the values would read 4k ohms on the X & Y. These values drop once you input power.
So i wanted to see how the values change visually on a screen. I first had to get the readings from the sensor. To do this i connected it to an FI Board, in this case an FI40 Board, wrote about 2 lines of code to get the readings on X and Y, and then had it displayed on the debug window. I later replaced the debug statement into serial package commands for the PC.
The whole code in FIDE came to this:
Take note of the 2 lines in blue, that is all that is required to read the values from the pin.
'Module1
Public Const pinX As Integer = 2
Public Const pinY As Integer = 1
Dim X As Integer
Dim Y As Integer
Public Sub Main()
High(pinX)
High(PinY)
Delay(50)
'CENTER POINT
X = GetAdc(pinX) Y = GetAdc(pinY)
OS.Comm1.TX(255)
OS.Comm1.TX(0)
OS.Comm1.TX(HI(X))
OS.Comm1.TX(LO(X))
OS.Comm1.TX(HI(Y))
OS.Comm1.TX(LO(Y))
'Debug.Print CStr(X); " "; CStr(Y)
Delay(1000)
Do
X = GetAdc(pinX)
Y = GetAdc(pinY)
OS.Comm1.TX(255)
OS.Comm1.TX(1)
OS.Comm1.TX(HI(X))
OS.Comm1.TX(LO(X))
OS.Comm1.TX(HI(Y))
OS.Comm1.TX(LO(Y))
'Debug.Print CStr(X); " "; CStr(Y)
Delay(250)
Loop
End Sub
I noted down the maximum and mininum values of both axis, and started programming over on VS2008 (VB.NET) to do the visual plotting.

Analog Stick Values Plotted in VB.NET
I made the FI40 send the values from the Analog Stick through the UART to the PC using the same Communication Key that was used for downloading FI programs to the chip, and plotted these values to the screen as well as on the track bars. The first reading is taken as the new center point. Please note that the analog stick’s center point is not the same each and every time, however it will always be in the range of 2k Ohm +/- about 200-300 ohms. As such, you will note in the video below that when it jumps back to center, it might not necessarily be dead center but it will always be within the inner circle.
VB.NET Source Code coming soon. Watch this space till i get it uploaded.
Download the VB.NET Source Code Here.