Input devices: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
(Make pinout link stand out a bit more)
("Receives" implies output, so use "connected" instead)
Line 3: Line 3:
** The values latched by $4016/write appear on the [[CPU_pin_out_and_signal_description|OUT0-OUT2]] output pins of the 2A03/07, where OUT0 is routed to the controller ports and OUT0-OUT2 to the expansion port on the NES.
** The values latched by $4016/write appear on the [[CPU_pin_out_and_signal_description|OUT0-OUT2]] output pins of the 2A03/07, where OUT0 is routed to the controller ports and OUT0-OUT2 to the expansion port on the NES.
* Two input ports, each 5 bits wide, accessible by reading the bottom 5 bits of $4016 and $4017.
* Two input ports, each 5 bits wide, accessible by reading the bottom 5 bits of $4016 and $4017.
** Only D0 and D3-D4 are connected to the controller ports, while the expansion port receives all the bits (D0-D4). Reading $4016 and $4017 activates the [[CPU_pin_out_and_signal_description|/OE1 and /OE2]] signals, respectively, which are routed to the controller ports and the expansion port.
** Only D0 and D3-D4 are connected to the controller ports, while all of D0-D4 are connected to the expansion port. Reading $4016 and $4017 activates the [[CPU_pin_out_and_signal_description|/OE1 and /OE2]] signals, respectively, which are routed to the controller ports and the expansion port.


The NES has two [[Controller port pinout|general-purpose controller ports]] on the front of the console, as well as a (rarely used) [[NES_expansion_port_pinout|48-pin expansion port]] underneath.
The NES has two [[Controller port pinout|general-purpose controller ports]] on the front of the console, as well as a (rarely used) [[NES_expansion_port_pinout|48-pin expansion port]] underneath.

Revision as of 09:39, 14 April 2013

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.
    • The values latched by $4016/write appear on the OUT0-OUT2 output pins of the 2A03/07, where OUT0 is routed to the controller ports and OUT0-OUT2 to the expansion port on the NES.
  • Two input ports, each 5 bits wide, accessible by reading the bottom 5 bits of $4016 and $4017.
    • Only D0 and D3-D4 are connected to the controller ports, while all of D0-D4 are connected to the expansion port. Reading $4016 and $4017 activates the /OE1 and /OE2 signals, respectively, which are routed to the controller ports and the expansion port.

The NES has two general-purpose controller ports on the front of the console, as well as a (rarely used) 48-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.


Programmer's reference

Hardware

Other I/O devices