Line 3:
Line 3:
=== Pinout ===
=== Pinout ===
[[File:DRC_Expansion_Pinout.png|400px|thumb|right|Labelled pinout of Gamepad Expansion Port]]
[[File:DRC_Expansion_Pinout.png|400px|thumb|right|Labelled pinout of Gamepad Expansion Port]]
+
+
This port is completely digital, and all pins are either at 0 Volts (GND) or 2.8 Volts (Vcc or Vddio).
+
+
While Vcc and Vddio are both at 2.8 Volts, they are incompatible, and shorting the two will result in many protection mechanisms triggering. This behavior is described in more detail in the [[#Input_protection|input protection]] section.
+
{| class="wikitable"
{| class="wikitable"
|-
|-
−
! Pin (LTR) || Voltage Reading || Purpose || Notes
+
! Pin (LTR) || Purpose || Notes
|-
|-
−
| 0 || +-0V || GND || Left charging cradle pad is also GND. Very useful test point.
+
| 0 || GND || Left charging cradle pad is also GND. Very useful test point.
|-
|-
−
| 1 || +0.1V - +0.2V || ??? || Possibly a data pin? Voltage readings change each test.
+
| 1 || P1 || Unknown open-drain communication port pulled to Vddio if enabled.
|-
|-
−
| 2 || +0.1V - +0.2V || ??? || Another possible data pin.
+
| 2 || P2 || Unknown open-drain communication port pulled to Vddio if enabled.
|-
|-
−
| 3 || +-0V || ??? || Also likely to be a data pin. Possibly an input?
+
| 3 || Psense || Expansion port device presence detect input. Normally directly shorted to Vcc to enable P1 and P2.
|-
|-
−
| 4 || +2.8V || Vcc || Regulated voltage. Peak current is 300mA, stable at 200mA.
+
| 4 || Vcc || Isolated and regulated power at 2.8 Volts. Peak current is 300mA, stable at 200mA.
|}
|}
None of the pins read a frequency..
None of the pins read a frequency..
−
=== Turning off the GamePad ===
+
=== Input protection ===
−
Shorting pin 1 or 2 to Vcc triggers many, many failsafes and the GamePad should immediately turn off. You also might break it.
+
Nintendo has quite overengineered the expansion port, to protect against electrical damage to the main board.
+
Expansion port Vcc is generated separately, and appears to be completely isolated from the rest of the system.
+
P1 and P2 are directly connected to a TSSOP8 package isolation chip, and appears to be fully custom. It's designed to kill the chip instead of the rest of the system in the event of electrical failure.
+
Psense is connected to the same isolation chip via an 1kOhm resistor.
+
+
It's really important to only drive or connect the pins in a way they are designed to. Failure to follow the instructions will result in many protection mechanisms triggering, turning the GamePad off, or even potentially damaging some components either on the GamePad board, or the microcontroller used to poke the expansion port.
+
+
P1 and P2 are strictly open-drain. Trying to connect them to anything other than GND will result in protection mechanism kicking in.
+
To drive P1 and P2, set the microcontroller's output level low first, and then set pin mode to output, and that will drive them to logic level 0. To drive them logic level 1, just set pin mode to input. Trying to set the microcontroller pin's output level to high will result in the GamePad's protection mechanism triggering an emergency shutdown, and could even potentially damage the microcontroller itself.
+
+
It's highly advised to directly short Psense to Vcc, without any circuitry impeding the path of the trace.