seveibar/rp2040-module

"A USB-C powered RP2040 microcontroller module with integrated 16MB flash memory and crystal oscillator" This summary captures the key physical components (RP2040 microcontroller, USB-C, flash memory, crystal) and the core functionality of the circuit.

Usage: To import and use the RP2040 module in a project: 1. Import the component: ```tsx import { RP2040Module } from "@tsci/seveibar.rp2040-module" ``` 2. Use the component in a circuit design: ```tsx export default () => ( <board width="20mm" height="20mm"> <RP2040Module name="RPModule" /> </board> ) ``` The module includes an RP2040 microcontroller, USB-C connector, voltage regulator, flash memory, crystal oscillator, and supporting components, ready to be integrated into a circuit design.

Version
0.0.1
License
MIT
Stars
2

index.ts

PCBPCB preview for index.ts
SchematicSchematic preview for index.ts
import manualEdits from "./manual-edits.json"
import { useW25Q16JVSSIQ } from "@tsci/seveibar.W25Q16JVSSIQ-flash-memory-16m"
import { useAMS1117_3_3 } from "@tsci/seveibar.AMS1117_3v3-regulator"
import { useUsbC } from "@tsci/seveibar.smd-usb-c"
import { useRP2040 } from "@tsci/seveibar.rp2040"
import { useResistor, useCapacitor } from "@tscircuit/core"
import { useABM8_272_T3 } from "@tsci/seveibar.ABM8_272_T3"

/**
 *
 * Based on: https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf
 */
export const RP2040Module = (props: { name: string }) => {
  const RP2040 = useRP2040("U3")
  const UsbC = useUsbC("J1")
  const Reg = useAMS1117_3_3("U1")
  const C1 = useCapacitor("C1", { capacitance: "10uF", footprint: "0603" })
  const C2 = useCapacitor("C2", { capacitance: "15pF", footprint: "0402" })
  const C3 = useCapacitor("C3", { capacitance: "15pF", footprint: "0402" })
  const C4 = useCapacitor("C4", { capacitance: "10uF", footprint: "0603" })
  const C5 = useCapacitor("C5", { capacitance: "100nF", footprint: "0402" })
  const C9 = useCapacitor("C9", { capacitance: "100nF", footprint: "0402" })
  const C11 = useCapacitor("C11", { capacitance: "100nF", footprint: "0402" })
  const C12 = useCapacitor("C12", { capacitance: "100nF", footprint: "0402" })
  const C13 = useCapacitor("C13", { capacitance: "100nF", footprint: "0402" })
  const C14 = useCapacitor("C14", { capacitance: "100nF", footprint: "0402" })
  const C15 = useCapacitor("C15", { capacitance: "100nF", footprint: "0402" })
  const C16 = useCapacitor("C16", { capacitance: "100nF", footprint: "0402" })
  const R3 = useResistor("R3", { resistance: 27.4, footprint: "0402" })
  const R4 = useResistor("R4", { resistance: 27.4, footprint: "0402" })
  const R5 = useResistor("R5", { resistance: "1k", footprint: "0402" })

  const Flash = useW25Q16JVSSIQ("U2")
  const Crystal = useABM8_272_T3("K1")

  return (
    <group subcircuit autorouter="auto-cloud" manualEdits={manualEdits}>
      <RP2040 pcbY={-10} XOUT="net.XOUT" XIN="net.XIN" />
      <UsbC schX={-18} pcbY={10} pcbRotation="180deg" DP1="net.USBDP" DP2=".J1 .DP1" DM1="net.USBDM" DM2=".J1 .DM1" />
      <Reg schX={-10} pcbX={10} pcbY={1} pcbRotation="90deg" />
      <C1
        neg="net.GND"
        pos={Reg.VIN}
        schX={-11.5}
        schY={-1}
        pcbRotation="90deg"
        schRotation="90deg"
      />
      <C4
        neg="net.GND"
        pos={Reg.VOUT1}
        pcbRotation="180deg"
        schX={-8}
        schY={-1}
        schRotation="90deg"
      />
      <C9
        schX={4}
        schY={6}
        schRotation="90deg"
        neg="net.GND"
        pos={RP2040.IOVDD6}
      />
      <trace from={RP2040.USB_IOVDD} to={RP2040.IOVDD6} />
      <C11
        schX={6}
        schY={6}
        schRotation="90deg"
        neg="net.GND"
        pos={RP2040.IOVDD1}
      />
      <C12
        schX={8}
        schY={6}
        schRotation="90deg"
        neg="net.GND"
        pos={RP2040.IOVDD4}
      />
      <C13
        schX={10}
        schY={6}
        schRotation="90deg"
        neg="net.GND"
        pos={RP2040.IOVDD2}
      />
      <C14
        schX={12}
        schY={6}
        schRotation="90deg"
        neg="net.GND"
        pos={RP2040.IOVDD3}
      />
      <C15
        schX={14}
        schY={6}
        schRotation="90deg"
        neg="net.GND"
        pos={RP2040.IOVDD5}
      />
      <C16
        schX={16}
        schY={6}
        schRotation="90deg"
        neg="net.GND"
        pos={RP2040.ADC_IOVDD}
      />
      <R3 left={RP2040.USB_DP} right="net.USBDP" schX={4} schY={3.5} />
      <R4 left={RP2040.USB_DM} right="net.USBDM" schX={4} schY={2.5} />

      <Flash
        schX={-6}
        schY={-6}
        pcbX={-8}
        CS_N={RP2040.QSPI_SS_N}
        CLK={RP2040.QSPI_SCLK}
        IO0={RP2040.QSPI_SD0}
        IO1={RP2040.QSPI_SD1}
        IO2={RP2040.QSPI_SD2}
        IO3={RP2040.QSPI_SD3}
        VCC="net.V3_3"
        GND="net.GND"
      />
      <C5
        pos={Flash.VCC}
        neg="net.GND"
        schRotation="90deg"
        schX={-3}
        schY={-5}
      />
      <pinheader
        name="J2"
        footprint="pinrow2"
        schX={-12}
        schY={-6}
        facingDirection="right"
        pinCount={2}
      />

      <Crystal
        schX={-12}
        schY={8}
        pin1="net.XIN"
        pin3=".R5 .pin1"
        GND1="net.GND"
        GND2="net.GND"
      />
      <R5 pin2="net.XOUT" schX={-9} schY={7.8} />
      <C2
        schX={-14.5}
        schY={7}
        schRotation="90deg"
        decouplingFor="net.XIN"
        decouplingTo="net.GND"
      />
      <C3
        schX={-16}
        schY={7}
        schRotation="90deg"
        decouplingFor="net.XOUT"
        decouplingTo="net.GND"
      />

      <resistor name="R1" resistance="1k" schX={-10} schY={-5.5} footprint="0402" />

      <trace from=".J2 .pin1" to="net.GND" />
      <trace from=".R1 > .left" to=".J2 .pin2" />
      <trace from=".U2 .CS_N" to=".R1 .pin2" />

      <trace from={UsbC.GND1} to="net.GND" />
      <trace from={RP2040.GND} to="net.GND" />
      <trace from={Reg.GND} to="net.GND" />
      <trace from={Flash.GND} to="net.GND" />

      <trace from={Reg.VIN} to={UsbC.VBUS1} />
      <trace from={Reg.VOUT1} to="net.V3_3" />
      <trace from={Reg.VOUT2} to="net.V3_3" />
    </group>
  )
}