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-motherboardIn 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.
circuit/pd-output-port.tsx
import { schematicPlacement } from "../lib/schematic-placement"
import { TPS55288RPMR } from "../imports/TPS55288RPMR"
import { Hyg040n04 } from "../lib/hyg040n04"
import { FXL0630_4R7_M } from "../imports/FXL0630_4R7_M"
import { TPS259470ARPWR } from "../imports/TPS259470ARPWR"
import { TPD6S300RUKR } from "../imports/TPD6S300RUKR"
import { T2N7002AK_ES } from "../imports/T2N7002AK_ES"
import { SN74LVC1G08DCKR } from "../imports/SN74LVC1G08DCKR"
import { UsbC5A } from "../lib/usbc-5a"
import { C, R, n } from "../lib/common"
/**
* One USB-PD SOURCE port for an external BLDC controller (power only, no data).
*
* VIN_SYS (9-28 V after the input eFuse)
* -> TPS55288 buck-boost (I2C programmed 5/9/12/15/20 V, 10 mR output current sense)
* -> TPS25947 eFuse (3.5 A trip, reverse blocking, OVLO, ILM current monitor)
* -> VBUS_Mx on the USB-C receptacle.
* CC1/CC2 go through a TPD6S300 (24 V short-to-VBUS protection) to one STM32G0 UCPD.
* The eFuse enable is the AND of the supervisor request and the hardware PORT_HW_EN latch,
* so E-stop / Linux-watchdog removal of PORT_HW_EN cuts VBUS without any firmware.
*/
export const PdOutputPort = ({ i, x = 0, y, addr }: { i: number; x?: number; y: number; addr: 0x74 | 0x75 }) => {
const p = `P${i}`
const N = (s: string) => n(`${p}_${s}`)
// MODE resistor (TPS55288 datasheet Table 7-2): 6.19k = 0x74/PFM, 24.9k = 0x75/PFM, internal VCC.
const mode = addr === 0x74 ? "6.19k" : "24.9k"
return (
<group schLayout={{ layoutMode: "relative" }} name={`PD_OUT_${i}`} schSheetName={`pd_out_${i}`} pcbX={x} pcbY={y}>
{/* --- connector: opening faces the right board edge --- */}
<UsbC5A {...schematicPlacement(`JOUT${i}`)} name={`JOUT${i}`} pcbX={46.4} pcbY={0} pcbRotation={90}
noConnect={["SBU1", "SBU2", "DP1", "DP2", "DN1", "DN2"]}
connections={{
VBUS1: N("VBUS"), VBUS2: N("VBUS"), GND1: n("GND"), GND2: n("GND"),
CC1: N("CC1_C"), CC2: N("CC2_C"), SHELL: n("GND"),
}} />
{/* --- CC protection: connector side C_CCx, controller side CCx (rotated 180 deg 2026-11-27: C_CC pins face the connector) --- */}
<TPD6S300RUKR {...schematicPlacement(`U${p}CC`)} name={`U${p}CC`} pcbX={41.0} pcbY={2.9} pcbRotation={180}
connections={{
C_CC1: N("CC1_C"), C_CC2: N("CC2_C"), CC1: N("CC1"), CC2: N("CC2"),
RPD_G1: n("GND"), RPD_G2: n("GND"), GND1: n("GND"), GND2: n("GND"), GND3: n("GND"), PAD: n("GND"),
N_C1: n("GND"), N_C2: n("GND"),
VPWR: n("V3V3_AON"), VBIAS: N("TPD_VBIAS"), N_FLT: n(i >= 3 ? "SUPA_TPD_FLT_N" : "SUPB_TPD_FLT_N"),
}} />
<C name={`C${p}VB`} v="100nF" rating="50V" fp="0402" a={N("TPD_VBIAS")} at={{ x: 42.3, y: 6.1, r: 0 }} />
<C name={`C${p}VP`} v="100nF" fp="0402" a={n("V3V3_AON")} at={{ x: 38.2, y: 2.3, r: 90 }} />
{/* --- eFuse: IN = converter output, OUT = connector VBUS --- */}
<TPS259470ARPWR {...schematicPlacement(`U${p}EF`)} name={`U${p}EF`} pcbX={41.2} pcbY={-2.9}
connections={{
IN: N("VBB"), OUT: N("VBUS"), GND: n("GND"),
EN: N("EF_EN"), DVDT: N("DVDT"), ILM: N("ILM"), ITIMER: N("ITIMER"),
OVLO: N("OVLO"), PG: N("EF_PG"), N_FLT: N("EF_FLT_N"),
}} />
{/* DVDT / ILM / ITIMER parts sit on the eFuse's connector side, next to their pins (moved 2026-11-27 for 0.45 mm vias) */}
{/* ILIM = 3340 / R_ILM (datasheet: 1.65k -> 2.03 A, 750R -> 4.45 A); 953R -> ~3.5 A trip */}
<R name={`R${p}ILM`} v="953" a={N("ILM")} b={n("GND")} at={{ x: 42.45, y: -5.35, r: 270 }} />
<C name={`C${p}ILM`} v="1nF" a={N("ILM")} at={{ x: 41.45, y: -5.35, r: 270 }} />
<C name={`C${p}DV`} v="10nF" a={N("DVDT")} at={{ x: 40.45, y: -5.35, r: 270 }} />
<C name={`C${p}IT`} v="10nF" a={N("ITIMER")} at={{ x: 41.65, y: -0.4, r: 180 }} />
{/* OVLO divider from the eFuse input: 1.2 V reference x (180k+10k)/10k = 22.8 V */}
<R name={`R${p}OV1`} v="180k" a={N("VBB")} b={N("OVLO")} at={{ x: 35.6, y: -2.3, r: 90 }} />
<R name={`R${p}OV2`} v="10k" a={N("OVLO")} b={n("GND")} at={{ x: 35.6, y: -4.5, r: 90 }} />
<R name={`R${p}FLT`} v="10k" a={N("EF_FLT_N")} b={n("V3V3_AON")} at={{ x: 34.3, y: -2.3, r: 90 }} />
<R name={`R${p}PG`} v="10k" a={N("EF_PG")} b={n("V3V3_AON")} at={{ x: 34.3, y: -4.5, r: 90 }} />
<C name={`C${p}O1`} v="1uF" rating="25V" fp="0402" a={N("VBUS")} at={{ x: 40.2, y: -0.35, r: 90 }} />
{/* --- hardware enable gate: eFuse EN = PORT_HW_EN AND supervisor request --- */}
<SN74LVC1G08DCKR {...schematicPlacement(`U${p}AND`)} name={`U${p}AND`} pcbX={30.4} pcbY={-3.4}
connections={{ A: n("PORT_HW_EN"), B: N("EF_REQ"), Y: N("EF_EN"), VCC: n("V3V3_AON"), GND: n("GND") }} />
<R name={`R${p}REQ`} v="100k" a={N("EF_REQ")} b={n("GND")} at={{ x: 33.0, y: -2.3, r: 90 }} />
<C name={`C${p}AND`} v="100nF" a={n("V3V3_AON")} at={{ x: 33.0, y: -4.5, r: 90 }} />
{/* --- VBUS discharge (vSafe0V) and VBUS sense --- */}
<T2N7002AK_ES {...schematicPlacement(`Q${p}DIS`)} name={`Q${p}DIS`} pcbX={31.0} pcbY={3.6} pcbRotation={0}
connections={{ G: N("DISCH"), S: n("GND"), D: N("DIS_R") }} />
<R name={`R${p}DIS`} v="1k" fp="0805" a={N("VBUS")} b={N("DIS_R")} at={{ x: 34.1, y: 3.4, r: 90 }} />
<R name={`R${p}DG`} v="100k" a={N("DISCH")} b={n("GND")} at={{ x: 35.6, y: 2.3, r: 90 }} />
<R name={`R${p}VS1`} v="100k" a={N("VBUS")} b={N("VBUS_SNS")} at={{ x: 36.9, y: 4.5, r: 90 }} />
<R name={`R${p}VS2`} v="10k" a={N("VBUS_SNS")} b={n("GND")} at={{ x: 36.9, y: 2.3, r: 90 }} />
{/* --- output current sense (ISP/ISN) and output capacitors --- */}
<R name={`R${p}SNS`} v="10m" fp="1206" a={N("VBB_PRE")} b={N("VBB")} at={{ x: 32.62, y: 0 }} />
<C name={`C${p}OA`} v="22uF" rating="35V" fp="1206" a={N("VBB_PRE")} at={{ x: 27.62, y: 0 }} />
<C name={`C${p}OB`} v="22uF" rating="35V" fp="1206" a={N("VBB_PRE")} at={{ x: 27.3, y: 3.9, r: 90 }} />
<C name={`C${p}OC`} v="1uF" rating="35V" fp="0402" a={N("VBB")} at={{ x: 35.6, y: 4.5, r: 90 }} />
{/* --- TPS55288 buck-boost; boost leg integrated, buck leg = Q_H / Q_L --- */}
<TPS55288RPMR {...schematicPlacement(`U${p}BB`)} name={`U${p}BB`} pcbX={22.6} pcbY={0}
connections={{
VIN: n("VIN_SYS"), VOUT1: N("VBB_PRE"), VOUT2: N("VBB_PRE"),
SW1: N("SW1"), SW21: N("SW2"), SW22: N("SW2"),
DR1H: N("DR1H"), DR1L: N("DR1L"), BOOT1: N("BOOT1"), BOOT2: N("BOOT2"),
PGND1: n("GND"), PGND2: n("GND"), AGND: n("GND"),
ISP: N("VBB_PRE"), ISN: N("VBB"),
EN: N("BB_EN"), SCL: n(i >= 3 ? "SUPA_PSCL" : "SUPB_PSCL"), SDA: n(i >= 3 ? "SUPA_PSDA" : "SUPB_PSDA"),
DITH: n("GND"), FSW: N("FSW"), MODE: N("MODE"), CDC: N("IMON"), ILIM: N("ILIM"),
COMP: N("COMP"), VCC: N("VCC"), FB: N("BB_INT_N"),
}} />
<C name={`C${p}BT1`} v="100nF" rating="16V" a={N("BOOT1")} b={N("SW1")} at={{ x: 21.4, y: 2.95, r: 180 }} />
<C name={`C${p}BT2`} v="100nF" rating="16V" a={N("BOOT2")} b={N("SW2")} at={{ x: 23.6, y: 2.95 }} />
<C name={`C${p}VCC`} v="4.7uF" rating="10V" fp="0402" a={N("VCC")} at={{ x: 21.4, y: -2.95 }} />
{/* 49.9k -> 400 kHz (datasheet section 8.2.2.1) */}
<R name={`R${p}FSW`} v="49.9k" a={N("FSW")} b={n("GND")} at={{ x: 21.4, y: -4.25 }} />
{/* average inductor current limit: 20k = 16.5 A typ; 40.2k targets ~8 A for 3 A at 20 V out */}
<R name={`R${p}ILIM`} v="40.2k" a={N("ILIM")} b={n("GND")} at={{ x: 23.6, y: -2.95, r: 180 }} />
<R name={`R${p}MODE`} v={mode} a={N("MODE")} b={n("GND")} at={{ x: 23.6, y: -4.25, r: 180 }} />
{/* COMP: starting point, recompute with datasheet Eq. 24-26 for the final COUT */}
<R name={`R${p}RC`} v="10k" a={N("COMP")} b={N("COMP_RC")} at={{ x: 26.0, y: -2.95 }} />
<C name={`C${p}CC`} v="33nF" a={N("COMP_RC")} at={{ x: 26.0, y: -4.25 }} />
{/* CP left open: datasheet Eq. 26 gives < 10 pF for this COUT/ESR */}
<R name={`R${p}EN`} v="100k" a={N("BB_EN")} b={n("GND")} at={{ x: 21.4, y: 4.25 }} />
{/* --- power stage: inductor between SW1 (buck leg) and SW2 (integrated boost leg) --- */}
<FXL0630_4R7_M {...schematicPlacement(`L${p}`)} name={`L${p}`} pcbX={16.4} pcbY={0} pcbRotation={90}
connections={{ pin1: N("SW1"), pin2: N("SW2") }} />
<Hyg040n04 {...schematicPlacement(`Q${p}H`)} name={`Q${p}H`} pcbX={10.6} pcbY={2.3} g={N("DR1H")} s={N("SW1")} d={n("VIN_SYS")} />
<Hyg040n04 {...schematicPlacement(`Q${p}L`)} name={`Q${p}L`} pcbX={10.6} pcbY={-2.3} g={N("DR1L")} s={n("GND")} d={N("SW1")} />
<C name={`C${p}IA`} v="10uF" rating="50V" fp="1206" a={n("VIN_SYS")} at={{ x: 7.4, y: 2.6, r: 90 }} />
<C name={`C${p}IB`} v="10uF" rating="50V" fp="1206" a={n("VIN_SYS")} at={{ x: 7.4, y: -2.6, r: 90 }} />
<C name={`C${p}IC`} v="100nF" rating="50V" fp="0402" a={n("VIN_SYS")} at={{ x: 23.6, y: 4.25 }} />
</group>
)
}