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/processor.tsx
import { schematicPlacement } from "../lib/schematic-placement"
import { T113_S3 } from "../imports/T113_S3"
import { TLV62569DBVR } from "../imports/TLV62569DBVR"
import { XC6206P182MR } from "../imports/XC6206P182MR"
import { TLV803SDBZR } from "../imports/TLV803SDBZR"
import { WIP201610P_2R2ML } from "../imports/WIP201610P_2R2ML"
import { TF_01A } from "../imports/TF_01A"
import { Hse24m } from "../lib/crystals"
import { StandardJstUartUpward } from "@tsci/tscircuit.standard-jst-programmer"
import { TS_1088_AR02016 } from "../imports/TS_1088_AR02016"
import { XL_1005UGC } from "../imports/XL_1005UGC"
import { C, R, n } from "../lib/common"
import { PORT_ENABLES } from "./usb"
/**
* Linux processor: Allwinner T113-S3 (2x Cortex-A7, 128 MB DDR3 inside the package, eLQFP-128).
* Values below are from the T113-S3 datasheet V1.x:
* - Table 5-2: VDD-CORE/VDD-SYS 0.85-0.99 V (0.95 typ), VCC-DRAM 1.425-1.575 V, VDD18-DRAM / VCC-PLL /
* VCC-RTC / VCC-LVDS 1.62-1.98 V, AVCC 1.782-1.818 V, HPVCC 1.764-1.836 V, VCC-IO 2.97-3.63 V,
* LDO-IN 2.4-3.6 V, LDOA-OUT 1.8 V (for analog and IO).
* - Table 5-3: max current VDD-CORE 800 mA, VCC-DRAM 400 mA, VCC-IO 150 mA, VCC-PD 130 mA, VCC-PE/PG 80 mA.
* - 5.12.1: VCC-RTC ramps first; VCC-IO >= 2 ms before VDD-SYS/VDD-CORE; RESET low until rails are
* stable for > 64 ms. 24 MHz crystal (Table 5-9); the 32.768 kHz crystal is optional (internal RC).
* USB0 = USB 2.0 DRD (gadget to the PC), USB1 = USB 2.0 EHCI/OHCI host (CH338F hub).
* Boot: SD card on SDC0 (PF0-PF5). With no bootable card the BROM enters FEL (USB0) for flashing.
*/
export const SOC_AT = { x: -14.5, y: -18.5 }
export const PWR_AT = { x: -30, y: -40.5 }
/** Debug console connector: free spot right of the SoC, between motor stages 3 and 4 (signal pads face down). */
const UART_AT = { x: 3.1, y: -19.3, r: 180 }
const socConnections = {
// power (T113 pin names as imported from LCSC C5197687)
VDD_CORE0: n("VDDCORE"), VDD_CORE1: n("VDDCORE"), VDD_SYS0: n("VDDCORE"), VDD_SYS1: n("VDDCORE"), VDD_SYS2: n("VDDCORE"),
VCC_DRAM0: n("VDD_DDR"), VCC_DRAM1: n("VDD_DDR"),
VCC_IO: n("VDD"), VCC_PD: n("VDD"), VCC_PE: n("VDD"), VCC_PG: n("VDD"), VCC_TVOUT: n("VDD"), LDO_IN: n("VDD"),
VDD18_DRAM: n("V1V8"), VCC_PLL: n("V1V8"), VCC_LVDS: n("V1V8"), VCC_TVIN: n("V1V8"),
AVCC: n("AVCC_1V8"), HPVCC: n("AVCC_1V8"), LDOA_OUT: n("AVCC_1V8"), LDOB_OUT: n("SOC_LDOB"),
VCC_RTC: n("VCC_RTC"), AGND: n("GND"), EPAD: n("GND"),
VRA1: n("SOC_VRA1"), VRA2: n("SOC_VRA2"), DZQ: n("SOC_DZQ"),
// clocks, reset
DXIN: n("HSE_IN"), DXOUT: n("HSE_OUT"), RESET: n("NRST"),
// USB
USB0_DP: n("OTG_DP"), USB0_DM: n("OTG_DM"), USB1_DP: n("USBH_DP"), USB1_DM: n("USBH_DM"),
// SDC0 microSD (boot)
PF1: n("SD_D0"), PF0: n("SD_D1"), PF5: n("SD_D2"), PF4: n("SD_D3"), PF2: n("SD_CK_MPU"), PF3: n("SD_CMD"), PF6: n("SD_CD_N"),
// UART0 console, TWI2 to the supervisors
PE2: n("DBG_UART_TX"), PE3: n("DBG_UART_RX"), PD20: n("SYS_SCL"), PD21: n("SYS_SDA"),
// GPIO (VCC-PG = 3.3 V)
PG0: n("LNX_WDI"), PG1: n("PORT_ARM"), PG12: n("SUP_IRQ_N"), PG3: n("HUB_RESET_N"), // SUP_IRQ_N moved PG2 -> PG12 (2026-11-28, 0.45 mm via escape)
PG4: n("LED_STATUS"), PG5: n("LED_ACT"), PG6: n("OTG_VBUS_SNS"),
// 5 V enable of each USB data port and the camera port (VCC-PD = 3.3 V; 10k pull-downs next to the hub)
...Object.fromEntries(PORT_ENABLES.map(([net, pin]) => [pin, n(net)])),
}
/** TLV62569 buck: Vout = 0.6 V x (1 + Rtop / Rbot); 2.2 uH, 10 uF in, 2 x 22 uF out. */
const Buck = ({ id, out, en, rTop, rBot, x, y }: { id: string; out: string; en: string; rTop: string; rBot: string; x: number; y: number }) => (
<>
<TLV62569DBVR {...schematicPlacement(`U${id}`)} name={`U${id}`} pcbX={x} pcbY={y}
connections={{ VIN: n("V5V0"), GND: n("GND"), EN: n(en), SW: n(`${id}_SW`), FB: n(`${id}_FB`) }} />
<WIP201610P_2R2ML {...schematicPlacement(`L${id}`)} name={`L${id}`} pcbX={x} pcbY={y + 3.6} pcbRotation={90} connections={{ pin1: n(`${id}_SW`), pin2: n(out) }} />
<C name={`C${id}I`} v="10uF" fp="0603" rating="10V" a={n("V5V0")} at={{ x: x - 3.4, y, r: 90 }} />
<C name={`C${id}O1`} v="22uF" fp="0805" rating="6.3V" a={n(out)} at={{ x: x - 1.7, y: y + 6.6 }} />
<C name={`C${id}O2`} v="22uF" fp="0805" rating="6.3V" a={n(out)} at={{ x: x + 1.7, y: y + 6.6 }} />
<R name={`R${id}FT`} v={rTop} a={n(out)} b={n(`${id}_FB`)} at={{ x: x + 3.4, y: y - 0.7 }} />
<R name={`R${id}FB`} v={rBot} a={n(`${id}_FB`)} b={n("GND")} at={{ x: x + 3.4, y: y - 2.0 }} />
</>
)
export const Processor = () => (
<>
{/* ---------- T113-S3 ---------- */}
<group schLayout={{ layoutMode: "relative" }} name="SOC" schSheetName="mpu" pcbX={0} pcbY={0}>
<T113_S3 {...schematicPlacement("UMPU")} name="UMPU" pcbX={SOC_AT.x} pcbY={SOC_AT.y} connections={socConnections as any} />
{/* decoupling: one 100 nF per supply pin group, bulk per rail */}
{["VDDCORE", "VDDCORE", "VDDCORE", "VDD_DDR", "VDD_DDR"].map((net, k) => (
<C key={`l${k}`} name={`CSOCL${k + 1}`} v="100nF" a={n(net)} at={{ x: SOC_AT.x - 11.0, y: SOC_AT.y - 4.4 + 2.2 * k, r: 90 }} />
))}
{["VDD", "VDD", "VDD", "V1V8", "V1V8"].map((net, k) => (
<C key={`r${k}`} name={`CSOCR${k + 1}`} v="100nF" a={n(net)} at={{ x: SOC_AT.x + 11.0, y: SOC_AT.y - 4.4 + 2.2 * k, r: 90 }} />
))}
<C name="CSOCCB" v="10uF" fp="0603" rating="6.3V" a={n("VDDCORE")} at={{ x: SOC_AT.x - 12.6, y: SOC_AT.y - 3.3, r: 90 }} />
<C name="CSOCDB" v="10uF" fp="0603" rating="6.3V" a={n("VDD_DDR")} at={{ x: SOC_AT.x - 12.6, y: SOC_AT.y + 1.1, r: 90 }} />
<C name="CSOCVB" v="10uF" fp="0603" rating="6.3V" a={n("VDD")} at={{ x: SOC_AT.x + 12.6, y: SOC_AT.y - 3.3, r: 90 }} />
<C name="CAVCC" v="1uF" a={n("AVCC_1V8")} at={{ x: SOC_AT.x - 7.2, y: SOC_AT.y + 9.68, r: 90 }} />
<C name="CLDOB" v="1uF" a={n("SOC_LDOB")} at={{ x: SOC_AT.x + 7.0, y: SOC_AT.y - 9.68, r: 270 }} />
<C name="CVRA1" v="1uF" a={n("SOC_VRA1")} at={{ x: SOC_AT.x, y: SOC_AT.y + 11.0 }} />
<C name="CVRA2" v="1uF" a={n("SOC_VRA2")} at={{ x: SOC_AT.x + 2.2, y: SOC_AT.y + 11.0 }} />
<C name="CRTC" v="1uF" a={n("VCC_RTC")} at={{ x: SOC_AT.x + 4.4, y: SOC_AT.y + 11.0 }} />
{/* DRAM ZQ calibration resistor, 240R 1% (Allwinner DDR3 convention) */}
<R name="RDZQ" v="240" a={n("SOC_DZQ")} b={n("GND")} at={{ x: SOC_AT.x + 4.4, y: SOC_AT.y - 11.0 }} />
{/* 24 MHz crystal (XRCGB24M000F3M00R0, CL 6 pF -> 8 pF each side) */}
<Hse24m {...schematicPlacement("YHSE")} name="YHSE" pcbX={SOC_AT.x - 4.0} pcbY={SOC_AT.y - 12.0}
connections={{ pin1: n("HSE_IN"), pin3: n("HSE_OUT"), pin2: n("GND"), pin4: n("GND") }} />
<C name="CHSE1" v="8pF" a={n("HSE_IN")} at={{ x: SOC_AT.x - 6.4, y: SOC_AT.y - 12.0, r: 90 }} />
<C name="CHSE2" v="8pF" a={n("HSE_OUT")} at={{ x: SOC_AT.x - 1.6, y: SOC_AT.y - 12.0, r: 90 }} />
{/* pull-ups */}
<R name="RSYSSCL" v="2.2k" a={n("SYS_SCL")} b={n("V3V3_AON")} at={{ x: SOC_AT.x + 1.0, y: SOC_AT.y - 11.0 }} />
<R name="RSYSSDA" v="2.2k" a={n("SYS_SDA")} b={n("V3V3_AON")} at={{ x: SOC_AT.x + 1.0, y: SOC_AT.y - 12.3 }} />
<R name="RSUPIRQ" v="10k" a={n("SUP_IRQ_N")} b={n("V3V3_AON")} at={{ x: SOC_AT.x + 4.4, y: SOC_AT.y - 12.3 }} />
{/* Port 5 V enables (PD0..PD4): 10k to GND on each keeps a port off while the SoC pin is still an input
(after power-up, during boot, in reset). In a column right of the SoC's decoupling capacitors. */}
{PORT_ENABLES.map(([net], k) => (
<R key={net} name={`R${net.replace("_PWREN", "")}EN`} v="10k" a={n(net)} b={n("GND")} at={{ x: SOC_AT.x + 12.7, y: SOC_AT.y + 4.5 - 1.0 * k }} />
))}
</group>
{/* ---------- power: 3.3 V I/O, 0.95 V core, 1.5 V DRAM, 1.8 V, RTC, reset ---------- */}
<group schLayout={{ layoutMode: "relative" }} name="SOC_POWER" schSheetName="pmic" pcbX={0} pcbY={0}>
{/* 3.3 V on from V5V0; core and DRAM enable through RC from 3.3 V (100k x 100 nF: ~3.5 ms to EN high > 2 ms) */}
<Buck id="B33" out="VDD" en="B33_EN" rTop="180k" rBot="40.2k" x={PWR_AT.x - 9.5} y={PWR_AT.y} />
<Buck id="BCORE" out="VDDCORE" en="CORE_EN" rTop="59k" rBot="100k" x={PWR_AT.x} y={PWR_AT.y} />
<Buck id="BDRAM" out="VDD_DDR" en="DRAM_EN" rTop="150k" rBot="100k" x={PWR_AT.x + 9.5} y={PWR_AT.y} />
<R name="RB33EN" v="100k" a={n("V5V0")} b={n("B33_EN")} at={{ x: PWR_AT.x - 10.5, y: PWR_AT.y - 3.2 }} />
<R name="RCOREEN" v="100k" a={n("VDD")} b={n("CORE_EN")} at={{ x: PWR_AT.x - 1.0, y: PWR_AT.y - 3.2 }} />
<C name="CCOREEN" v="100nF" a={n("CORE_EN")} at={{ x: PWR_AT.x + 1.0, y: PWR_AT.y - 3.2 }} />
<R name="RDRAMEN" v="100k" a={n("VDD")} b={n("DRAM_EN")} at={{ x: PWR_AT.x + 8.5, y: PWR_AT.y - 3.2 }} />
<C name="CDRAMEN" v="100nF" a={n("DRAM_EN")} at={{ x: PWR_AT.x + 10.5, y: PWR_AT.y - 3.2 }} />
{/* hub 3.3 V shares the SoC 3.3 V buck */}
<R name="RV3V3" v="0" fp="0603" a={n("VDD")} b={n("V3V3")} at={{ x: PWR_AT.x - 13.2, y: PWR_AT.y + 3.0, r: 90 }} />
{/* 1.8 V for VDD18-DRAM / VCC-PLL / LVDS / TVIN (~50 mA) from 3.3 V; VCC-RTC from the always-on 3.3 V so it ramps first */}
<XC6206P182MR {...schematicPlacement("U1V8")} name="U1V8" pcbX={PWR_AT.x + 5.0} pcbY={PWR_AT.y - 6.5}
connections={{ VIN: n("VDD"), VOUT: n("V1V8"), VSS: n("GND") }} />
<C name="C1V8I" v="1uF" a={n("VDD")} at={{ x: PWR_AT.x + 2.6, y: PWR_AT.y - 6.5, r: 90 }} />
<C name="C1V8O" v="1uF" a={n("V1V8")} at={{ x: PWR_AT.x + 7.4, y: PWR_AT.y - 6.5, r: 90 }} />
<XC6206P182MR {...schematicPlacement("URTC")} name="URTC" pcbX={PWR_AT.x + 11.0} pcbY={PWR_AT.y - 6.5}
connections={{ VIN: n("V3V3_AON"), VOUT: n("VCC_RTC"), VSS: n("GND") }} />
<C name="CRTCI" v="1uF" a={n("V3V3_AON")} at={{ x: PWR_AT.x + 13.4, y: PWR_AT.y - 6.5, r: 90 }} />
{/* reset: TLV803S (2.93 V, 200 ms, open drain) holds RESET low until 3.3 V is good + 200 ms (> 64 ms required) */}
<TLV803SDBZR {...schematicPlacement("URST")} name="URST" pcbX={PWR_AT.x - 5.0} pcbY={PWR_AT.y - 6.5}
connections={{ VDD: n("VDD"), GND: n("GND"), N_RESET: n("NRST") }} />
<R name="RNRST" v="10k" a={n("NRST")} b={n("VDD")} at={{ x: PWR_AT.x - 7.4, y: PWR_AT.y - 6.5, r: 90 }} />
<C name="CNRST" v="100nF" a={n("NRST")} at={{ x: PWR_AT.x - 8.7, y: PWR_AT.y - 6.5, r: 90 }} />
</group>
{/* ---------- microSD boot / root storage (SDC0) ---------- */}
<group schLayout={{ layoutMode: "relative" }} name="SDCARD" schSheetName="emmc" pcbX={7} pcbY={-7}>
<TF_01A {...schematicPlacement("JSD")} name="JSD" pcbX={-42.2} pcbY={-12.0} pcbRotation={-90}
connections={{ DAT0_D0: n("SD_D0"), DAT1_RSV: n("SD_D1"), DAT2_RSV: n("SD_D2"), CDDAT3_CS: n("SD_D3"),
CMD_DI: n("SD_CMD"), CLK_SCLK: n("SD_CK"), VDD: n("VDD"), VSS: n("GND"), CD: n("SD_CD_N"),
GND1: n("GND"), GND2: n("GND"), GND3: n("GND"), GND4: n("GND") }} />
{/* 47k pull-ups on CMD/DAT (SD spec), card-detect pull-up, series 22R on CK */}
{["SD_D0", "SD_D1", "SD_D2", "SD_D3", "SD_CMD", "SD_CD_N"].map((net, k) => (
<R key={net} name={`RSD${k}`} v="47k" a={n(net)} b={n("VDD")}
// D0/D1 pull-ups sit right beside their socket pins (moved 2026-11-28 for 0.45 mm vias: the row end was boxed in)
at={k === 0 ? { x: -34.8, y: -7.14, r: 0 } : k === 1 ? { x: -34.8, y: -6.04, r: 0 } : { x: -51.0 + 1.3 * k, y: -22.5, r: 90 }} />
))}
<R name="RSDCK" v="22" a={n("SD_CK_MPU")} b={n("SD_CK")} at={{ x: -38.6, y: -22.5, r: 90 }} />
<C name="CSD1" v="10uF" fp="0603" rating="6.3V" a={n("VDD")} at={{ x: -41.6, y: -22.5, r: 90 }} />
<C name="CSD2" v="100nF" a={n("VDD")} at={{ x: -40.2, y: -22.5, r: 90 }} />
</group>
{/* ---------- debug console, reset button, LEDs ---------- */}
<group schLayout={{ layoutMode: "relative" }} name="DEBUG_UI" schSheetName="debug" pcbX={0} pcbY={0}>
{/* Linux debug console (UART0): tscircuit standard 3-pin JST SH UART (RX, GND, TX; no power pin), upward
entry, 100 ohm series resistors. Not a programming port: the T113 boots from microSD or FEL on JPC.
Replaces the 4-pin connector that mixed power and UART (2026-11-30 review). */}
<StandardJstUartUpward name="JUART" {...schematicPlacement("JUART")} pcbX={UART_AT.x} pcbY={UART_AT.y} pcbRotation={UART_AT.r}
connections={{ RX: n("DBG_UART_RX_J"), GND: n("GND"), TX: n("DBG_UART_TX_J") }} />
<R name="RUARTTX" v="100" a={n("DBG_UART_TX")} b={n("DBG_UART_TX_J")} at={{ x: -4.3, y: -24.6, r: 0 }} />
<R name="RUARTRX" v="100" a={n("DBG_UART_RX")} b={n("DBG_UART_RX_J")} at={{ x: -4.3, y: -25.6, r: 0 }} />
<TS_1088_AR02016 {...schematicPlacement("SWRST")} name="SWRST" pcbX={-12.0} pcbY={-38.0} connections={{ pin1: n("NRST"), pin2: n("GND") }} />
<XL_1005UGC {...schematicPlacement("LEDSTAT")} name="LEDSTAT" pcbX={-4.5} pcbY={-33.0} connections={{ cathode: n("LED_STATUS"), anode: n("LED_STAT_A") }} />
<R name="RLEDSTAT" v="1k" a={n("VDD")} b={n("LED_STAT_A")} at={{ x: -6.4, y: -33.0 }} />
<XL_1005UGC {...schematicPlacement("LEDACT")} name="LEDACT" pcbX={-4.5} pcbY={-35.0} connections={{ cathode: n("LED_ACT"), anode: n("LED_ACT_A") }} />
<R name="RLEDACT" v="1k" a={n("VDD")} b={n("LED_ACT_A")} at={{ x: -6.4, y: -35.0 }} />
<XL_1005UGC {...schematicPlacement("LEDHWEN")} name="LEDHWEN" pcbX={-4.5} pcbY={-37.0} connections={{ cathode: n("PORT_HW_EN_N"), anode: n("LED_HWEN_A") }} />
<R name="RLEDHWEN" v="1k" a={n("V3V3_AON")} b={n("LED_HWEN_A")} at={{ x: -6.4, y: -37.0 }} />
</group>
</>
)