Emulate controller input to the via a GPIO pin

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Post Reply
Posts: 1
Joined: Mon Dec 04, 2017 12:16 am

Emulate controller input to the via a GPIO pin

Post by vivitern » Mon Dec 04, 2017 12:31 am

To give some context, I am trying to emulate controller input to the N64 via a GPIO pin on the Raspberry PI.

In an attempt to accomplish this, I have one of the PI's GPIO's in a pull-up configuration connected to the data line of the N64 controller input on the front of the system. Here's what that looks like:


In this configuration, I see the N64 system pull the line high when it's turned on, but there is no data request or any further change.

However, when I additionally attach a microcontroller(PIC12F675 datasheet:http://www.kynix.com/uploadfiles/pdf879 ... F_5983.pdf) to all three inputs (data, ground, vcc) like this:


I am able to monitor data flowing between the system and the controller with the PI.

So, finally, the question: how is the N64 detecting the controller is connected, and how might I go about emulating that? Is it the resistance between the 3.3v and GND line? Something else entirely?

This is my first post, so let me know if I've betrayed any stack exchange policies, or if you need any additional information.

Thanks for your help!

Posts: 9500
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Emulate controller input to the via a GPIO pin

Post by lidnariq » Mon Dec 04, 2017 5:24 pm

The N64 has a weak pullup inside the console; the serial protocol used is an open-drain protocol consisting of blocks of 8×n+1 1-even-1 symbols at 977kbaud asynchronous serial. The last bit is always a "1" bit.

The CPU always originates a request; the controller has to reply within a very short window—somewhere around 7-20µs at most after the CPU finishes.

The redrawn schematics of the CPU (search for 'N64 NUS-CPU-03-04.pdf') don't show any ability to detect load on the power supply lines; +3.3V and ground are just filtered (inductors, capacitors). Only the data line itself connects to the PIF and to an external 74'125 used as a open-drain output from the PIF.

I don't think the controller does anything to say "hey, I'm here" other than reply to the game asking if anything is there.

Posts: 124
Joined: Sun Mar 03, 2013 1:52 am
Location: Texas, USA

Re: Emulate controller input to the via a GPIO pin

Post by Bavi_H » Mon Dec 04, 2017 9:07 pm

vivitern wrote:let me know if I've betrayed any stack exchange policies
Note: This post was also answered in its original location on 2017-07-12: Electrical Engineering Stack Exchange: How does the Nintendo 64 detect a controller is connected?

Post Reply