diff --git a/boards/SparkFun-MicroMod-STM32-Processor/README.md b/boards/SparkFun-MicroMod-STM32-Processor/README.md new file mode 100644 index 0000000..c98edeb --- /dev/null +++ b/boards/SparkFun-MicroMod-STM32-Processor/README.md @@ -0,0 +1,5 @@ +# SparkFun MicroMod STM32 Processor + +For more information about this board, visit the official SparkFun product page: + +[https://www.sparkfun.com/sparkfun-micromod-stm32-processor.html](https://www.sparkfun.com/sparkfun-micromod-stm32-processor.html) diff --git a/boards/SparkFun-MicroMod-STM32-Processor/STM32F405RG.tsx b/boards/SparkFun-MicroMod-STM32-Processor/STM32F405RG.tsx new file mode 100644 index 0000000..90d5271 --- /dev/null +++ b/boards/SparkFun-MicroMod-STM32-Processor/STM32F405RG.tsx @@ -0,0 +1,347 @@ +import React from "react" + +const pinsPerSide = 16 +const pitch = 0.5 +const padLength = 0.25 +const padWidth = 1.3 +const bodyHalfSize = 5 +const halfSpan = ((pinsPerSide - 1) / 2) * pitch + +const mm = (v: number) => `${v.toFixed(3)}mm` + +const leftPins = Array.from({ length: pinsPerSide }, (_, i) => i + 1) +const bottomPins = Array.from({ length: pinsPerSide }, (_, i) => i + 17) +const rightPins = Array.from({ length: pinsPerSide }, (_, i) => i + 33) +const topPins = Array.from({ length: pinsPerSide }, (_, i) => i + 49) + +const createLeftPads = () => + leftPins.map((pin, idx) => ( + + )) + +const createRightPads = () => + rightPins.map((pin, idx) => ( + + )) + +const createBottomPads = () => + bottomPins.map((pin, idx) => ( + + )) + +const createTopPads = () => + topPins.map((pin, idx) => ( + + )) + +export const LQFP64_WidePads = ( + + {createLeftPads()} + {createBottomPads()} + {createRightPads()} + {createTopPads()} + +) + +export const STM32F405RG = (props: any) => { + // 1. Physical pad -> logical ID(s) + // MAKE SURE these pin# keys match your actual LQFP64_WidePads pin numbering! + // + // Each array below should usually have exactly one string. + // That string is the logical ID for that pad. + // + const pinLabels = { + pin1: "VBAT", + pin2: "PC13", + pin3: "PC14", + pin4: "PC15", + pin5: "PH0", + pin6: "PH1", + pin7: "NRST", + pin8: "PC0", + pin9: "PC1", + pin10: "PC2", + pin11: "PC3", + pin12: "VSSA", + pin13: "VDDA", + pin14: "PA0", + pin15: "PA1", + pin16: "PA2_UART2_TX", + pin17: "PA3_UART2_RX", + pin18: "VSS1", + pin19: "VDD1", + pin20: "PA4_SPI1_NSS", + pin21: "PA5_SPI1_SCK", + pin22: "PA6_SPI1_MISO", + pin23: "PA7_SPI1_MOSI", + pin24: "PC4", + pin25: "PC5", + pin26: "PB0", + pin27: "PB1", + pin28: "PB2_BOOT1", + pin29: "PB10", + pin30: "PB11", + pin31: "VCAP1", + pin32: "VDD2", + pin33: "PB12_I2S2_WS", + pin34: "PB13_I2S2_CK", + pin35: "PB14_I2S2_XD", + pin36: "PB15_I2S2_SD", + pin37: "PC6_I2S2_MCK", + pin38: "PC7", + pin39: "PC8_SDIO_D0", + pin40: "PC9_SDIO_D1", + pin41: "PA8", + pin42: "PA9_UART1_TX", + pin43: "PA10_UART1_RX", + pin44: "PA11", + pin45: "PA12", + pin46: "PA13_JTMS", + pin47: "VCAP2", + pin48: "VDD3", + pin49: "PA14_JTCK", + pin50: "PA15_JTDI", + pin51: "PC10_SDIO_D2", + pin52: "PC11_SDIO_D3", + pin53: "PC12_SDIO_CLK", + pin54: "PD2_SDIO_CMD", + pin55: "PB3_JTDO", + pin56: "PB4_JTRST", + pin57: "PB5", + pin58: "PB6", + pin59: "PB7", + pin60: "BOOT0", + pin61: "PB8", + pin62: "PB9", + pin63: "VSS2", + pin64: "VDD4", + } + + /** + * 2. Schematic pin arrangement + * + * This is the visual vertical order for each side of the symbol. + * These arrays MUST use the same logical IDs you used above in pinLabels values. + * + * Whatever comes first is placed at the TOP. + * + * You can rearrange/group however you want. + */ + const schPinArrangement = { + leftSide: { + direction: "top-to-bottom", + pins: [ + "VBAT", + "VDD1", + "VDD2", + "VDD3", + "VDD4", + "VDDA", + "VCAP1", + "VCAP2", + "NRST", + "BOOT0", + "PA0", + "PA1", + "PA2_UART2_TX", + "PA3_UART2_RX", + "PA4_SPI1_NSS", + "PA5_SPI1_SCK", + "PA6_SPI1_MISO", + "PA7_SPI1_MOSI", + "PA8", + "PA9_UART1_TX", + "PA10_UART1_RX", + "PA11", + "PA12", + "PA13_JTMS", + "PA14_JTCK", + "PA15_JTDI", + "PH0", + "PH1", + "PD2_SDIO_CMD", + "VSS1", + "VSS2", + "VSSA", + ], + }, + + rightSide: { + direction: "top-to-bottom", + pins: [ + "PB0", + "PB1", + "PB2_BOOT1", + "PB3_JTDO", + "PB4_JTRST", + "PB5", + "PB6", + "PB7", + "PB8", + "PB9", + "PB10", + "PB11", + "PB12_I2S2_WS", + "PB13_I2S2_CK", + "PB14_I2S2_XD", + "PB15_I2S2_SD", + "PC0", + "PC1", + "PC2", + "PC3", + "PC4", + "PC5", + "PC6_I2S2_MCK", + "PC7", + "PC8_SDIO_D0", + "PC9_SDIO_D1", + "PC10_SDIO_D2", + "PC11_SDIO_D3", + "PC12_SDIO_CLK", + "PC13", + "PC14", + "PC15", + ], + }, + } + + /** + * 3. Optional: spacing between groups + * + * Just like schPinStyle in MicroModBoard. Keys are *physical pins*, e.g. "pin14". + * You can sprinkle visual gaps after certain important pads. + * + * You can leave this empty if you don't need spacing. + */ + const schPinStyle = { + // example group gaps, tune these later: + pin14: { marginBottom: 0.4 }, // after BOOT0 + pin6: { marginBottom: 0.4 }, // after clock pins + pin18: { marginBottom: 0.6 }, // after USB_DP + pin30: { marginBottom: 0.6 }, // after PB9_CAN_TX + pin28: { marginBottom: 0.6 }, // after SPI1_MOSI + pin52: { marginBottom: 0.6 }, // after SPI2_MOSI + pin34: { marginBottom: 0.6 }, // after PD2_SDIO_CMD_UART5_RX + } + + // 4. Render the chip in schematic+pcb using the same API MicroModBoard uses. :contentReference[oaicite:1]{index=1} + return ( + + ) +} +/* +const STM32F405RG = (props: any) => ( + +) + +*/ + +export default STM32F405RG diff --git a/boards/SparkFun-MicroMod-STM32-Processor/SparkFun-MicroMod-STM32-Processor.circuit.tsx b/boards/SparkFun-MicroMod-STM32-Processor/SparkFun-MicroMod-STM32-Processor.circuit.tsx new file mode 100644 index 0000000..eb9f032 --- /dev/null +++ b/boards/SparkFun-MicroMod-STM32-Processor/SparkFun-MicroMod-STM32-Processor.circuit.tsx @@ -0,0 +1,1168 @@ +import React from "react" +import STM32F405RG from "./STM32F405RG" +import W25Q128 from "./W25Q128" +import { MicroModBoard } from "@tscircuit/common" +import { sel } from "@tscircuit/core" + +const pitch = 0.45 +const padW = 0.2 +const padH = 1.45 +const startX = 0 +const startY = 0 +// Define pin arrays (inverted sides) +const topPinsRight = Array.from({ length: 12 }, (_, i) => 12 - i) // 12→1 +const topPinsLeft = Array.from({ length: 24 }, (_, i) => 36 - i) // 36→13 +const bottomPinsRight = Array.from({ length: 11 }, (_, i) => 11 - i).reverse() // 12→1 +const bottomPinsLeft = Array.from({ length: 24 }, (_, i) => 36 - i).reverse() // 36→13 + +const Board = () => ( + + + + + + + + + + } + connections={{ pin1: "net.U1_PH0_HSE", pin2: "net.U1_PH1_HSE" }} + /> + + + + + + + } + connections={{ pin1: "U1.pin4", pin2: "U1.pin3" }} + /> + + + + + + + + + + + + + + + + + {/* --- Decoupling Network 1 (C8–C10) --- */} + + + + {/* --- Decoupling Network 2 (C11–C14) --- */} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +) +export default Board diff --git a/boards/SparkFun-MicroMod-STM32-Processor/W25Q128.tsx b/boards/SparkFun-MicroMod-STM32-Processor/W25Q128.tsx new file mode 100644 index 0000000..dfe7ef4 --- /dev/null +++ b/boards/SparkFun-MicroMod-STM32-Processor/W25Q128.tsx @@ -0,0 +1,21 @@ +import React from "react" + +const W25Q128 = (props: any) => ( + +) + +export default W25Q128 diff --git a/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-3d.snap.png b/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-3d.snap.png new file mode 100644 index 0000000..327e3b0 Binary files /dev/null and b/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-3d.snap.png differ diff --git a/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-pcb.snap.svg b/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-pcb.snap.svg new file mode 100644 index 0000000..da1ae70 --- /dev/null +++ b/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-pcb.snap.svg @@ -0,0 +1 @@ +U2R5Q1R1C20R11C1C2C3C4C5C6R2R3R4C15D5R12C8C9C10C11C12C13C14 \ No newline at end of file diff --git a/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-schematic.snap.svg b/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-schematic.snap.svg new file mode 100644 index 0000000..3873654 --- /dev/null +++ b/boards/SparkFun-MicroMod-STM32-Processor/__snapshots__/SparkFun-MicroMod-STM32-Processor.circuit-schematic.snap.svg @@ -0,0 +1,844 @@ +SparkFun MicroMod STM32 Processor_chip2V3_3_174V3_3_26RESET11BOOT4V3_3_EN72RTC_V39USB_VIN5USB_D_N3USB_D_P37USBHOST_D_N35USBHOST_D_P43CAN_TX41CAN_RX23SWDIO21SWDCK58AUD_MCLK56AUD_OUT54AUD_IN52AUD_LRCLK50AUD_BCLK14I2C_SCL12I2C_SDA16I2C_N_INT53I2C_SCL151I2C_SDA149BATT_VIN_31GND17GND233GND336GND439GND545GND675GND760SPI_SCK162SPI_SDO164SPI_SDI166SDIO_DATA168SDIO_DATA270SPI_N_CS157SPI_SCK59SPI_SDO61SPI_SDI55SPI_N_CS34A038A132PWM047PWM110D018D117TX119RX113RTS115CTS122TX220RX240G042G144G246G348G473G571G669G767G865G963G108G1176HOLE_PAD_1U11VBAT2PC133PC144PC155PH06PH17NRST8PC09PC110PC211PC312VSSA13VDDA14PA015PA116PA2_UART2_TX17PA3_UART2_RX18VSS119VDD120PA4_SPI1_NSS21PA5_SPI1_SCK22PA6_SPI1_MISO23PA7_SPI1_MOSI24PC425PC526PB027PB128PB2_BOOT129PB1030PB1131VCAP132VDD233PB12_I2S2_WS34PB13_I2S2_CK35PB14_I2S2_XD36PB15_I2S2_SD37PC6_I2S2_MCK38PC739PC8_SDIO_D040PC9_SDIO_D141PA842PA9_UART1_TX43PA10_UART1_RX44PA1145PA1246PA13_JTMS47VCAP248VDD349PA14_JTCK50PA15_JTDI51PC10_SDIO_D252PC11_SDIO_D353PC12_SDIO_CLK54PD2_SDIO_CMD55PB3_JTDO56PB4_JTRST57PB558PB659PB760BOOT061PB862PB963VSS264VDD4U21CS_N5DO_DI2D1_DO4GND3D2_WP6CLK7D3_HOLD8V3_312MHz / 18pFY1C122pFC222pF32.8kHz / 12.5pFY2C315pFC415pFC52.2uFC62.2uFR222ΩR322ΩR5100kΩQ1R1100kΩR45.1kΩC15100nFblueD5R121kΩC200.1uFR11100kΩC80.1uFC91.0uFC104.7uFC110.1uFC120.1uFC130.1uFC140.1uFGNDV3_3V3_3V3_3V3_3V3_3V3_3V3_3V3_3V3_3V3_3SparkFun MicroMod STM32 Processor_chip_N_RESET/U1_NRST/R4_pin1/C15_pin1SparkFun MicroMod STM32 Processor_chip_N_RESET/U1_NRST/R4_pin1/C15_pin1SparkFun MicroMod STM32 Processor_chip_N_RESET/U1_NRST/R4_pin1/C15_pin1SparkFun MicroMod STM32 Processor_chip_N_RESET/U1_NRST/R4_pin1/C15_pin1SparkFun MicroMod STM32 Processor_chip_N_BOOT/Q1_pin1SparkFun MicroMod STM32 Processor_chip_N_BOOT/Q1_pin1SparkFun MicroMod STM32 Processor_chip_USB_VIN/U1_PB13_I2S2_CKSparkFun MicroMod STM32 Processor_chip_USB_VIN/U1_PB13_I2S2_CKSparkFun MicroMod STM32 Processor_chip_USB_D_N/R3_pin2SparkFun MicroMod STM32 Processor_chip_USB_D_N/R3_pin2SparkFun MicroMod STM32 Processor_chip_USB_D_P/R2_pin2SparkFun MicroMod STM32 Processor_chip_USB_D_P/R2_pin2SparkFun MicroMod STM32 Processor_chip_USBHOST_D_N/U1_PB14_I2S2_XDSparkFun MicroMod STM32 Processor_chip_USBHOST_D_N/U1_PB14_I2S2_XDSparkFun MicroMod STM32 Processor_chip_USBHOST_D_P/U1_PB15_I2S2_SDSparkFun MicroMod STM32 Processor_chip_USBHOST_D_P/U1_PB15_I2S2_SDSparkFun MicroMod STM32 Processor_chip_CAN_TX/U1_PB9SparkFun MicroMod STM32 Processor_chip_CAN_TX/U1_PB9SparkFun MicroMod STM32 Processor_chip_CAN_RX/U1_PB8SparkFun MicroMod STM32 Processor_chip_CAN_RX/U1_PB8SparkFun MicroMod STM32 Processor_chip_SWDIO/U1_PA13_JTMSSparkFun MicroMod STM32 Processor_chip_SWDIO/U1_PA13_JTMSSparkFun MicroMod STM32 Processor_chip_SWDCK/U1_PA14_JTCKSparkFun MicroMod STM32 Processor_chip_SWDCK/U1_PA14_JTCKSparkFun MicroMod STM32 Processor_chip_AUD_OUT/U1_PB4_JTRSTSparkFun MicroMod STM32 Processor_chip_AUD_OUT/U1_PB4_JTRSTSparkFun MicroMod STM32 Processor_chip_AUD_IN/U1_PB5SparkFun MicroMod STM32 Processor_chip_AUD_IN/U1_PB5SparkFun MicroMod STM32 Processor_chip_AUD_LRCLK/SparkFun MicroMod STM32 Processor_chip_SPI_N_CS/U1_PA4_SPI1_NSS/U1_PC4SparkFun MicroMod STM32 Processor_chip_AUD_LRCLK/SparkFun MicroMod STM32 Processor_chip_SPI_N_CS/U1_PA4_SPI1_NSS/U1_PC4SparkFun MicroMod STM32 Processor_chip_AUD_LRCLK/SparkFun MicroMod STM32 Processor_chip_SPI_N_CS/U1_PA4_SPI1_NSS/U1_PC4SparkFun MicroMod STM32 Processor_chip_AUD_LRCLK/SparkFun MicroMod STM32 Processor_chip_SPI_N_CS/U1_PA4_SPI1_NSS/U1_PC4SparkFun MicroMod STM32 Processor_chip_AUD_BCLK/U1_PB3_JTDOSparkFun MicroMod STM32 Processor_chip_AUD_BCLK/U1_PB3_JTDOSparkFun MicroMod STM32 Processor_chip_I2C_SCL/U1_PB10SparkFun MicroMod STM32 Processor_chip_I2C_SCL/U1_PB10SparkFun MicroMod STM32 Processor_chip_I2C_SDA/U1_PB11SparkFun MicroMod STM32 Processor_chip_I2C_SDA/U1_PB11SparkFun MicroMod STM32 Processor_chip_I2C_N_INT/U1_PB1SparkFun MicroMod STM32 Processor_chip_I2C_N_INT/U1_PB1SparkFun MicroMod STM32 Processor_chip_I2C_SCL1/U1_PB6SparkFun MicroMod STM32 Processor_chip_I2C_SCL1/U1_PB6SparkFun MicroMod STM32 Processor_chip_I2C_SDA1/U1_PB7SparkFun MicroMod STM32 Processor_chip_I2C_SDA1/U1_PB7SparkFun MicroMod STM32 Processor_chip_BATT_VIN_3/U1_PA1SparkFun MicroMod STM32 Processor_chip_BATT_VIN_3/U1_PA1GNDGNDGNDGNDGNDGNDGNDGNDGNDFLASH_SDOFLASH_SDOFLASH_SDOFLASH_SDOFLASH_CS_NFLASH_CS_NFLASH_CS_NFLASH_CS_NFLASH_CS_NSparkFun MicroMod STM32 Processor_chip_SPI_SCK/U1_PA5_SPI1_SCKSparkFun MicroMod STM32 Processor_chip_SPI_SCK/U1_PA5_SPI1_SCKSparkFun MicroMod STM32 Processor_chip_SPI_SDO/U1_PA7_SPI1_MOSISparkFun MicroMod STM32 Processor_chip_SPI_SDO/U1_PA7_SPI1_MOSISparkFun MicroMod STM32 Processor_chip_SPI_SDI/U1_PA6_SPI1_MISOSparkFun MicroMod STM32 Processor_chip_SPI_SDI/U1_PA6_SPI1_MISOSparkFun MicroMod STM32 Processor_chip_A0/U1_PC5SparkFun MicroMod STM32 Processor_chip_A0/U1_PC5SparkFun MicroMod STM32 Processor_chip_A1/U1_PB0SparkFun MicroMod STM32 Processor_chip_A1/U1_PB0SparkFun MicroMod STM32 Processor_chip_PWM1/U1_PC7SparkFun MicroMod STM32 Processor_chip_PWM1/U1_PC7SparkFun MicroMod STM32 Processor_chip_D0/U1_PC0SparkFun MicroMod STM32 Processor_chip_D0/U1_PC0SparkFun MicroMod STM32 Processor_chip_D1/U1_PC1SparkFun MicroMod STM32 Processor_chip_D1/U1_PC1SparkFun MicroMod STM32 Processor_chip_TX1/U1_PA2_UART2_TXSparkFun MicroMod STM32 Processor_chip_TX1/U1_PA2_UART2_TXSparkFun MicroMod STM32 Processor_chip_RX1/U1_PA3_UART2_RXSparkFun MicroMod STM32 Processor_chip_RX1/U1_PA3_UART2_RXSparkFun MicroMod STM32 Processor_chip_G0/U1_PD2_SDIO_CMDSparkFun MicroMod STM32 Processor_chip_G0/U1_PD2_SDIO_CMDSparkFun MicroMod STM32 Processor_chip_G1/U1_PA8SparkFun MicroMod STM32 Processor_chip_G1/U1_PA8SparkFun MicroMod STM32 Processor_chip_G2/U1_PA0SparkFun MicroMod STM32 Processor_chip_G2/U1_PA0SparkFun MicroMod STM32 Processor_chip_G3/U1_PC8_SDIO_D0SparkFun MicroMod STM32 Processor_chip_G3/U1_PC8_SDIO_D0SparkFun MicroMod STM32 Processor_chip_G4/U1_PC9_SDIO_D1SparkFun MicroMod STM32 Processor_chip_G4/U1_PC9_SDIO_D1SparkFun MicroMod STM32 Processor_chip_G5/U1_PC13SparkFun MicroMod STM32 Processor_chip_G5/U1_PC13SparkFun MicroMod STM32 Processor_chip_G6/U1_PC2SparkFun MicroMod STM32 Processor_chip_G6/U1_PC2U1_PC15/Y2_pin1/C3_pin1U1_PC15/Y2_pin1/C3_pin1U1_PH0/C2_pin1U1_PH1/C1_pin1U1_PH1/C1_pin1U1_VCAP1/C5_pin1U1_PA11/R2_pin1U1_PA11/R2_pin1U1_PA12/R3_pin1U1_PA12/R3_pin1U1_BOOT0/Q1_pin3U1_BOOT0/Q1_pin3U2_D2_WP/U2_D3_HOLDU2_D2_WP/U2_D3_HOLDD5_pin1/R12_pin2U1_PH0_HSEU1_PH1_HSEBOOT_NBOOT0STAT \ No newline at end of file diff --git a/boards/SparkFun-MicroMod-STM32-Processor/index.tsx b/boards/SparkFun-MicroMod-STM32-Processor/index.tsx new file mode 100644 index 0000000..2ec62f0 --- /dev/null +++ b/boards/SparkFun-MicroMod-STM32-Processor/index.tsx @@ -0,0 +1,2 @@ +// boards/micromod-stm32-processor/index.tsx +export { default as MicroModSTM32Processor } from "./SparkFun-MicroMod-STM32-Processor.circuit" diff --git a/package.json b/package.json index bb3d1a2..5adba18 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "typescript": "^5" }, "dependencies": { + "@tscircuit/common": "^0.0.17", "tscircuit": "^0.0.743" } }