Showing posts with label a21. Create an Infrared Peripheral Interface. Show all posts
Showing posts with label a21. Create an Infrared Peripheral Interface. Show all posts

Thursday, May 1, 2008

Types of Gamepads


With every generation of game console, the gamepads have changed. Until the early 1990s, most gamepads consisted only of some buttons directly connected to the console. Since gamepads were designed with more and more buttons, new ways for reading out the data had to be found. Original Play-Station gamepads, for example, have a small microcontroller inside that handles all the button input, converts the analog stick data to binary values, and communicates with the console over a serial protocol.

For this project, I will use a Sega Master System gamepad, which consists of only six buttons and uses a 9-pin SUB-D connector.

If your eyes are starting to glaze over right now, don't fret. You just need a crash course. Dan O'Sullivan and Tom Igoe's Physical Computing (Course Technology PTR) explains everything involved with projects such as this, from the individual components up to the power supply, to all the skills you need to breadboard up your circuits.





Saturday, April 26, 2008

Things You'll Need

In this article, you will learn how to get a microcontroller to communicate with the PSP and how to use it to make an interface for gamepads and more. Although it won't work with existing games out of the box, you can write your own homebrew games that use these controllers.

If you're lucky enough to own a Sony PSP capable of running homebrew software, you may have tried out some of the countless emulators and ports of older games out there already. The bad thing is that you can't play all the old games in two-player mode. Finding a solution for this was actually my motivation to start with this hack. First, it had to avoid any hardware modifications on the PSP itself, because I don't like to open such an expensive device. Since the PSP already provides infrared and USB ports, this wasn't much of a problem. Secondly, it had to be cheap. Being a student, I was looking for a cheap solution, and so I chose infrared. Aside from IR being cheaper, USB-capable controllers are hard to get.

As the interface consists of parts you can get at most electronic part distributors and doesn't require any special equipment, this project can be handled even by people with little programming and/or soldering experience.
  • An ATMega8 microcontroller
  • A programmer for the AVR (for loading your program onto the microcontroller)
  • Two male SUB-D connectors (9-pin)
  • 13 resistors, 1000 Ohm
  • One resistor, 470 Ohm
  • One infrared diode
If you build your own power supply:
  • One LM7805 Voltage Regulator
  • One electrolytic capacitor, 10mF
  • Two ceramic capacitors, 100 nFm
  • One diode 1N4001
I also recommend downloading the ATMega8 Data Sheet (http://www.atmel.com/dyn/products/product_card.asp?part_id=2004) because it provides useful information about the microcontroller.

To create the software for the AVR, I have used AVR-GCC, which is included in the WinAVR Package (http://winavr.sourceforge.net). A programmer like the AVR-PG2 from Olimex (http://www.olimex.com) will fit your needs. You can either buy them there or build your own one easily with the schematics available for download.

You will also need the newest version of the PSPSDK (http://www.pspdev.org). If you haven't already, you have to install Cygwin (http://www.cygwin.com/) in order to run PSPSDK on Windows.