|
||||||||
|
||||||||
| Cette page est aussi disponible en français | ||||||||
| Project overview | [hide] |
On this page, you'll find out how to build such a circuit using a microcontroller. The firmware implements a standard USB joystick with 4 directional buttons and 8 general purpose buttons.
Depending on your skills, you can build the circuit on a breadboard using thru-hole components or
build the surface-mount version using my small multiuse PCB2
circuit board. I also sell ready to use circuits and pre-programmed Atmega8 chips (in DIP package only). Visit
my online shop for more details.
No drivers required! That's right, since the USB standard defines device classes. I'm using the human input device (HID) which allows me to tell to the computer that the connected USB device is a joystick and has 2 axis and 4 or 8 buttons. Another nice thing about this is that the adapter should work with all operating systems supporting HID devices. (I tested and it works at least on Win98, Win2K, WinXP and Linux) This project uses an ATmega8 microcontroller from Atmel. This microcontroller does not support USB in hardware so I used the software-only usb driver from Objective Development. This driver allows an AVR microcontroller such as the ATmega8 to talk USB with minimal external components. As a result, the interface can be built cheaply and easily |
| Schematic | [hide] |
Additionally, a wiring table for NeoGeo controllers is shown lower on this page. Component list:
For the USB connection, just strip the USB cable and solder the wires directly to the board. USB uses standard wire colors:
|
| Programming the microcontroller | [hide] |
| A microcontroller is a component which must be programmed in order to do
something useful. So here is the hexfile which must be flashed into the microcontroller: usb_game12-1.0.hex Many microcontrollers have what is called 'Fuse bytes'. In the case of the ATmega8, there are two bytes: The high byte, and the low byte. Those bytes are used to configure some aspects of the microcontroller. What type of clock to use? Crystal? Resonator? Internal RC clock? Allow programming via ISP? It's very important to set the fuses to the right values. Using the wrong values can render your MCU unusable. For this project, here are the appropriate fuse values: high byte = 0xc9, low byte = 0x9f For details about how to program an AVR, visit my AVR programming page. |
| Source code | [hide] |
| The source code is released under the GPL license and compiles with avr-gcc. To prevent conflicts,
please do not distribute modified version where the USB report descriptor has
been modified without replacing the USB Vendor ID and Product ID by yours. usb_game12-1.0.tar.gz |
| Circuit board for surface-mount version | [hide] |
The surface-mount version uses my Multiuse PCB2 circuit.
Here's what it looks like:
|
| NeoGeo wiring | [hide] |
Neo Geo controllers uses standard DB15 connectors. This connector is also used by old PC
Joysticks but it incompatible. Here's a table describing how to wire a Neo Geo
controller connector to this circuit:
|