ShiboSoftwareDev/am69-cm5
A 55×40 mm 10-layer CM5 carrier board integrating an AM69A98 SoC, 8‑GiB LPDDR4, 32‑GB eMMC, CM5 connectors, clocking, extensive decoupling/EMI filtering, and HDI DDR/ground escape routing.
- Version
- 0.0.7-engineering-draft-20261107-manual-ddr0
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone ShiboSoftwareDev/am69-cm5 # download the package files into ./am69-cm5
tsci add ShiboSoftwareDev/am69-cm5 # add it to your project as @tsci/ShiboSoftwareDev.am69-cm5In 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.
components/shared/usb/TUSB7320Host.tsx
import pinmap from "./tusb7320.pinmap.json"
import { TUSB7320, tusb7320NoConnectPins } from "./TUSB7320"
export type UsbHostPlacement = {
pcbX?:number; pcbY?:number; pcbRotation?:number; layer?:"top"|"bottom"
schX?:number; schY?:number; schRotation?:number
}
export type TUSB7320HostOptions = {
name: string
/** Safe identifier, also used as the default net-name prefix. */
netPrefix: string
/** Resistor and capacitor reference-number range: base..base+39. */
referenceBase: number
nets?: Partial<Record<TUSB7320HostPort, string>>
placements?: Record<string, UsbHostPlacement>
/** Useful when the parent already instantiates the bare host using exported connections. */
includeHost?: boolean
}
export type TUSB7320HostPort =
| "GND" | "VDD11" | "VDD33" | "VDDA3V3" | "OSC48M_1V8"
| "REFCLK_P" | "REFCLK_N" | "PERST_N" | "GRST_N" | "WAKE_N" | "CLKREQ_N"
| "PCIE_RX_P" | "PCIE_RX_N" | "PCIE_TX_P" | "PCIE_TX_N"
| "USB1_DP" | "USB1_DM" | "USB1_RX_P" | "USB1_RX_N" | "USB1_TX_P" | "USB1_TX_N"
| "USB2_DP" | "USB2_DM" | "PWRON1_N" | "PWRON2_N" | "OVERCUR1_N" | "OVERCUR2_N"
export const tusb7320HostPortNames: TUSB7320HostPort[] = [
"GND","VDD11","VDD33","VDDA3V3","OSC48M_1V8","REFCLK_P","REFCLK_N",
"PERST_N","GRST_N","WAKE_N","CLKREQ_N","PCIE_RX_P","PCIE_RX_N","PCIE_TX_P","PCIE_TX_N",
"USB1_DP","USB1_DM","USB1_RX_P","USB1_RX_N","USB1_TX_P","USB1_TX_N","USB2_DP","USB2_DM",
"PWRON1_N","PWRON2_N","OVERCUR1_N","OVERCUR2_N",
]
export const tusb7320HostUnusedPins = [
...tusb7320NoConnectPins,
"A22", // XO: external 48 MHz oscillator mode
"A49","B46","B47","B48", // unconfigured GPIO
"A32","A35","B30","B31", // unused JTAG, with JTAG_RST# grounded
"B3", // SMI: no external pull
"A10","B9","A11","B10", // port2 SuperSpeed omitted; USB2 may remain active
]
export function createTUSB7320HostContract(options: Pick<TUSB7320HostOptions,"netPrefix"|"nets">) {
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(options.netPrefix)) throw new Error("USB host netPrefix must be a safe identifier")
const ports = Object.fromEntries(tusb7320HostPortNames.map(port => [port,
options.nets?.[port] ?? (port === "GND" ? "GND" : `${options.netPrefix}_${port}`),
])) as Record<TUSB7320HostPort,string>
const internal = (name:string) => `${options.netPrefix}_LOCAL_${name}`
const connections: Record<string,string> = {}
for (const pin of pinmap.pins) {
if (pin.signal === "VDD11") connections[pin.pin] = `net.${ports.VDD11}`
if (pin.signal === "VDD33") connections[pin.pin] = `net.${ports.VDD33}`
if (pin.signal === "VDDA_3P3") connections[pin.pin] = `net.${ports.VDDA3V3}`
if (pin.electrical_type === "ground") connections[pin.pin] = `net.${ports.GND}`
}
const direct:Record<string,TUSB7320HostPort> = {
A23:"OSC48M_1V8", A45:"REFCLK_P", B41:"REFCLK_N", A40:"PERST_N", A15:"GRST_N",
B35:"WAKE_N", B36:"CLKREQ_N", B39:"PCIE_RX_P", A42:"PCIE_RX_N",
A20:"USB1_DP", B18:"USB1_DM", A18:"USB1_RX_P", B16:"USB1_RX_N",
B12:"USB2_DP", A13:"USB2_DM", B33:"PWRON1_N", B34:"PWRON2_N",
A36:"OVERCUR1_N", A37:"OVERCUR2_N",
}
for (const [pin,port] of Object.entries(direct)) connections[pin] = `net.${ports[port]}`
for (const pin of ["B14","B32","A52"]) connections[pin] = `net.${ports.GND}`
for (const [pin,local] of Object.entries({A24:"R1EXT",B23:"R1EXTRTN",A2:"SDA",B2:"SCL",B38:"PCIE_TX_P",A41:"PCIE_TX_N",A17:"USB1_TX_P",B15:"USB1_TX_N"})) {
connections[pin] = `net.${internal(local)}`
}
return {ports,internal,connections,noConnect:tusb7320HostUnusedPins}
}
/**
* Sourced host support, not a complete USB subsystem. Instantiate at board level:
* internal schematic sheets separate the IC, rail bypass banks, coupling and straps.
* Sequenced regulators, qualified clocks/reset logic, VBUS switches and ESD are external.
*/
export function TUSB7320Host(options:TUSB7320HostOptions) {
const {name,referenceBase:base,placements={},includeHost=true} = options
const {ports,internal,connections,noConnect} = createTUSB7320HostContract(options)
const localPower = pinmap.pins.filter(pin => pin.electrical_type === "power")
const sections = ["VDD11","VDD33","VDDA_3P3"] as const
const powerPort = {VDD11:"VDD11",VDD33:"VDD33",VDDA_3P3:"VDDA3V3"} as const
const chipPosition = placements[name] ?? {pcbX:0,pcbY:0}
const at = (x:number,y:number):UsbHostPlacement => ({pcbX:(chipPosition.pcbX??0)+x,pcbY:(chipPosition.pcbY??0)+y,layer:chipPosition.layer??"top"})
const capPosition = (index:number):UsbHostPlacement => at(12+(index%6)*2,10-Math.floor(index/6)*3)
const coupling = [
{local:"PCIE_TX_P",external:ports.PCIE_TX_P},{local:"PCIE_TX_N",external:ports.PCIE_TX_N},
{local:"USB1_TX_P",external:ports.USB1_TX_P},{local:"USB1_TX_N",external:ports.USB1_TX_N},
]
return <>
{includeHost && <schematicsheet sheetWidth={800} sheetHeight={600} name={`${name}_IC`} displayName={`${name}: TUSB7320 external interface`}>
<TUSB7320 name={name} {...chipPosition} connections={connections} noConnect={noConnect} />
</schematicsheet>}
{sections.map(rail => <schematicsheet sheetWidth={800} sheetHeight={600} key={rail} name={`${name}_${rail}`} displayName={`${name}: ${rail} local bypass`}>
{localPower.map((pin,index) => pin.signal === rail && <capacitor key={pin.pin}
name={`C${base+index}`} capacitance="100nF" maxVoltageRating="16V" manufacturerPartNumber="GRM155R71C104KA88D" footprint="0402"
schRotation={-90} schX={localPower.filter(p=>p.signal===rail).findIndex(p=>p.pin===pin.pin)*4} schY={0}
{...(placements[`C${base+index}`] ?? capPosition(index))}
connections={{pin1:`net.${ports[powerPort[rail]]}`,pin2:`net.${ports.GND}`}} />)}
{rail !== "VDD33" && <capacitor name={`C${base+30+(rail==="VDD11"?0:1)}`}
capacitance="22uF" maxVoltageRating="25V" manufacturerPartNumber="GRM21BR61E226ME44L" footprint="0805" schRotation={-90}
schX={-4} schY={0} {...(placements[`C${base+30+(rail==="VDD11"?0:1)}`] ?? at(12+(rail==="VDD11"?0:5),-7))}
connections={{pin1:`net.${ports[powerPort[rail]]}`,pin2:`net.${ports.GND}`}} />}
</schematicsheet>)}
<schematicsheet sheetWidth={800} sheetHeight={600} name={`${name}_TX_COUPLING`} displayName={`${name}: transmitter AC coupling`}>
{coupling.map((path,index) => <capacitor key={path.local} name={`C${base+32+index}`}
capacitance="100nF" maxVoltageRating="16V" manufacturerPartNumber="GRM155R71C104KA88D" footprint="0402"
schX={0} schY={-index*6} schRotation={90}
{...(placements[`C${base+32+index}`] ?? at(-8,4-index*3))}
connections={{pin1:`net.${internal(path.local)}`,pin2:`net.${path.external}`}} />)}
</schematicsheet>
<schematicsheet sheetWidth={800} sheetHeight={600} name={`${name}_CALIBRATION`} displayName={`${name}: calibration and no-EEPROM straps`}>
<resistor name={`R${base}`} resistance="9.09k" tolerance="1%" manufacturerPartNumber="RC0402FR-079K09L" footprint="0402" schX={0} schY={0}
{...(placements[`R${base}`] ?? at(-3,-8))}
connections={{pin1:`net.${internal("R1EXT")}`,pin2:`net.${internal("R1EXTRTN")}`}} />
{["SDA","SCL"].map((signal,index) => <resistor key={signal} name={`R${base+1+index}`}
resistance="10k" tolerance="1%" manufacturerPartNumber="RC0402FR-0710KL" footprint="0402" schRotation={-90} schX={12+index*6} schY={0}
{...(placements[`R${base+1+index}`] ?? at(1+index*3,-8))}
connections={{pin1:`net.${internal(signal)}`,pin2:`net.${ports.GND}`}} />)}
</schematicsheet>
</>
}