Emulate controller input to the via a GPIO pin

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Emulate controller input to the via a GPIO pin
by on (#209365)
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:

Image

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/pdf8798/PIC12F675-E2fMF_5983.pdf) to all three inputs (data, ground, vcc) like this:

Image

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!
Re: Emulate controller input to the via a GPIO pin
by on (#209439)
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.
Re: Emulate controller input to the via a GPIO pin
by on (#209454)
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?