N64 controller input using an ATtiny85

[Larsim] worked out the timing necessary to read button and joystick data from an N64 controller using an ATtiny85 microcontroller. The project was spawned when he found this pair of controllers in the dumpster. We often intercept great stuff bound for the landfill, especially on Hippie Christmas when all the student switch apartments at the same time.

Instead of cracking the controllers open and patching directly to the buttons, [Larsim] looked up the pinout of the connector and patched into the serial data wire. In true hacker fashion, he used two 5V linear regulators and a diode in series to step his voltage source down to close to 3.6V, as he didn’t have a variable regulator on hand. It does sound like this causes noise which can result if false readings, but that can be fixed with the next parts order.

The controller waits for a polling signal before echoing back a response in which button data is embedded. This process is extremely quick, and without a crystal on hand, the chip needs to be configured to use its internal PLL to ramp the R/C oscillator up to 16Mhz. With the chip now running fast enough, an external interrupt reads the serial response from the controller, and the code reacts based on that input.

It seems the biggest reason these N64 controllers hit the trash can is because the analog joystick wears out. If you’ve got mad skills you can replace it with a different type.

Comments

  1. matt says:

    “when he found this pair of controllers in the dumpster” what? lol

    • matt says:

      good job, by the way.

    • Person Somebody says:

      Stock N64 thumbsticks wear out in 1-2 months at the longest, if you use these things a lot. Some people even use them until the thumbstick just doesn’t work anymore…the xbox 360 thumbstick has the same mechanical parts as the n64 thumbstick (and those are tough), but the ones in the N64 thumbsticks are made with plastic that underestimates it to call it cheap plastic, as opposed to the identical, tough metal ones in the xbox 360. This is why a lot of n64 controllers are in the trash…or at least used to be, either due from trash sorting at the garbage disposal plant the garbage trucks go to, if it so happens to be a environmentally friendly one, or if someone goes dumpster diving, stumbles across one (or more) and decides to do something crazy with it. The second scenario actually helped birth the existence of pc adaptors for these oldschool pitchfork-heads!

  2. WeblionX says:

    I’ve been trying to do this using the ICP hardware in an ATmega (Requires less hand-coding ASM to deal with timing issues like older projects used) but put it aside when I had issues getting it to work. This seems like a cleaner implementation than the older projects, though, so I might pick up the project again and see if this gives any insights.

  3. Pun says:

    Umm, that picture looks photoshopped.

  4. _matt says:

    Shouldn’t be too much more effort to allow gamecube controller hookups as well

  5. Squonk says:

    Nothing new: http://denki.world3.net/retro_v2.html

    This exists for years!

  6. Andrew Smith says:

    nice my n64 pads are borked also

  7. raako71 says:

    I’ve got mad skillz! pick me!

  8. itsmike says:

    Holy crap, “Hippie Christmas”. I’ve never heard that term before, and it’s awesome. Turns out I celebrate Hippie Christmas every year and never knew it! Students scrambling to vacate the dorms are so wasteful. But on the plus side, free sofa, rug, desk, bookshelves, dishes, lamps, fans, speakers, printers, tube guitar amplifier, LCD TV, and microwaves for me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 97,758 other followers