Here’s a brief explanation of how the controllers works. They can be splitted in two, the nes and the snes who are shift register based and the N64 and GC who rely on a particular protocol on a one bi-directional cable.
The NES and SNES case
Theses are pretty easy, indeed in the nes it’s a simple 4021 8Bit Shift Register. Here’s a datasheet for it. And it’s the only version I know for the original Nes pads. If you know others let me know 🙂
The SNES one used different chips based on the version and region. For example the NTSC SNS-102 use a single Motorola V520B, the NTSC SNS-005 a dual Motorola W545, I’ve seen a PAL with 2 4021 in parrallel, anyway, from the outside they all acts like a 16bit shift register.
Read datas
Now, let’s read the data from them. Both will work the same way. +5v connected to voltage source and ground to ground. We have 3 wires remaining, latch, clock and data. When Latch is high, the CI store the value of the buttons. For example on the 4021 from the nes, each buttons (A, B, Start, Select, Up, Down, Left, Right) have one input on the 4021, Latch high is like saying : “Store the value of your inputs and keep it”. Then we will use the clock. Each time we send a high on the clock, the data will change between high or low to send the value. It’s a shift bit register because each time we request a value (by putting clock high) the last bit is sent and the other one from from one. So the next time we set clock to high, it’s the “next bit” (who is now the last) who will be sent.
Here’s a little diagram from an article I’ve written some years ago on my blog. In this case A and Select are pushed :
So on the µC we just need 3 I/O to read the pad, latch, clock and data. Two are outputs and on is input.
Here’s the list
The N64 and GameCube Case.
This one is a bit more touchy. First it’s not 5V but 3.43V now and there’s no pull-up resistor so you need to put a 1Kohm resistor between the data line and the +3.43V. Also you need to put your arduino data pin in an INOUT state. The N64 have 3 pins, +3.3V, Data and Ground. The GC have 7pins but only 6 used.
- +5V – Yellow
- Data – Red
- Ground – Green
- Ground – White
- Unused
- +3.43 – Blue
- Cable Shield/Ground – Black
Pingback: Not Rocket Science » Building an Arcade Fight Stick