mechail

PSP Joystick Project (PART ONE)

In Projects on April 23, 2009 at 1:54 pm
PSP Analog Stick

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

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 Pinout

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

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.

more about “PSP Joystick Values plotted in VB.NET…“, posted with vodpod

VB.NET Source Code coming soon. Watch this space till i get it uploaded.

Download the VB.NET Source Code Here.

FIDE v1.4.2 Release 2

In New Releases on June 14, 2008 at 11:36 am

FIDE now stands at v1.4.2 with the promised updates for the FIDE tools. You can download it from AIS Cube here.

SD Tool:

  • Now features double the maximum number of files per cluster you can have. 1024 files for maximum goodness. sweeeet.
  • Application Notes for an in-depth walk-through available for download and viewing online.

Data Comm. Tool:

  • Added Programmable Hotkey functions.
  • Improved bells and whistles of user experience. More updates at the next release.
  • Application Notes for the Data Comm. Tool available as well for download and viewing online.

Look forward to the next updates and have a good weekend!

New Server and Bluetooth Documentation v1.1

In Uncategorized on June 4, 2008 at 7:34 pm

If you guys haven’t already noticed the big change in the outlook of our website and forum, you must have been missing out on the action. We decided to have a new website design to mark our successful migration to the new server and it looks really pretty in fact. A whole lot brighter too compared to the really dark theme we had initially.

The forum is currently empty since we have been really busy in the office with the amount of WORK to do, so please be patient with us while we repost certain items. But please go ahead and post a comment if you require assistance, have a bug report, a wish list and whatnots.

Aside from that, we have updated the FICE EBlue Documentation with code for integration with the FlamingICE. So it stands at v1.1 until we decide to add more stuff.

Thats about it for now. Release 2 for FIDE v1.4 (making that v1.4.1) is due for release sometime soon. You can expect hot-key enabling and code cleanup for the Data Comm. Tool.