Skip to content

Instantly share code, notes, and snippets.

@wallentx
Last active November 26, 2025 19:05
Show Gist options
  • Select an option

  • Save wallentx/7b28ea6299016235e9f79f6d27195434 to your computer and use it in GitHub Desktop.

Select an option

Save wallentx/7b28ea6299016235e9f79f6d27195434 to your computer and use it in GitHub Desktop.

USB-C Receptacle Pinout (Color-Coded, Horizontal)

flowchart LR

  %% Bottom row: B-side pins (front view, pin side)
  subgraph Brow["B-side (Bottom Row)"]
    direction RL
    B12["B12<br />GND"]:::gnd ---
    B11["B11<br />TX2+"]:::ss ---
    B10["B10<br />TX2−"]:::ss ---
    B9["B9<br />VBUS"]:::vbus ---
    B8["B8<br />SBU2"]:::sbu ---
    B7["B7<br />D−"]:::usb2 ---
    B6["B6<br />D+"]:::usb2 ---
    B5["B5<br />CC2"]:::cc ---
    B4["B4<br />VBUS"]:::vbus ---
    B3["B3<br />RX1−"]:::ss ---
    B2["B2<br />RX1+"]:::ss ---
    B1["B1<br />GND"]:::gnd
  end
  
  %% Top row: A-side pins (front view, pin side)
  subgraph Arow["A-side (Top Row)"]
    direction LR
    A1["A1<br />GND"]:::gnd ---
    A2["A2<br />TX1+"]:::ss ---
    A3["A3<br />TX1−"]:::ss ---
    A4["A4<br />VBUS"]:::vbus ---
    A5["A5<br />CC1"]:::cc ---
    A6["A6<br />D+"]:::usb2 ---
    A7["A7<br />D−"]:::usb2 ---
    A8["A8<br />SBU1"]:::sbu ---
    A9["A9<br />VBUS"]:::vbus ---
    A10["A10<br />RX2−"]:::ss ---
    A11["A11<br />RX2+"]:::ss ---
    A12["A12<br />GND"]:::gnd
  end
  

  %% Styling
  classDef default color:black,stroke:#333;
  classDef gnd  fill:#4CAF50,stroke:#333,color:white;   %% Ground
  classDef ss   fill:#2196F3,stroke:#333,color:white;   %% USB 3.x / high-speed lanes
  classDef usb2 fill:#B39DDB,stroke:#333,color:black;   %% USB 2.0 D+/D-
  classDef sbu  fill:#FF9800,stroke:#333,color:black;   %% Sideband use
  classDef cc   fill:#FFEB3B,stroke:#333,color:black;   %% CC / PD communication
  classDef vbus fill:#F44336,stroke:#333,color:white;   %% Bus power
Loading

Legend

Color Function
🟩 Green GND (ground return)
🔵 Blue High-speed TX/RX pairs (USB 3.x / USB4 / DP)
🟣 Purple USB 2.0 D+ / D−
🟧 Orange SBU (sideband use: DP AUX, TB, debug)
🟡 Yellow CC1 / CC2 (configuration + PD comms)
🔴 Red VBUS (5–48V, depending on PD contract)

Front view = looking into the receptacle, pin side.
Orientation flip swaps A/B rows, but the functional groups (colors) stay the same.

USB-C Power & Charging Protocol Cheat Sheet

A practical reference for understanding USB-C power behavior, PD negotiation, fast-charging protocols, cable limits, and why some devices get cooked.


🚀 Overview

USB-C is a connector, not a power standard.
Power behavior on USB-C is controlled by three distinct layers:

  1. Analog Signaling (CC Pins): Determines role (Source/Sink) and base current (up to 3A).
  2. Digital Negotiation (USB PD): Communicates over CC lines for higher voltages (9V–48V) and currents (up to 5A).
  3. Legacy Handshakes (D+/D-): Optional backward compatibility for older standards (BC1.2, QC, etc.).

This cheat sheet explains all major protocols, how power is negotiated, why some devices break, and what chargers/cables actually do.


🧱 USB-C Architecture Basics

The Physical Interface

  • VBUS: The main power line.
  • GND: Ground return.
  • CC1 / CC2: Configuration Channels (The "Brain").
  • D+ / D-: Legacy USB 2.0 data lines (used for legacy charging handshakes).
  • SBU: Sideband Use (used for Alt-Modes like DisplayPort/Thunderbolt).
  • TX / RX: High-speed data (USB 3.x / USB4).

The "Cold Socket" Safety Rule

In a compliant C-to-C connection, the source (charger) VBUS is OFF (0V) by default. It is a "Cold Socket." VBUS only goes "Hot" (5V) after the CC pins detect a valid resistor connection on the device side.

Note: USB-A ports are "Always Hot" (5V). This is why USB-A to USB-C cables behave differently.

CC Pins Determine:

  • Orientation: Which way the plug is flipped.
  • Role: Who gives power (Source) and who takes it (Sink).
  • Base Current: 500mA, 1.5A, or 3A (at 5V).
  • E-Marker: Whether the cable supports >3A (5A) or high-speed data.

⚡ Power Flow: Who Decides What?

Sources (Chargers) Advertise Capabilities

Examples: "I can do 5V/3A, 9V/3A, and 15V/3A."

Sinks (Devices) Request a Profile

Example: "I choose the 9V/3A profile."

Cables Limit Throughput

  • Standard C-to-C cables: Max 3A.
  • E-Marked C-to-C cables: Max 5A.
  • Cables never force power; they only act as a pipe with a rated limit.

A Charger NEVER:

  • Pushes more current than a device asks for.
  • Raises voltage above 5V without an explicit PD "Contract."

If a device overheats:

It pulled more current than its internal circuitry could handle. The device is non-compliant/defective, not the charger.


🧪 USB-C Default Power (Analog Signaling)

Before (or without) USB PD, the resistors on the CC pins dictate the limit. This is always 5V.

Mode Voltage Current Max Power Method
USB 2.0/3.0 Std 5V 500mA / 900mA 2.5W / 4.5W Rp Resistor
USB-C Default 5V 1.5A 7.5W Rp Resistor
USB-C High 5V 3A 15W Rp Resistor

Note: You generally cannot go above 3A (15W) using only analog signaling. 5A requires digital PD negotiation.


🔋 USB Power Delivery (PD) — The Full Standard

PD uses digital packets (BMC encoding) on the CC line to negotiate contracts. These specific power offers are called PDOs (Power Data Objects).

USB PD 2.0 / 3.0 (Fixed PDOs)

Voltage Max Current Max Power Note
5V 3A 15W Universal
9V 3A 27W Common for phones
15V 3A 45W Tablets / Laptops
20V 5A* 100W Laptops

*Currents >3A require an E-Marked (5A rated) cable.


USB PD 3.0 (PPS — Programmable Power Supply)

Introduced active voltage regulation for heat management (Samsung "Super Fast Charging").

Mode Voltage Range Step Size Max Current
PPS 3.3V – 21V 20mV steps up to 5A
  • Device talks to charger every few seconds to adjust voltage.
  • Essential for modern efficient fast charging (Samsung, Pixel, etc.).

USB PD 3.1 (EPR — Extended Power Range)

Breaks the 20V/100W ceiling.

Voltage Max Current Max Power
28V 5A 140W
36V 5A 180W
48V 5A 240W

Requires:

  1. PD 3.1 Charger
  2. PD 3.1 Device
  3. EPR-Rated Cable (Distinct from standard 100W cables)

🟥 Legacy Protocols (The "Wild West")

These use the D+ / D- data lines. Technically, strict USB-C compliance forbids using D+/D- for voltage negotiation, but it is widely done for backward compatibility.

🔸 BC1.2 (Battery Charging 1.2)

Legal in USB-C specs for legacy fallback.

Profile Voltage Current Method
SDP 5V 500mA Standard Port
CDP 5V 1.5A Charging + Data
DCP 5V 1.5A D+ shorted to D-

Most "dumb" devices require DCP (D+ shorted to D-) to draw >500mA.

🔸 Proprietary / Non-Compliant on C

Technically violations of the USB-C spec, but common.

Protocol Voltage Method Used By
Apple 2.4A 5V Resistors on D+/D- Older iPhones/iPads
QC 2.0 / 3.0 Up to 20V Voltage pulses on D+/D- Older Androids
AFC 9V D+/D- Samsung
FCP 9V D+/D- Huawei

❗ Why Cheap USB-C Devices Break

Common failures in "C-shaped" devices (vapes, cheap toys, flashlights):

  1. Missing CC Resistors: The device has a C port but no 5.1kΩ pull-down resistors on the CC pins.
    • Result: A C-to-C charger sees "nothing" connected and refuses to turn on VBUS (Cold Socket). The device won't charge.
  2. Assumption of 5V: The device assumes input is always 5V.
    • Result: If plugged into a non-compliant proprietary block (like an old 12V QC adapter) that pushes high voltage without asking, the device fries.
  3. No Current Limiting: The device connects the battery directly to VBUS without a charge controller.
    • Result: It pulls infinite current, trips the charger's safety, or catches fire.

🧵 Why USB-A → USB-C Cables "Fix" Dumb Devices

If a device refuses to charge on a C-to-C cable, it usually works on A-to-C. Why?

  1. USB-A is Always Hot: It provides 5V immediately; no CC negotiation needed.
  2. Legacy Wiring: A-to-C cables usually have a 56kΩ pull-up resistor inside the C-plug, tricking the device into thinking it's connected to a legacy source.
  3. DCP Mode: Many chargers hard-short D+ to D-, satisfying the "dumb" charging requirement.

📐 USB-C Charging Behavior Matrix

Protocol Voltages Max Current Max Power Negotiation USB-C Legal?
USB-C Default 5V 1.5A / 3A 15W CC (Analog) ✅ Yes
PD 2.0/3.0 5/9/15/20V 3A / 5A 100W CC (Digital) ✅ Yes
PD 3.0 PPS 3.3–21V 5A 100W CC (Digital) ✅ Yes
PD 3.1 EPR 28/36/48V 5A 240W CC (Digital) ✅ Yes
QC 4 / 4+ 3.3-21V 3A / 5A 100W+ CC (PD based) ✅ Yes
BC 1.2 (DCP) 5V 1.5A 7.5W D+ Short D- ✅ Yes (Legacy)
Apple 2.4A 5V 2.4A 12W D+/D- Resistors ❌ No
QC 2.0 / 3.0 3.6–20V ~3A 18W+ D+/D- Pulses ❌ No
AFC / FCP 9V 2A 18W D+/D- ❌ No

🧪 Diagnosing USB-C Behavior (Linux Tools)

Check Type-C port status (Role, Orientation, etc.):

ls /sys/class/typec
cat /sys/class/typec/port0/power_role

Read advertised Power Data Objects (PDOs) from the charger:

# May require root or specific kernel modules
cat /sys/class/typec/port0/partner/source_capabilities
# Or sometimes:
cat /sys/class/typec/port0/partner/pdos

Check active power supply status:

ls /sys/class/power_supply
cat /sys/class/power_supply/ucsi-source-psy-USBC000:001/voltage_now
cat /sys/class/power_supply/ucsi-source-psy-USBC000:001/current_now

Kernel logs (watch negotiation happen):

dmesg | grep -i 'typec\|ucsi\|pd'

🧯 Safety Summary

Safe for any USB-C-compliant device:

  • ✅ Any USB-C PD Charger (Source).
  • ✅ Any C-to-C cable (E-marked or not).

Unsafe / Problematic combinations:

  • ⚠️ Non-compliant "C-shaped" devices: Usually require A-to-C cables to charge.
  • ⚠️ Passive Extension Cables: Strictly forbidden by spec; can mess up resistance sensing and cause over-voltage.
  • ⚠️ Proprietary Adapters (e.g., PumpExpress, VOOC) on generic devices: Usually fine (they default to 5V), but rely on non-standard D+/D- signaling.

The Golden Rule: The SINK (Device) controls the current draw. The SOURCE (Charger) controls the voltage ceiling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment