TouchPlaited — code map

the instrument as a map: boards, pins, memory, and where the code runs

execution context signal flow hover any part · click to pin it (and get a #link) · esc to unpin

Hardware

SYNTHUX SIMPLE TOUCH — carrier PCB MPR121 12·ch cap MPR121 BREAKOUT I2C addr 0x5A 12 TOUCH PADS ON PANEL → SCL SDA 3V3 GND ADDR IRQ I2C1 · pads in the ISR · OLED in main OLED · SSD1306 128×32 · 0x3C · optional SW2 right 3-pos playmode SW1 left 3-pos scale·genre·arp TRS MIDI in / out mod always active AUDIO out L/R jacks + audio in 48 kHz DAISY SEED USB one port, one owner: USB MIDI, or the serial log (make MEASURE=1) user LED · blink codes SDRAM 64 MB · FX buffers STM32H750 Cortex-M7 · 400 MHz everything runs here QSPI NOR 8 MB · XIP + settings CODEC 48 kHz · 192-smp blocks A0–A7 8 POTS — PER-MODE KNOB LAYERS S43 · CV clock in raw ADC counts → edge detector S40 · CV clock out pulsed from the audio ISR touch → I2C → AudioCallback → voices (AXI SRAM) → FX (SDRAM) → limiter → codec → out pin in use audio power/gnd free P0–P2 modifiers P3–P9 musical P10/P11 octave

Memory & execution

1 · bootloaderinternal flash, 128 KB — reserves first 256 KB of QSPI
→
2 · app, XIP from QSPIruns in place at 0x90040000 (APP_TYPE = BOOT_QSPI) · a constructor copies the Six-Op code to ITCM first
→
3 · Setup()hw + LED workaround · journal scan/restore · stale-sector erase · pads, OLED boot animation (blocking, pre-audio)
→
4 · StartAudio()AudioCallback @ 250 Hz ‖ main loop, forever
0x90000000QSPI flash 8 MB
boot rsv 256K
app ~470K
free
journal 2×32K
guard 64K
code + rodata (XIP) · settings journal just below a 64 KB no-touch guard band at the top

segment widths not to scale

0x24000000AXI SRAM 512 KB · ~55%
.data/.bss hot state · voice working set (moved from SDRAM for the 6-voice CPU win) · RAM-resident QSPI write routine tp_qspi_ram_op
0xC0000000SDRAM 64 MB · ~2.3 MB
FX delay/reverb buffers, four groups (.sdram_bss, NOLOAD) · nothing else
0x30000000SRAM1 (D2) 32 KB · ~55%
DMA buffers (audio, ADC, UART) — MPU marks the region non-cacheable
0x20000000DTCM 128 KB
stack only · no data placed here
0x00000000ITCM 64 KB · ~32%
Six-Op render path (20.8 KB of code) — loads from QSPI, copied here before any static constructor runs
0x38800000Backup SRAM 4 KB
bootloader version stamp (12 bytes) — a bootloader older than v6.0 leaves none, hence the manual hw.led.Init()

AudioCallback — ISR · 250 Hz / 4 ms blocks

  1. load-shed guard — last block over 90 %: sleep the oldest non-held voice
  2. touch.Process() — I2C pad read + touch callbacks · skipped while an OLED page is on the bus
  3. knobs + pickups — 8 pots, per-mode layers
  4. SW1/SW2 handling — change-latched sub-states
  5. seq / arp / note-rec ticks + CV clock in & out
  6. 8 × 24-sample Plaits chunks → 6-voice pool
  7. 4 FX groups → soft limiter — linear below 0.8
  8. CPU meter — this block's load feeds the guard at the top

Main loop — everything the ISR must not do

  1. MIDI service — UART + USB, bounded TX drain
  2. telemetry — SysEx state frame over USB (33 ms limit) · live link for 10 s after a request
  3. OLED — redraw at most every 40 ms, changed pages only
  4. CPU serial print — make MEASURE=1 builds only · sv N = settings save count
  5. persist_tick() — debounced auto-save: 250 ms compare · 3 s settle · one flash page per pass · gated on load < 85 %
  6. LED pattern state machine — blink codes; its delays keep servicing MIDI