MustafaMulla29/usb-pd-motherboard

4-layer USB-C PD hub motherboard with 20 V USB-C input, Linux T113-S3 computer, CH338F USB hub, four individually controlled 5–20 V PD outputs, USB data/camera ports, regulated rails, and hardware watchdog/E-stop safety interlock.

Version
1.0.24
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone MustafaMulla29/usb-pd-motherboard  # download the package files into ./usb-pd-motherboard
tsci add MustafaMulla29/usb-pd-motherboard    # add it to your project as @tsci/MustafaMulla29.usb-pd-motherboard

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

data/schematic-notes-content.json

{
  "power_input": {
    "sections": { "JPD": "USB-C PD input (PD IN)", "UPDIN": "CH224Q PD sink: asks the charger for 20 V", "UIN": "TPS16630 input eFuse, 5.45 A", "QINKILL": "Input off switch (supervisor A)", "U5V": "TPS54560B 5 V buck", "UAON": "AP2112K 3.3 V always-on" },
    "notes": [
      "References: WCH CH224 datasheet V2.0 sec. 6.1.1 (single-resistor configuration; RPDCFG1 = 120k -> 20 V, Table 5-1); TI TPS16630 and TPS54560B typical applications.",
      "TPS16630: UVLO 1.2 V x (56k + 10k) / 10k = 7.9 V; OVP 1.2 V x (249k + 10k) / 10k = 31.1 V; I(OL) = 18 / R(ILIM in kOhm): 3.3k -> 5.45 A; IMON 27.9 uA/A x 18k = 0.50 V/A.",
      "TPS54560B: 0.8 V x (1 + 53.6k / 10k) = 5.09 V; RT 196k -> about 500 kHz. VIN_SYS feeds the four PD OUT stages (sheets 6-9); V5V0 feeds the Linux supplies (12) and the USB port switches (14)."
    ]
  },
  "safety": {
    "sections": { "UWDT": "TPS3823-33 Linux watchdog", "UKILL": "KILL_N = stop loop AND watchdog AND input good", "ULATCH": "Output-enable latch", "JESTOP": "STOP IN connector", "SWSTOP": "On-board stop button" },
    "notes": [
      "KILL_N = ESTOP_OK AND LNX_WDT_OK AND IN_PG (74LVC1G11). PORT_HW_EN = Q of the 74LVC1G74: cleared by KILL_N low, set only by a rising PORT_ARM edge from Linux.",
      "Stop loop: V3V3_AON - RESTSRC 330R - JESTOP (bridged by RSTOPEXT) - SWSTOP - ESTOP_OK - RESTPD 2k2 to GND. Any open in the loop = stop. Loop current 1.3 mA.",
      "TPS3823-33: Linux must toggle LNX_WDI faster than every 1.6 s. Every PD OUT eFuse enable = PORT_HW_EN AND supervisor request (sheets 6-9)."
    ]
  },
  "supervisor_A": {
    "sections": { "USUPA": "STM32G0B1CBT6 supervisor A: USB-PD source for PD OUT 4 and PD OUT 3", "JSUPASWD": "SWD A (SWCLK, GND, SWDIO)" },
    "notes": [
      "Pin functions from ST open pin data STM32G0B1C(B-C-E)Tx: UCPD1 CC1 / CC2 = PA8 / PB15, UCPD2 CC1 / CC2 = PD0 / PD2, I2C1 = PB8 / PB9 (converters), I2C2 = PB10 / PB11 (to Linux).",
      "Runs from V3V3_AON, independent of Linux. Converter addresses: PD OUT 4 = 0x74, PD OUT 3 = 0x75. Decoupling per ST RM0444 / DS13560. Also measures the input (VIN_SNS, IIN_MON) and can switch the input eFuse off."
    ]
  },
  "supervisor_B": {
    "sections": { "USUPB": "STM32G0B1CBT6 supervisor B: USB-PD source for PD OUT 2 and PD OUT 1", "JSUPBSWD": "SWD B (SWCLK, GND, SWDIO)" },
    "notes": [
      "Pin functions from ST open pin data STM32G0B1C(B-C-E)Tx: UCPD1 CC1 / CC2 = PA8 / PB15, UCPD2 CC1 / CC2 = PD0 / PD2, I2C1 = PB8 / PB9 (converters), I2C2 = PB10 / PB11 (to Linux).",
      "Runs from V3V3_AON, independent of Linux. Converter addresses: PD OUT 2 = 0x74, PD OUT 1 = 0x75. Decoupling per ST RM0444 / DS13560."
    ]
  },
  "pd_out_N": {
    "sections": { "UP?BB": "TPS55288 buck-boost, 5 to 20 V (I2C)", "QP?H": "Buck leg, high side", "QP?L": "Buck leg, low side", "UP?EF": "TPS25947 eFuse, about 3.5 A", "UP?AND": "Enable = PORT_HW_EN AND supervisor", "QP?DIS": "VBUS discharge", "UP?CC": "TPD6S300 CC protection", "JOUT?": "USB-C PD OUT ?" },
    "notes": [
      "References: TI TPS55288 datasheet (MODE resistor Table 7-2: 6.19k = address 0x74, 24.9k = 0x75; 49.9k -> 400 kHz, sec. 8.2.2.1), TPS25947 and TPD6S300 typical applications.",
      "TPS25947: ILIM = 3340 / R(ILM): 953R -> about 3.5 A; OVLO 1.2 V x (180k + 10k) / 10k = 22.8 V. Output current sense 10 mOhm. VBUS_SNS, IMON and ILM go to the supervisor (sheets 4-5).",
      "Power flow: VIN_SYS -> TPS55288 -> TPS25947 -> VBUS on the connector. A stop removes PORT_HW_EN (sheet 3) and cuts VBUS without any firmware."
    ]
  },
  "mpu": {
    "sections": { "UMPU": "Allwinner T113-S3 Linux SoC (128 MB DDR3 inside)", "YHSE": "24 MHz crystal" },
    "notes": [
      "USB1 = host to the CH338F hub (sheet 13); USB0 = device / FEL on the PC port (14). microSD on SDC0 (11). Debug UART0 on PE2 / PE3 (15). Supplies and reset: sheet 12.",
      "GPIO: PG0 watchdog kick, PG1 PORT_ARM, PG3 hub reset, PG4 / PG5 LEDs, PG6 PC VBUS sense, PG12 supervisor interrupt.",
      "PD0-PD4 = 5 V enable of USB 1, USB 2, USB 3, USB 4 and CAM (high = on). 10k to GND on each: a port stays off until Linux drives its pin. DZQ: 240R 1 %."
    ]
  },
  "emmc": {
    "sections": { "JSD": "microSD socket (boot and storage)" },
    "notes": [
      "47k pull-ups on CMD and DAT (SD specification), 22R in series with CK, card-detect pull-up.",
      "Linux boots from this card. With no bootable card the T113 waits in FEL mode on the PC port (sheet 14)."
    ]
  },
  "pmic": {
    "sections": { "UB33": "TLV62569 3.3 V", "UBCORE": "TLV62569 0.95 V core", "UBDRAM": "TLV62569 1.5 V DRAM", "U1V8": "XC6206 1.8 V", "URTC": "XC6206 1.8 V for the RTC pin", "URST": "TLV803S reset" },
    "notes": [
      "TLV62569 (TI typical application): Vout = 0.6 V x (1 + Rtop / Rbot): 180k / 40.2k -> 3.29 V, 59k / 100k -> 0.95 V, 150k / 100k -> 1.5 V. 2.2 uH, 10 uF in, 2 x 22 uF out.",
      "Sequence: 3.3 V starts from V5V0; core and DRAM are enabled from 3.3 V through 100k x 100 nF (about 3.5 ms). TLV803S (2.93 V, 200 ms) holds RESET low until 3.3 V is good."
    ]
  },
  "usb_hub": {
    "sections": { "UHUB": "CH338F 7-port USB 2.0 hub (5 ports used)", "YHUB": "25 MHz crystal" },
    "notes": [
      "References: WCH CH338 datasheet V1.3 figures 8-1 and 8-4, and WCH evaluation board CH338F-R0-1v1: same supply capacitors, 4.7M on XI, 30 pF on XO, PWREN# pulled low with 5.1k.",
      "PWREN# low at reset = the chip's own USB-PD function off. RESET#: RHUBRST 1k holds the hub in reset until Linux drives PG3 high. CFG, CC and SMBus pins open = plain hub.",
      "Hub port behind each connector: USB 1 = port 1, USB 2 = port 2, USB 3 = port 5, USB 4 = port 4, CAM = port 3. Ports 6 and 7 are not used. Port 5 V is switched by Linux (sheet 14)."
    ]
  },
  "usb_ports": {
    "sections": { "JUSB1": "USB 1", "JUSB2": "USB 2", "JUSB3": "USB 3", "JUSB4": "USB 4", "JCAM": "CAM (camera)", "JPC": "PC (computer)",
      "UUSB1PWR": "5 V switch, 0.5 A", "UUSB2PWR": "5 V switch, 0.5 A", "UUSB3PWR": "5 V switch, 0.5 A", "UUSB4PWR": "5 V switch, 0.5 A", "UCAMPWR": "5 V switch, 1 A",
      "UUSB1ESD": "ESD", "UUSB2ESD": "ESD", "UUSB3ESD": "ESD", "UUSB4ESD": "ESD", "UCAMESD": "ESD", "UPCESD": "ESD" },
    "notes": [
      "Each downstream port (USB 1-4, CAM): Rp 56k to 5 V on CC1 / CC2 (default USB power), USBLC6-2SC6 on D+ / D-, SY6280 5 V switch. Limit by ISET: 13.7k -> 0.5 A, 6.8k -> 1 A.",
      "Switch enables come from Linux (PD0-PD4, sheet 10): a port's 5 V is off until Linux turns it on. Data pairs go to the CH338F hub (sheet 13).",
      "PC port: Rd 5.1k on CC1 / CC2 (USB device), data to the T113's USB0, VBUS sensed through 10k / 20k on PG6."
    ]
  },
  "debug": {
    "sections": {},
    "notes": [
      "Debug UART: T113 UART0, PE2 = TX, PE3 = RX, 3.3 V levels, no power pin (tscircuit standard 3-pin JST SH: RX, GND, TX).",
      "LEDs: STATUS (PG4), ACT (PG5), OUT ON (PORT_HW_EN). The reset button pulls the SoC reset line low."
    ]
  }
}