Description
charKEY is an advanced synthesizer built on the STM32 Microcontroller connected to a StackSynth synthesizer. Take a listen to the synthesizer below!
The synthesizer supports a number of advanced features
- 12-bit audio polyphony - all keys can be played at once without loss. Additionally, every key fully utilises the 12-bit resolution of the StackSynth DAC!
- Octaves - The synthesizer can be varied between 12 different octaves.
- Unique Waveforms - The synthesizer supports playing tones in sawtooth, sine wave, square wave, triangle wave as well as three uniquely designed waveforms: Clarinet, Retro and Electric Guitar!
- 44.1 kHz sampling frequency - Using a double buffering in tandem with memory-to-peripheral direct memory access (DMA), the synthesizer avoids costly context switching to upload new music data to the DAC. This allows the synthesizer to play music at a blazing 44.1 kHz!
- Works with multiple synthesizers - One synthesizer can be connected to other synthesizers using a CAN bus. This allows playing music on an even larger keyboard!

Development
charKey was developed in a group of 4 for the second coursework of the Imperial College London ELEC60013 Embedded Systems course taught by Dr. Ed Stott.
I was responsible for the low-level programming of the synthesizer. Unlike other groups, my group did not use an Arduino library layer to interact with the hardware of the STM32 Microcontroller. Instead, we used a pure C library developed by STM which allowed direct access to the hardware of the microcontroller. This allowed me to write incredibly performant C code using my knowledge of the internals of C compilers. This performance-oriented approach was critical in getting a 44.1 kHz sampling frequency to work.
You can check out the Github repo here.