Selecting Microcontrollers for Music

I was browsing some of the newer ATtiny chips the other day and started to make a note of some of their properties and it made me realise I actually have quite a few different microcontrollers at my disposal and many more I could be having a look at.

But having committed to not attempting to get hold of every variant of every device to put a MIDI interface on it, I thought it would still be worth a post summarising some of the features to make selecting them in the future a little easier.

There are many comparison charts and tables online, but this is my own summary of the things that are important to me right now in terms of using them for musical purposes.

Note: I think the data is correct at the time of writing. Feel free to let me know of any mistakes. Also feel free to let me know what microcontrollers you use for music, and why, in the comments.

8-bit Microcontrollers

MCUFreqPWRGPIOADCPWMDACCommsRAMFlash
ATmega328P16MHz2.7-5.5V236/860UART, I2C, SPI2K32K
ATmega32U416MHz2.7-5.5V261280UART, I2C, SPI, USB2.5K32K
ATtiny858/20MHz2.7-5.5V6460USI5128K
ATtiny8812MHz2.7-5.5V28620I2C, SPI5128K
ATtiny21(2|4)
ATtiny41(2|4|6)
20MHz1.8-5.5V6|12
6|12|18
6|10
6|10|12
61UART, I2C, SPI128
256
2K
4K

32-bit Microcontrollers

MCUFreqPWRGPIOADCPWMDACCommsRAMFlash
SAMD21 (M0+)48MHz1.6-3.6V30/381430?1SERCOM, I2S, USB4-32K32-256K
SAMD51 (M4)120MHz1.6-3.6V513237?1SERCOM, I2S, USB128-256256-1024K
RP2040 (2xM0+)133MHz3.3V304110UART, I2C, SPI, USB, PIO264Kexternal
ESP32 (LX6)160MHz3.0-3.6V3418162UART, I2C, SPI, I2S, Wi-Fi, BT0-2M0-4M
ESP32-S2 (LX7)240MHz2.8-3.6V432080UART, I2C, SPI, I2S, Wi-Fi0-2M0-2-4M
ESP32-S3 (2xLX7)240MHz3.0-3.6V452080UART, I2C, SPI, I2S, Wi-Fi, BT0-2-8-16M0-4-8M
ESP32-A1S (2xLX6)240MHx3.0-3.6V14??2UART, I2C, SPI, I2S520K+4M0?

Points of Note

  • The ATmega and ATtiny devices are all 8-bit AVR architecture and might be either 3V3 or 5V operation depending on the device. Whereas the others are all 32-bit, 3V3 operation, and either ARM or Tensilica Xtensa architectures.
  • The SAMD51, ESP32 and ESP32-S3 are all interesting as they include a floating point unit, which might be useful if I get into requiring mathematical synthesis.
  • ATtiny2xx, ATtiny4xx, SAMD21, SAMD51, ESP32 all include a DAC which would be really useful for generating control voltages.
  • ATmega32U4, SAMD21, SAMD51, RP2040 all support USB directly.
  • The last one is an interesting device. The ESP32-A1S is a single module that includes an ESP32 and a CODEC module. More recent versions use the ES8388 and support two audio in/out channels. There is an Espressif Audio Development Framework for use with all ESP32-based devices.

Other MCUs of possible interest might include some of the newer RISC-V devices (e.g. ESP32-C3), the STM32 device range (the higher performing devices include floating point support, for example), the Teensy boards (which have a strong following for audio applications), and even running with the broadcom devices used on the various Raspberry Pis in “bare metal” mode.

A key tradeoff already would be choosing between a more powerful, probably 32-bit, 3V3 logic devices or a less capable 5V device.

Development Boards

I’m unlikely to be working with a microcontroller directly though, given my own level of knowledge, so I’m probably going to be looking at some kind of development board.

The following could all be possibilities if I’m happy running at 3V3.

Note, many of the form-factors, e.g. Adafruit’s QT Py or Feather, support most of the architectures – but not all are listed – just those I have or might consider. I’ve also added in some other boards that I know are often used (or shout about being used) for audio applications.

Prices are approximate at time of writing (Feb 2024).

BoardMCUArchSpeedRAM/FlashGPIOADCPWMI2SDACCost
RPi PicoRP20402xM0+133MHz264K/2M27316PIO0£4
XIAOSAMD21M0+48MHz32K/256K14111111£6
XIAORP20402xM0+133MHz264K/2M11411PIO0£6
XIAOESP32-S32xLX7240MHz8M/8M1191110£8
XIAOESP32-C3RISC-V160MHz4K/4M114110£6
QT PySAMD21M0+48MHz32K/256K119911£9
QT PyRP20402xM0+125MHz264K/8M13413PIO0£10
QT PyESP32-S32xLX7240MHz512K+2M/4M13101310£15
TrinketSAMD21M0+48MHz32K/256K55211£9
ItsyBitsySAMD21M0+48MHz32K/256K23111311£12
ItsyBitsySAMD51M4120MHz192K/512K+2M2371812£15
FeatherSAMD21M0+48MHz32K/256K2062011£19
FeatherSAMD51M4120MHz192K/512K+2M2161612£23
FeatherRP20402xM0+125MHz264K/8M21416PIO0£12
FeatherESP32-S32xLX7240MHz2M/4M2162110£17
BananaPicoWESP32-S32xLX7240MHz512K/2M+8M2718810£4
WROOM32ESP322xLX6<240MHz500K/448K+4M34152512£3
Teensy 3.6MK66FX1M4F180MHz256K/1M64252212N/A
Teensy 4.0IMXRT1062M7600MHz1M/2M40143120£26
Teensy 4.1IMXRT1062M7600MHz1M/8M55183520£30
Arduino MKR ZeroSAMD21M0+48MHz32K/256K2271311£30
Arduino Giga R1STM32H747XM7
M4
480MHz
240MHz
1M/2M761413?2£70

It is interesting to note which boards support a DAC and which support I2S, both very useful for audio applications and the number of ADCs is relevant too.

Boards specifically designed for audio processing, which I’ve no direct experience of, include:

  • Pico ADK – A RP2040 based “audio development kit” with 8 ADCs and SPI DAC.
  • Daisy Seed – an ARM Cortex-M7 with audio IO designed for DSP and audio applications (£35)
  • Bela and Bela Mini – designed for use with Beaglebone for real-time, low-latency audio processing (~£130-£160).

Software Audio Frameworks

There are a number of software frameworks for use with some of the above for audio processing:

There is a bit of discussion about these here: Arduino Audio and MIDI Frameworks.

Closing Thoughts

I expect this page will evolve with new information, but it will be good to have a single post to refer back to.

Kevin

2 thoughts on “Selecting Microcontrollers for Music

    1. Yes good point! I have some of those and was experimenting with trying to get Mozzi running at the higher clock rate. I stalled for some reason and haven’t picked it up again 🙂

      Thanks for the reminder!

      Like

Leave a comment