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-cm5

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.

components/shared/interface/NativeInterfaceSupport.tsx

import type { ReferencePowerPlacement } from "../power-stages/ReferencePowerStages"
import { SOT236Footprint } from "../power/footprints/PackageFootprints"
import { controlCapacitor0402 } from "../power/ControlPassiveParts"

/** TI DSE0006A drawing4220552/B: pad1 is longer; there is no exposed pad. */
export function TLV710DSE6Footprint() {
  return <footprint>{Array.from({length:6},(_,i)=>{
    const pin=i+1,left=pin<=3
    return <smtpad key={pin} portHints={[`pin${pin}`]} shape="rect"
      pcbX={pin===1?-.55:left?-.6:.6} pcbY={left?.5-i*.5:-.5+(i-3)*.5}
      width={pin===1?.8:.7} height={.25} rectBorderRadius={.05}
      solderMaskMargin={left?-.025:.05} solderPasteMargin={0} />
  })}<courtyardrect width={2.3} height={1.9} /></footprint>
}

/** TI DRL0005A drawing4220753/E, not a generic SC70-5 package. */
export function DRL5Footprint() {
  const pads=[[1,-.74,.5],[2,-.74,0],[3,-.74,-.5],[4,.74,-.5],[5,.74,.5]]
  return <footprint>{pads.map(([pin,x,y])=><smtpad key={pin}
    portHints={[`pin${pin}`]} shape="rect" pcbX={x} pcbY={y}
    width={.67} height={.3} rectBorderRadius={.05}
    solderMaskMargin={.05} solderPasteMargin={0} />)}
    <courtyardrect width={2.55} height={1.8} />
  </footprint>
}

const sections={sdPower:"SD voltage and power",sdData:"SD data and protection",usb:"USB0 recovery and VBUS sense",fan:"Protected 5 V fan supply"}
export const nativeInterfaceSchematicGroups=[
  {name:"SD_VOLTAGE",title:"SD rails",positions:{U1400:[0,0],U1401:[-4,0],R1406:[-6,1.5],R1408:[3.2,1.5],C1400:[-2,2.5],C1401:[2,1.5],C1402:[-4,2.5]}},
  {name:"SD_POWER",title:"SD card power and discharge",positions:{U1402:[0,0],U1403:[-4,0],R1407:[-5,2.5],C1403:[-2,2],C1404:[2,1.5],C1405:[3.2,1.5],C1406:[-3.2,2]}},
  {name:"SD_DATA01",title:"SD DAT0/DAT1 protection",positions:{U1404:[0,0],R1401:[-1.6,1.5],R1402:[-3.6,1.5]}},
  {name:"SD_DATA23",title:"SD DAT2/DAT3 protection",positions:{U1405:[0,0],R1403:[-1.6,1.5],R1404:[-3.6,1.5]}},
  {name:"SD_COMMAND_CLOCK",title:"SD command and clock protection",positions:{U1406:[0,0],R1400:[-3,-.75],R1405:[-2,1.5]}},
  {name:"USB_DATA",title:"USB0 connector ESD protection",positions:{U1407:[0,0]}},
  {name:"USB_VBUS",title:"USB0 fail-safe VBUS sensing",positions:{D1410:[0,0],R1411:[3,1.5],R1412:[-2.5,1.5],R1413:[4.5,0]}},
  {name:"USB_CALIBRATION",title:"USB",positions:{R1410:[0,0]}},
  {name:"FAN_POWER",title:"Fan",positions:{U1408:[0,0],R1420:[0,-2.5],C1420:[-2.5,1.5],C1421:[2.5,1.5]}},
] as const
export const nativeInterfaceParts = [
  ...[1400,1401,1402,1403].map(i=>({reference:`U${i}`,section:sections.sdPower})),
  ...[1404,1405,1406].map(i=>({reference:`U${i}`,section:sections.sdData})),
  {reference:"U1407",section:sections.usb},{reference:"U1408",section:sections.fan},
  ...[1406,1407,1408].map(i=>({reference:`R${i}`,section:sections.sdPower})),
  ...[1400,1401,1402,1403,1404,1405].map(i=>({reference:`R${i}`,section:sections.sdData})),
  ...[1410,1411,1412,1413].map(i=>({reference:`R${i}`,section:sections.usb})),
  {reference:"R1420",section:sections.fan},{reference:"D1410",section:sections.usb},
  ...[1400,1401,1402,1403,1404,1405,1406].map(i=>({reference:`C${i}`,section:sections.sdPower})),
  ...[1420,1421].map(i=>({reference:`C${i}`,section:sections.fan})),
]

/** Verified primary signals and muxes; preserve the 28 header GPIO allocation. */
export const nativeInterfaceCpuConnections={
  AB38:"net.MMC1_CLK_SOC", AB36:"net.MMC1_CMD", AA33:"net.MMC1_DAT0",
  AB34:"net.MMC1_DAT1", AA32:"net.MMC1_DAT2", AC38:"net.MMC1_DAT3",
  AD36:"net.SDIO_SEL_3V3", // GPIO0_49, PADCONFIG49, mode7
  AN37:"net.SD_CARD_POWER_ENABLE", // GPIO0_59, PADCONFIG59, mode7
  AR38:"net.MMC1_SDCD_3V3", // MMC1_SDCD, PADCONFIG58, mode8
  AP38:"net.CM5_GPIO13", // GPIO0_52/EHRPWM1_A; frees the sole DP0_HPD pad AM37
  AJ32:"net.CM5_GPIO24", // GPIO0_50, PADCONFIG50, mode7; formerly unused EXT_REFCLK1
  AM37:"net.DP0_HPD_3V3", // DP0_HPD, PADCONFIG51, mode12; display receiver still external
  AN18:"net.USB0_RCALIB", AN15:"net.USB0_VBUS_SOC",
} as const

export const nativeSdConnectorConnections={
  pin1:"net.MMC1_DAT2",pin2:"net.MMC1_DAT3",pin3:"net.MMC1_CMD",pin4:"net.VDD_MMC1",
  pin5:"net.MMC1_CLK",pin7:"net.MMC1_DAT0",pin8:"net.MMC1_DAT1",
} as const
export const nativeHeaderConnectorConnections={pin18:"net.CM5_GPIO24"} as const

/** LDO2 is not the GPIO-selectable SD rail used by the TI starter kit. */
export const nativeInterfacePowerOverrides={VDD_SD_DV_PMIC:"net.VDD_SD_DV_PMIC"} as const

/**
 * Electrical adaptation of PROC154E3 SD support and AM69 datasheet10.3 VBUS
 * sensing. TLV710 outputs intentionally share VDD_SD_DV, as in the TI reference;
 * TLV711, which actively discharges its outputs, is not an equivalent substitute.
 * Board integration must keep its exported pin overrides and fit/routing checks.
 */
export function NativeInterfaceSupport({placements={},references}:{
  placements?:Partial<Record<string,ReferencePowerPlacement>>;references?:readonly string[]
}) {
  const wanted=(ref:string)=>!references||references.includes(ref)
  const p=(ref:string)=>placements[ref]??{}
  const gate=(name:string,a:string,b:string,y:string)=>wanted(name)&&<chip name={name}
    manufacturerPartNumber="SN74LVC1G08DBVR" footprint="sot23_5"
    schWidth={1.39}
    pinLabels={{pin1:"A",pin2:"B",pin3:"GND",pin4:"Y",pin5:"VCC"}}
    pinAttributes={{pin1:{isInput:true},pin2:{isInput:true},pin3:{requiresGround:true},pin4:{isOutput:true},pin5:{requiresPower:true}}}
    schPinArrangement={{leftSide:["A","B"],rightSide:["Y"],topSide:["VCC"],bottomSide:["GND"]}}
    {...p(name)} connections={{A:a,B:b,Y:y,VCC:"net.V_3V3",GND:"net.GND"}} />
  const esd=(name:string,a:string,b:string)=>wanted(name)&&<chip name={name}
    manufacturerPartNumber="TPD2E2U06DRLR" footprint={<DRL5Footprint />}
    pinLabels={{pin1:"NC1",pin2:"NC2",pin3:"IO1",pin4:"GND",pin5:"IO2"}}
    pinAttributes={{pin1:{doNotConnect:true},pin2:{doNotConnect:true},pin3:{isPassive:true},pin4:{requiresGround:true},pin5:{isPassive:true}}}
    noConnect={["NC1","NC2"]} schPinArrangement={{leftSide:["IO1","IO2"],bottomSide:["GND"],rightSide:["NC1","NC2"]}}
    {...p(name)} connections={{IO1:a,IO2:b,GND:"net.GND"}} />
  const resistors=[
    ["R1400","0","ERJ1GN0R00C","net.MMC1_CLK_SOC","net.MMC1_CLK"],
    ...["MMC1_DAT0","MMC1_DAT1","MMC1_DAT2","MMC1_DAT3","MMC1_CMD"].map((net,i)=>[
      `R${1401+i}`,"47k","ERJ-2GEJ473X",`net.${net}`,"net.VDD_SD_DV"]),
    ["R1406","10k","RC0402FR-0710KL","net.SDIO_SEL_3V3","net.V_3V3"],
    ["R1407","10k","RC0402FR-0710KL","net.SD_CARD_POWER_ENABLE","net.V_3V3"],
    ["R1408","1k","ERJ-2RKF1001X","net.VDD_SD_DV","net.GND"],
    ["R1410","499","ERA1AEB4990C","net.USB0_RCALIB","net.GND"],
    ["R1411","16.5k","RC0402FR-0716K5L","net.USB0_VBUS_SOC","net.USB0_VBUS_CLAMP"],
    ["R1412","3.5k","RC0402FR-073K5L","net.USB0_VBUS_CLAMP","net.V5_IN"],
    ["R1413","10k","RC0402FR-0710KL","net.USB0_VBUS_SOC","net.GND"],
    ["R1420","52.3k","RC0402FR-0752K3L","net.FAN_ILIM","net.GND"],
  ]
  const capacitors=[
    ["C1400","1uF","net.V5_PROTECTED"],["C1401","1uF","net.VDD_SD_DV"],
    ["C1402","100nF","net.V_3V3"],["C1403","1uF","net.V_3V3"],
    ["C1406","100nF","net.V_3V3"],
    ["C1420","1uF","net.V5_PROTECTED"],
  ]
  return <>
    {wanted("U1400")&&<chip name="U1400" manufacturerPartNumber="TLV7103318DSET" footprint={<TLV710DSE6Footprint />}
      pinLabels={{pin1:"EN1",pin2:"IN",pin3:"EN2",pin4:"GND",pin5:"OUT2",pin6:"OUT1"}}
      pinAttributes={{pin1:{isInput:true},pin2:{requiresPower:true},pin3:{isInput:true},pin4:{requiresGround:true},pin5:{providesPower:true},pin6:{providesPower:true}}}
      schPinArrangement={{leftSide:["IN","EN1","EN2"],rightSide:["OUT1","OUT2"],bottomSide:["GND"]}}
      {...p("U1400")} connections={{EN1:"net.SDIO_3V3_ENABLE",EN2:"net.EN_3V3_VIO",IN:"net.V5_PROTECTED",GND:"net.GND",OUT1:"net.VDD_SD_DV",OUT2:"net.VDD_SD_DV"}} />}
    {gate("U1401","net.SDIO_SEL_3V3","net.EN_3V3_VIO","net.SDIO_3V3_ENABLE")}
    {wanted("U1402")&&<chip name="U1402" manufacturerPartNumber="TPS22918DBVR" footprint={<SOT236Footprint />}
      schHeight={.953}
      pinLabels={{pin1:"VIN",pin2:"GND",pin3:"ON",pin4:"CT",pin5:"QOD",pin6:"VOUT"}}
      pinAttributes={{pin1:{requiresPower:true},pin2:{requiresGround:true},pin3:{isInput:true},pin4:{isPassive:true},pin5:{isPassive:true},pin6:{providesPower:true}}}
      schPinArrangement={{leftSide:["VIN","ON"],rightSide:["VOUT","QOD"],bottomSide:["CT","GND"]}}
      noConnect={["CT"]} {...p("U1402")} connections={{VIN:"net.V_3V3",GND:"net.GND",ON:"net.SD_VCC_ENABLE",QOD:"net.VDD_MMC1",VOUT:"net.VDD_MMC1"}} />}
    {gate("U1403","net.SD_CARD_POWER_ENABLE","net.EN_3V3_VIO","net.SD_VCC_ENABLE")}
    {esd("U1404","net.MMC1_DAT0","net.MMC1_DAT1")}
    {esd("U1405","net.MMC1_DAT2","net.MMC1_DAT3")}
    {esd("U1406","net.MMC1_CMD","net.MMC1_CLK")}
    {esd("U1407","net.USB0_DRD_DP","net.USB0_DRD_DM")}
    {wanted("D1410")&&<chip name="D1410" manufacturerPartNumber="BZX84C6V8LT1G" footprint="sot23"
      schHeight={.6}
      pinLabels={{pin1:"A",pin2:"NC",pin3:"K"}} pinAttributes={{pin1:{isPassive:true},pin2:{doNotConnect:true},pin3:{isPassive:true}}}
      schPinArrangement={{topSide:["K"],bottomSide:["A"],rightSide:["NC"]}}
      noConnect={["NC"]} {...p("D1410")} connections={{A:"net.GND",K:"net.USB0_VBUS_CLAMP"}} />}
    {wanted("U1408")&&<chip name="U1408" manufacturerPartNumber="TPS2553DBVR" footprint={<SOT236Footprint />}
      schHeight={1.4}
      pinLabels={{pin1:"IN",pin2:"GND",pin3:"EN",pin4:"FAULT_N",pin5:"ILIM",pin6:"OUT"}}
      pinAttributes={{pin1:{requiresPower:true},pin2:{requiresGround:true},pin3:{isInput:true},pin4:{isOutput:true},pin5:{isPassive:true},pin6:{providesPower:true}}}
      schPinArrangement={{leftSide:["IN","EN"],rightSide:["OUT","FAULT_N"],bottomSide:["ILIM","GND"]}}
      noConnect={["FAULT_N"]} {...p("U1408")} connections={{IN:"net.V5_PROTECTED",EN:"net.PD_POWER_QUALIFIED",GND:"net.GND",ILIM:"net.FAN_ILIM",OUT:"net.FAN_5V"}} />}
    {resistors.filter(([name])=>wanted(name)).map(([name,value,mpn,a,b])=><resistor key={name}
      name={name} resistance={value} manufacturerPartNumber={mpn} footprint={["R1400","R1410"].includes(name)?"0201":"0402"}
      schRotation={name==="R1400"?0:/^R140[1-5]$/.test(name)||name==="R1407"?90:-90}
      tolerance={value==="0"?undefined:name==="R1410"?"0.1%":value==="47k"?"5%":"1%"} {...p(name)} connections={{pin1:a,pin2:b}} />)}
    {capacitors.filter(([name])=>wanted(name)).map(([name,value,rail])=><capacitor key={name}
      name={name} capacitance={value} {...controlCapacitor0402(value)} footprint="0402"
      schRotation={-90} {...p(name)} connections={{pin1:rail,pin2:"net.GND"}} />)}
    {wanted("C1405")&&<capacitor name="C1405" capacitance="100nF" maxVoltageRating="16V"
      manufacturerPartNumber="GRT033C71C104KE01D" footprint="0201" schRotation={-90} {...p("C1405")}
      connections={{pin1:"net.VDD_MMC1",pin2:"net.GND"}} />}
    {wanted("C1404")&&<capacitor name="C1404" capacitance="22uF" maxVoltageRating="6.3V"
      manufacturerPartNumber="GCM21BD70J226ME36L" footprint="0805" schRotation={-90} {...p("C1404")}
      connections={{pin1:"net.VDD_MMC1",pin2:"net.GND"}} />}
    {wanted("C1421")&&<capacitor name="C1421" capacitance="10uF" maxVoltageRating="10V"
      manufacturerPartNumber="GCM21BR71A106KE22L" footprint="0805" schRotation={-90} {...p("C1421")}
      connections={{pin1:"net.FAN_5V",pin2:"net.GND"}} />}
  </>
}

/** Compact functional sheets; physical positions belong to the board. */
export function NativeInterfaceSheets({placements={}}:{placements?:Partial<Record<string,ReferencePowerPlacement>>}) {
  return <>{nativeInterfaceSchematicGroups.map(group=>{
    const references=Object.keys(group.positions)
    const local=Object.fromEntries(Object.entries(group.positions).map(([ref,[x,y]])=>[ref,{
      ...placements[ref],schX:x,schY:y,schSectionName:`NATIVE_SECTION_${group.name}`,
    }]))
    return <schematicsheet key={group.name} name={`NATIVE_${group.name}`} displayName={group.title}>
      <schematicsection name={`NATIVE_SECTION_${group.name}`} displayName={group.title} />
      <NativeInterfaceSupport placements={local} references={references} />
    </schematicsheet>
  })}</>
}