diff --git a/docs/hardware-plan.md b/docs/hardware-plan.md index f6c5fca..6234389 100644 --- a/docs/hardware-plan.md +++ b/docs/hardware-plan.md @@ -1,8 +1,16 @@ # Hardware Plan — flexible MIDI router (v1) -Status: draft 2026-08-21. Custom all-in-one PCB, RP2040 + CYW43439, desktop, -USB-powered, 0-10 V CV via onboard boost, 3.5 mm TRS MIDI, 4× stereo CV, -64×32 OLED + tact buttons (no encoder, low profile). +Status: draft 2026-08-21. Custom all-in-one PCB, desktop, USB-powered, 0-10 V +CV via onboard boost, 3.5 mm TRS MIDI, 4× stereo CV, 64×32 OLED + tact buttons +(no encoder, low profile). + +**MCU target:** develop/test on **RP2040** (Pico W dev board — the firmware +already runs on it), product on **RP2350**. The RM2 radio module is compatible +with both. The Rust firmware builds for either via embassy-rp features +(`rp2040` → `thumbv6m-none-eabi`; `rp235xa` for the RP2350A used in the Pico 2 W +→ `thumbv8m.main-none-eabihf`). Pin assignments below are RP2040/Pico-W; the +RP2350 product PCB keeps the Pico-2-W-compatible RM2 bus and reuses the same +peripheral choices. See `midi-router-architecture` (session memory) for the software/firmware architecture this hardware serves. @@ -10,9 +18,9 @@ architecture this hardware serves. ## 1. Block diagram ``` -USB-C 5V ──┬── 3.3 V buck ── RP2040 + W25Q16 flash + CYW43439 (BLE/WiFi) +USB-C 5V ──┬── 3.3 V buck ── RP2040 + W25Q16 flash + RM2 module (CYW43439, BLE/WiFi) │ │ - │ ├── PIO0 SPI ── CYW43439 (Pico-W pinout) + │ ├── PIO0 SPI ── RM2 (CYW43439 gSPI, Pico-W pinout) │ ├── USB DP/DM ── (USB-MIDI composite, CDC+MIDI) │ ├── UART0 ──── MIDI TRS in (6N138) / out │ ├── I2C0 ───── Pimoroni RGB Keypad (buttons) @@ -28,14 +36,14 @@ USB-C 5V ──┬── 3.3 V buck ── RP2040 + W25Q16 flash + CYW43439 (BLE ## 2. RP2040 pin map -Peripherals follow the Pico W reference for the CYW43 bus (so the cyw43 driver -and our firmware work unchanged) and our existing keypad wiring. +Peripherals follow the Pico W reference for the RM2/CYW43 bus (so the cyw43 +driver and our firmware work unchanged) and our existing keypad wiring. | Function | RP2040 pins | Notes | |--------------------|------------------------|-----------------------------------------| | USB device | GP14 (DM), GP15 (DP) | USB-C; CDC + MIDI composite | -| CYW43 PIO-SPI | GP29 (CLK), GP24 (DAT), GP25 (CS-out), GP23 (PWR), PIO0, DMA CH0/CH1 | copy Pico W | -| CYW43 onboard LED | CYW43 WL_GPIO0 | status/heartbeat | +| RM2 (CYW43) bus | GP29 (CLK), GP24 (DAT), GP25 (CS-out), GP23 (PWR), PIO0, DMA CH0/CH1 | copy Pico W | +| RM2 onboard LED | CYW43 WL_GPIO0 | status/heartbeat | | Keypad buttons | GP4 (SDA), GP5 (SCL) | I2C0, expander @0x20 | | Keypad LEDs | GP17 (CS), GP18 (SCK), GP19 (MOSI) | SPI0 tx-only, 4 MHz, APA102 | | DAC (CV outs) | GP10 (SCK), GP11 (MOSI), GP13 (CS) | SPI1 tx-only, 16-bit DAC; MISO unused | @@ -92,20 +100,26 @@ on 5 V (simpler, fewer parts, but half the CV range). - **Buttons:** 4× low-profile SMD tact (Up / Down / Select / Back) on GP6-9. No rotary encoder (height constraint). -## 7. CYW43439 RF section — the risk +## 7. RM2 radio module — risk largely eliminated -Bare CYW43439 on a custom PCB is the single hardest part: -- QFN routing (0.4 mm pitch), 32.768 kHz + 37.4 MHz crystals, 50 Ω controlled- - impedance RF trace, chip-antenna keepout (no copper under antenna). -- BLE transmits → FCC/CE intentional-radiator cert for commercial sale (less - critical for personal use, but the radio must still work). -- **Mitigation:** Raspberry Pi open-sourced the Pico W schematic + PCB — lift the - CYW43439 RF section verbatim (chip, crystals, RF match, antenna, keepout). +Use the **Raspberry Pi Radio Module 2 (RM2, part RMC20452T)**: a CYW43439-based +module (16.5 × 14.5 mm, 21 castellated pads) with integrated inverted-F PCB +antenna and internal PA/LNA/T-R switch. Full modular radio approval in US/EU/ +UK/CA (FCC ID 2ABCB-RMC2GW4B52) — no radio design or certification needed on +the host board. Software-compatible with the Pico W SDK, so our cyw43 firmware +works unchanged. + +Host PCB responsibilities (from the RM2 datasheet): +- Mount the 21 castellated pads; route the gSPI host pins to RP2040 (Pico W + pinout: CLK=GP29, DAT=GP24, CS=GP25, PWR=GP23, on PIO0 + DMA CH0/CH1). +- 3.3 V supply (no other rails). +- **Antenna keepout area** must remain free of metal per the datasheet for + the module's PCB antenna to perform. ## 8. BOM sketch -- RP2040 (QFN-56), W25Q16JV flash (16 Mb), CYW43439, 32.768 kHz + 37.4 MHz - crystals, chip antenna (Pico W part or equivalent). +- RP2040 (dev) / **RP2350A** (product) MCU, W25Q16JV-equivalent flash, + **RM2 radio module (RMC20452T, CYW43439 + PCB antenna, pre-certified)**. - DAC8568IAPW (8-ch 16-bit SPI, TSSOP-16) — or AD5668. - OPA4192IPW ×2 (quad RRO op-amp, TSSOP-14). - REF3040AIDBZ (4.096 V ref, SOT-23). @@ -118,19 +132,20 @@ Bare CYW43439 on a custom PCB is the single hardest part: ## 9. Risks / open items -1. **CYW43439 RF + cert** — biggest risk; copy the open Pico W RF section. -2. **0-10 V CV noise from the boost** — LC filter + dedicated 4.096 V Vref. -3. **Custom RP2040 bring-up** — needs a SWD header + Picoprobe; USB bootloader +1. **0-10 V CV noise from the boost** — LC filter + dedicated 4.096 V Vref. +2. **Custom RP2040 bring-up** — needs a SWD header + Picoprobe; USB bootloader only works after first flash. -4. **64×32 OLED UI** — tight; menu must be paginated and minimal. -5. **Boost current budget** — CYW43 TX spikes + 8 CV op-amps on a single USB +3. **64×32 OLED UI** — tight; menu must be paginated and minimal. +4. **Boost current budget** — RM2 TX spikes + 8 CV op-amps on a single USB 5 V/500 mA (USB 2.0) port is tight; specify USB-C 5 V/900 mA-3 A, or limit CV op-amp current. +5. **RM2 antenna keepout** — follow the datasheet keepout; the one layout + constraint the radio imposes. ## 10. Build order (hardware) 1. Schematic (this doc is the spec). -2. CYW43439 RF section — copied from Pico W reference. +2. RM2 module footprint + antenna keepout. 3. RP2040 + flash + USB + SWD. 4. Power (3.3 V buck, 12 V boost, Vref). 5. CV analog (DAC + op-amps + protection + TRS).