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 · read in the audio ISR 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 serial log (-DUSB_MIDI) LED = the display SDRAM 64 MB · voices + FX STM32H750 Cortex-M7 · 480 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 (SDRAM/AXI) → FX → 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)
3 · main() inithw + LED workaround · journal scan/restore · stale-sector erase (blocking, pre-audio)
4 · StartAudio()AudioCallback @ 250 Hz ‖ main loop, forever
0x90000000QSPI flash 8 MB
boot rsv 256K
app ~360K
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 · ~53%
.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
Plaits voice instances · FX delay/reverb buffers (.sdram_bss, NOLOAD)
0x30000000SRAM1 (D2) 32 KB
audio DMA buffers — MPU marks the region non-cacheable
0x20000000DTCM 128 KB
stack · mostly free
0x00000000ITCM 64 KB · 0%
unused — the known future lever for a 7th voice
0x38800000Backup SRAM 4 KB
bootloader version stamp — this device reports < v6.0, hence the manual hw.led.Init() workaround

AudioCallback — ISR · 250 Hz / 4 ms blocks

  1. touch.Process() — I2C pad read + touch callbacks
  2. knobs + pickups — 8 pots, per-mode layers
  3. SW1/SW2 handling — change-latched sub-states
  4. seq / arp / note-rec ticks + CV clock in & out
  5. 8 × 24-sample Plaits chunks → voice pool
  6. 4 FX groups → soft limiter
  7. CPU meter + >90 % load-shed guard

Main loop — everything the ISR must not do

  1. LED pattern state machine — the only display
  2. MIDI service — UART + USB, bounded TX drain
  3. CPU serial print sv N = settings save count
  4. persist_tick() — debounced auto-save: 250 ms compare · 3 s settle · one flash page per pass · gated on load < 85 %