Date: Wed, 7 Aug 1996 01:01:03 -0700 To: tghack-list@cpac.washington.edu From: Joe LoCicero X-Software: MLF v2.3, Copyright 1995, 1996 by Bt X-Original-Id: <199608070801.EAA14298@jaguar.ece.cmu.edu> Subject: NES and TG16 controller Fun Nothing like procrastination to get ya goin' on something you really don't have to do, huh? Here I have a 40-page paper staring me in the face with only 5 pages done...and I am playing with controllers. Anyway, I knew this was a simple project, so I figured I'd post my findings early. There's nothing revolutionary in what I've found by any stretch of the imagination, but I'm sure it will make some of you happy. I'm rushing out to buy 3 more controllers tomorrow -- so my (small) party this Sunday can play 5-person Bomberman and Legend of Dekoboko! Converting a NES controller to work with the TG/Duo/PCE isn't extremely hard; however, it does require opening the NES controller and changing the circuitry inside. First, a brief summary of how the NES controller works. It has 5 pins -- ground, +5V, Clock, "Reset", and output. The NES supplies the clock and reset signals, while the controller sends the output signal back to the system. Every time the system wants to read the controller's state, it pulses Reset once, and the Clock 8 times. With each clock pulse, a different button appears on the output line. These appear in this order: B, A, Select, Start, Up, Down, Left, Right. The TG16 controller is more efficient, but requires more wires. It has 8 pins -- ground, +5V, Select, Reset, and 4 output lines. The TG supplies the select and reset signals, and the controller sends the 4 output lines back to the system. Every time the TG wants to read the controller's state, it pulses Reset once, and the select line once. When select is high, the 4 output lines contain Up, Down, Left, and Right. When select is low, the 4 output lines contain A, B, Select, and Start. Despite the high degree of similarity between the two systems, it's just simpler to replace the circuitry inside the standard NES controller rather than add extra circuitry on the outside. We can simply replace the CD4021 chip inside the NES controller (a CMOS 8-bit parallel in, serial out shift register) with a 74LS157 chip (a TTL quad 2:1 MUX chip). You can either unsolder the CD4021 chip (not too difficult with a soldering iron and a "solder sucker" or desoldering wick, all available at Radio Shack), or cut the chip off of the board with diagonal cutters. This second solution is a little messier, and doesn't leave nice holes for you in which you can solder new wires; I recommend the first. The new 74LS157 chip can't just be substituted -- you have to wire it differently. I've included a table below of the 74LS157 pins, and where they need to be connected: 74LS157 pin # Function Connect to Pin # -------------------------------------------------------------- 1 Select Cable 1 2 A input CD4021 15 3 U input CD4021 4 4 Output 1 Resistor to Cable 4 5 B input CD4021 1 6 R input CD4021 7 7 Output 2 Resistor to Cable 6 8 Ground Cable 8 & Shell and CD4021 8 9 Output 3 Resistor to Cable 3 10 D input CD4021 5 11 Select inp. CD4021 14 12 Output 4 Resistor to Cable 5 13 L input CD4021 6 14 Start inp. CD4021 13 15 Strobe Cable 7 and CD4021 9 (**) 16 +5V Cable 2 and CD4021 16 The connection marked (**) is only necessary if your controller has an auto-fire circuit on it. Otherwise, connect nothing to the old CD4021 pin 9. 'Shell' means the outside of the TG16 connector. Be sure to connect this to the shield on the cable -- that's the metal braid that surrounds the other wires. This will keep your system shielded, and in compliance with FCC regulations. The "Resistor to Cable" means that you should connect that pin to one end of a 330 ohm resistor. The other end of the resistor should connect to a wire on the cable which connects to the specified pin. Of course, to complete your controller, you have to replace the old Nintendo cable with a new 8-wire cable. The following are the pinouts for the old large TG16-style connector; if you need the Duo pinouts, get the FAQ from the server which contains the pinout diagrams. 1 7 8 2 6 3 5 4 You can purchase the 74LS157 chip from Radio Shack, as well as the wire, TG connector, soldering and desoldering aids I have mentioned. I also recommend purchasing some of their "perfboard" -- brown circuit-board material that has 1/10"-spaced holes in it. You can mount the chip and resistors on this material, and it can be easily cut with diagonal cutters. (The Duo-style connector seems to only be available from mail-order electronics suppliers like Digi-Key and Jameco.) The chip will probably cost you about $1.50. The perfboard will also be about that price, but should supply you with enough to modify 5 - 15 connectors. The resistors will cost you $0.69 for 4 or so. While the soldering iron and desoldering aids will cost you about $15-$20, they are valuable tools for any individual. If anyone is really interested, I can get exact Radio Shack part numbers for everything I've mentioned. If you use the perfboard, the easiest way to "lay out" the chip and 4 resistors on the board is like the diagram shown below: |330| |330| -------------- | 74LS157 | -------------- |330| |330| Make sure that you lay the chip and resistors as flat as possible on the perfboard so that it will all fit inside the controller. It'll be a tight fit! Additionally, since we're not using a chip socket, be VERY CAREFUL not to hold the soldering iron to the chip pin for too long. You can destroy the internal circuitry this way. A maximum of 5-7 seconds should always be observed. I have one final note. It is possible to construct an external circuit, which will take the Nintendo signals on one side and the TG signals on the other, and interface them. However, this would require at two more chips (a timer chip and an 8-bit register). The solution I present above is simpler and cheaper, but requires hacking up the NES controller. Considering the cheap price of those controllers (K-Mart had them for $1.99 each I think), I hope no one is concerned that this is butchering expensive hardware. :) If you're *really* interested, though, I'll draw up schematics for this and post that too. Though the $1.99 controllers don't have auto-fire on them, I'm assuming that most people would be constructing these controllers for use with 5-player Tap games like Bomberman and Dekoboko. Generally, those games don't need autofire as much as something like Bonk. If you're interested, however, I can post the (one-chip, two-switch) solution to add auto-fire to a non auto-fire controller as well. Next time -- how the 6-button Avenue Pad works, and how to modify a 6-button controller to pretend to be an Avenue Pad. -Joe P.S. Scott Bradner, can you read this? Send me email if you can; I know that your email is acting up right now. --- - Joseph LoCicero, IV jolo@ece.cmu.edu http://joyce.eng.yale.edu/~jolo - - A supporter of Inet Free Speech, OS/2, OpenDoc, and Cadence CAD tools - - The freedom of a society is proportional to how much its people laugh. - - - Zero Mostel -