Controller Port

From NESdevWiki

Jump to: navigation, search

The NES and Famicom have a set of I/O ports used for controllers and other peripherals, consisting of the following:

  • One output port, 3 bits wide, accessible by writing the bottom 3 bits of $4016.
  • Two input ports, each 5 bits wide, accessible by reading the bottom 5 bits of $4016 and $4017.

The NES has two general-purpose controller ports on the front of the console, as well as a (rarely used) 40-pin expansion port underneath.

The Famicom's standard controllers are hardwired to the front of the unit, and a special 15-pin expansion port is commonly used for third-party controllers. The AV Famicom, however, features detachable controllers using the same ports as the NES.

[edit] Register Map

[edit] NES

Addr 7654.3210 Function
$4016 (W) ----.---A Output data (strobe) to both controllers.
----.-CBA Output data to the expansion port.
$4016 (R) ---4.3--0 Read data from controller port #1.
---4.3210 Read data from expansion port.
$4017 (R) ---4.3--0 Read data from controller port #2.
---4.3210 Read data from expansion port.

[edit] Famicom

Addr 7654.3210 Function
$4016 (W) ----.---A Output strobe to both controllers.
----.-CBA Output data to the expansion port.
$4016 (R) ----.-M-0 Read data from controller #1 and microphone state from controller #2
----.--1- Read data from expansion port.
$4017 (R) ----.---0 Read data from controller #2.
---4.3210 Read data from expansion port.
Personal tools