Difference between revisions of "GamePad/Expansion port"

(Identified all the pin functions and the PHY)
 
(3 intermediate revisions by 3 users not shown)
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        || SDA     || Pulled to Vddio if enabled. Strictly open-drain.
 
|-
 
|-
| 2        || +0.1V - +0.2V  || ???     || Another possible data pin.
+
| 2        || SCL     || Pulled to Vddio if enabled. Strictly open-drain.
 
|-
 
|-
| 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 SDA and SCL.
 
|-
 
|-
| 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..
+
The busmaster clocks I2C at a whopping 1MHz, so the microcontroller must be chosen carefully to be able to handle such bus speed.
 +
 
 +
=== Input protection ===
 +
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.
 +
SDA and SCL 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.
 +
 
 +
SDA and SCL are strictly open-drain. Trying to connect them to anything other than GND will result in protection mechanism kicking in.
 +
To drive SDA and SCL to logic level 0, set the microcontroller's output level low first, and then set pin mode to output. To drive them logic level 1, just set pin mode to input and/or floating (High-Z) with internal pull disavbled. 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.
  
=== Turning off the GamePad ===
+
It's highly advised to directly short Psense to Vcc, without any circuitry impeding the path of the trace.
Shorting pin 1 or 2 to Vcc triggers many, many failsafes and the GamePad should immediately turn off. You also might break it.
 

Latest revision as of 17:42, 27 December 2022

This article is incomplete. Please help to improve it, or discuss the issue on the talk page.

Pinout

 
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 section.

Pin (LTR) Purpose Notes
0 GND Left charging cradle pad is also GND. Very useful test point.
1 SDA Pulled to Vddio if enabled. Strictly open-drain.
2 SCL Pulled to Vddio if enabled. Strictly open-drain.
3 Psense Expansion port device presence detect input. Normally directly shorted to Vcc to enable SDA and SCL.
4 Vcc Isolated and regulated power at 2.8 Volts. Peak current is 300mA, stable at 200mA.

The busmaster clocks I2C at a whopping 1MHz, so the microcontroller must be chosen carefully to be able to handle such bus speed.

Input protection

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. SDA and SCL 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.

SDA and SCL are strictly open-drain. Trying to connect them to anything other than GND will result in protection mechanism kicking in. To drive SDA and SCL to logic level 0, set the microcontroller's output level low first, and then set pin mode to output. To drive them logic level 1, just set pin mode to input and/or floating (High-Z) with internal pull disavbled. 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.