Keyboard Gamepad

July 24 2003

This project started off as a way to eliminate use of a keyboard for a computer that's being used for game emulation (mame/zsnes/sega/etc) and extend its capabilities by modifying a gamepad but has shifted since into a more simplified approach.

The gamepad I wanted to modify was cheap and spacey.  It had one axis controller (up/down/left/right) and 6 buttons for gaming, of which only 4 were usable (other 2 were electrically repeated in additional buttons).  There were 7 more buttons and switches, of which additional 6 could have been used for gaming.  Last switch was behind the gamepad and it selected which two physical buttons the thumb buttons corresponded to (1,2 or 3,4). 

Confusing:13 buttons of which only 4 are functional for game play.

 

At first I wanted to remove the guts from the gamepad and replace them with a rather simplified version and then add a microcontroller + cables that would interface the other buttons to a keyboard.  Microcontroller would emulate a keyboard and additional buttons would translate into something useful such as enter / alt+f4 / escape / etc..

Then I thought it was unnecessary to have a gamepad and a keyboard in a single circuit so I was going to remove the gamepad guts and replace them with only a microcontroller that would interface to a keyboard port.  This would simplify the project and cut down on number of needed parts.


Then I got lazy and thought to remove the guts from the gamepad and replace them with a standard keyboard chip (removed from an old keyboard).  Old keyboards are so plentiful that they are found in trash these days and have plenty of I/O pins to accommodate 100+ buttons.

When considering development time and simplicity, the last idea seemed like the way to go.  It cut down on materials as the keyboard cable and the keyboard microchip can both be used for the project.  The gamepad essentially becomes a keyboard and that accomplishes two important things: it allows the pc to boot (for the annoying computers that don't have ability to 'halt on no errors') and secondly, it frees the gamepad port for the second player to use.  The development time is significantly reduced since there is very little tricky work involved.

So.. I started replacing the circuit board from the pad.

Original circuit board, shaped by its plastic enclosure.

 

Same circuit board traced over a plain copper board.
Copper board cut out and fitted, with drilled screw holes.
   

After reaching this point I realized that reverse engineering a keyboard is not as easy as I initially thought. Furthermore, this project would not be educational if I went down this route so right before etching the copper board I decided to go back to the microcontroller interface idea.  The microcontroller to use would be PIC16F84A (or a compatible one).  Some features I hope to implement are:

Each button could represent a sequence of keystrokes.
Reprogrammable buttons and combinations of buttons.
Reprogramming done thru caps lock / num lock toggling (data/clock).

Always seems simpler than it is...


I googled the web looking for keyboard interfacing schematics, data, etc and found that the entire system was well documented.  However, it's always difficult to just start.  Interfacing to the damned HD44780 took awhile.

So far I have a breadboard with a PIC on it and some LEDs, connected to the PS2 port and powered by it.  Now I have to make the LEDs blink in some sort of meaningful fashion (for example when the motherboard is sending data to the keyboard).  Next, comes a microswitch that activates "AAAAAAAAAAAAAAAAAA" to be transmitted to the motherboard.


Counter
..back to main page