Education – NES and SNES Joypads

If you haven’t already, I recommend you start with the education article on the 4021 Chip to learn how they work.  Once you are done with that, you can come back here to learn how they are used in the NES and SNES joypads.

NES and SNES Joypad Connectors

Even though the plugs for NES and SNES joypads look very different, they actually house the exact same number of wires with the same purposes.  Oddly enough, both connectors have 7 holes and only 5 wires in use.  I guess they left the other 2 spots for some sort of future expansion that never happened.  Here is a diagram to explain how the wires are arranged and what they all do:

NES and SNES Joypad Buttons

Joypad buttons in both the NES and the SNES are set up in a “pull down” arrangement.  That means that when you aren’t pressing a button it is represented by a “1” bit instead of the “0” you might expect.  When you press a button it pulls the value down to a “0” to indicate that it is pressed.

At first glance, this is backwards from the way that makes sense, but they had an ulterior motive when they did it this way.  They wanted to be able to tell when a joystick is plugged into the NES or SNES.  If you think about it for a moment, you will probably realize that if the buttons sent back in “0” when they aren’t pressed, and a “1” when pressed, then there is no way to know that a joystick is plugged in because there would be no difference between not being plugged in (which would result in a ton of “0”s) and simply not pressing anything on it.  That means you’d only be able to tell that something is connected if the player was actually pressing something.

By flipping it around, all the buttons are suddenly sending “1”s even when the player isn’t pressing anything, just by having the joystick plugged in.  Viola, you can tell that it’s plugged in whether or not a player is pressing anything.

NES Joypad 4021 Layout

There is a single 4021 chip in a NES joypad.  It has its buttons connected to pins in the following arrangement:

  • Input 1 – Pin 7 – D-Pad Right
  • Input 2 – Pin 6 – D-Pad Left
  • Input 3 – Pin 5 – D-Pad Down
  • Input 4 – Pin 4 – D-Pad Up
  • Input 5 – Pin 13 – Start Button
  • Input 6 – Pin 14 – Select Button
  • Input 7 – Pin 15 – B Button
  • Input 8 – Pin 1 – A Button

SNES Joypad 4021 Layout

There are two 4021 chips chained together in a SNES joypad.  One of them is the primary chip and has its data output (pin 3) connected to the SNES console.  The other is the secondary chip and has its data output (pin 3) connected to the data input (pin 11) on the primary chip.  The buttons connected to pins in the following arrangement:

Primary Chip

  • Input 1 – Pin 7 – D-Pad Right
  • Input 2 – Pin 6 – D-Pad Left
  • Input 3 – Pin 5 – D-Pad Down
  • Input 4 – Pin 4 – D-Pad Up
  • Input 5 – Pin 13 – Start Button
  • Input 6 – Pin 14 – Select Button
  • Input 7 – Pin 15 – Y Button
  • Input 8 – Pin 1 – B Button

Secondary Chip

  • Input 1 – Pin 7 – No Joypad Button (see note below)
  • Input 2 – Pin 6 – No Joypad Button (see note below)
  • Input 3 – Pin 5 – No Joypad Button (see note below)
  • Input 4 – Pin 4 – No Joypad Button (see note below)
  • Input 5 – Pin 13 – Right Shoulder Button
  • Input 6 – Pin 14 – Left Shoulder Button
  • Input 7 – Pin 15 – X Button
  • Input 8 – Pin 1 – A Button

Note:  Pins on the secondary 4021 chip that are not connected to any button on the joypad (Pins 4, 5, 6, and 7) are instead connected to +5V DC through a 10K ohm resistor.

NES Joypad Wiring Diagram

This diagram looks worse than it really is, honest.  When a lot of the wires are inside a breadboard or some other prototype perfboard, it’s vastly less complicated to build.  All of the resistors are 10K ohm 1/4 watt resistors.  The buttons are any momentary switch you like.

(You can click on this image to view it larger.)

SNES Joypad Wiring Diagram

This diagram is a bit worse than the NES one above, but it still isn’t really evil.  There is a second 4021, four extra buttons and eight extra resistors.  Once again, when a lot of the wires are inside a breadboard or some other prototype perfboard, it’s less complicated to build than it seems.  All of the resistors are 10K ohm 1/4 watt resistors.  The buttons are any momentary switch you like.

(You can click on this image to view it larger.)