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
vivitern
Posts: 1
Joined: Mon Dec 04, 2017 12:16 am

Emulate controller input to the via a GPIO pin

Post by vivitern »

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 controller 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!
Last edited by lidnariq on Thu Sep 03, 2020 12:07 am, edited 1 time in total.
Reason: super-subtle spam link from "N64" to vendor of used N64 parts
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Emulate controller input to the via a GPIO pin

Post by lidnariq »

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.
Bavi_H
Posts: 193
Joined: Sun Mar 03, 2013 1:52 am
Location: Texas, USA
Contact:

Re: Emulate controller input to the via a GPIO pin

Post by Bavi_H »

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