Gamma Hardware Controls & Peripheral Driver Reference¶
This skill documents how to interface with all front-panel user interface controls on the this.is.NOISE Gamma Mini Synth, powered by an embedded Electro-Smith Daisy Seed 2 DFM (ARM Cortex-M7 @ 480 MHz, STM32H750IBK6).
It synthesizes findings, drivers, and timing architectures validated in:
firmware/phase3_adc(Analog Potentiometers, Joysticks & OLED Display)firmware/phase4_keys_encoder(14 Tactile Keys, Rotary Encoder & 1 kHz Timer ISR)
Pin Definitions & Header Location¶
All hardware pin assignments, peripheral channel constants, and polarity inversion flags are centralized in the shared header provided by the Gamma Pinout Skill:
- Canonical Skill Header:
gamma-pinout/resources/gamma_pins.h - Firmware Working Copies:
firmware/phase3_adc/gamma_pins.hfirmware/phase4_keys_encoder/gamma_pins.h
Front-Panel Controls Summary¶
| Peripheral Group | Controls | Daisy Seed Pins | Bus / Interface | Software Inversion | Reference Guide |
|---|---|---|---|---|---|
| OLED Display | 1.3" 128x64 Monochrome | D11 (SCL), D12 (SDA) |
I2C1 @ 0x3D (1 MHz) |
N/A | Display Reference |
| Potentiometers | 4 Top Knobs (Chord/Notes Vol & Filter) | D18, D17, D19, D20 |
ADC1 (Ch 7, 5, 3, 11) |
Inverted (1.0 - raw) |
Analog Inputs Reference |
| Left Joystick | LX (Mod/Pitch), LY (Mod/Pitch) | D22, D21 |
ADC1 (Ch 19, 4) |
LX: Normal, LY: Inverted | Analog Inputs Reference |
| Right Joystick | RX (Filter/FX), RY (Filter/FX) | D24, D23 |
ADC1 (Ch 17, 18) |
RX: Inverted, RY: Inverted | Analog Inputs Reference |
| Note Keys | 7 Tactile Switches (N1–N7) | D1–D7 |
Discrete GPIO w/ Pull-up | Active-Low (0 = Pressed) |
Digital Keys Reference |
| Chord Keys | 7 Tactile Switches (C1–C7) | D8–D10, D13, D14, D26, D27 |
Discrete GPIO w/ Pull-up | Active-Low (0 = Pressed) |
Digital Keys Reference |
| Rotary Dial | Quadrature Encoder & Push Switch | D15 (A), D16 (B), D28 (Click) |
GPIO Pull-up / FSM | 4 transitions / detent | Rotary Encoder Reference |
Reference Guides Directory¶
Consult the detailed topical references below for full code snippets, electrical characteristics, and timing constraints:
- OLED Display (SSD1306 on I2C1)
- I2C1 force-reset sequence (
__HAL_RCC_I2C1_FORCE_RESET) to recover from soft-reboots. - Fast Mode Plus (
I2C_1MHZ) configuration and pin assignments (PB8/PB9). -
Frame refresh budgeting and working around the ~9–10 ms blocking transmission hazard.
- Multi-channel
AdcChannelConfigsetup for 8 user controls + 1 auxiliary channel (D31/PC2). - Potentiometer polarity sweep (3.3V CCW -> 0V CW) requiring software inversion.
- Joystick axes breakdown and why Right Stick X is reversed on the PCB.
-
Deadband filtering for knobs vs. responsive exponential smoothing (
iir = 0.05f) for joysticks. - Physical layout: 7 Note keys (left grid) and 7 Chord keys (right grid).
- Active-low electrical configuration with internal pull-ups (
INPUT_PULLUP). - Fast 1 kHz debouncing via
daisy::Switch(8–10 ms response time). -
Lock-free ring buffer event queue for transferring key events to the main thread.
- Quadrature Gray code lookup table decoding 4 state transitions per mechanical detent click.
- Why polling the encoder in the main loop drops pulses during OLED refreshes.
-
1 kHz hardware timer configuration (
TIM5@ 240 MHz APB1 clock). - End-to-end firmware boilerplate integrating all controls into a non-blocking architecture.
- Initialization sequence: speaker mute (
PC3drivenLOWduring boot, unmutedHIGHafter audio start), display reset, ADC start, and timer start. - Main loop event processing, encoder delta dispatch, analog polling, and throttled display rendering.
Diagnostic Checklist & Troubleshooting¶
| Symptom | Cause | Solution Reference |
|---|---|---|
| OLED blank or frozen on reboot | I2C bus locked up by previous transfer | Display Bus Reset |
| Knob values decrease when turned CW | Potentiometer wiper sweeps from 3.3V at CCW | Knob Inversion |
| Right stick X moves opposite to Left stick | PCB trace routing reversed on right stick | Stick Polarities |
| Rotary encoder misses clicks while turning | Main loop blocked by oled.Update() (9–23 ms) |
1 kHz Timer Architecture |
| Keys feel sluggish or drop quick presses | Low polling rate in main loop | 1 kHz Key Debounce |
| Synth locks up / note plays forever | libDaisy Logger blocked in TransmitSync after terminal closed |
Gamma Pinout USB CDC |
| Buttons and encoder stop responding / freeze | Audio callback overload / runaway DSP voice starving TIM5 ISR (NVIC priority 15) | Avoid undamped DaisySP models (AnalogBassDrum > 90 Hz), gate idle voices, and enforce maximum lifetime ceilings on activity gates |