Choosing an MCU
Picking a microcontroller is a trade-off between performance, peripherals, power, cost, robustness and ecosystem β not a single number. This page covers the common families, how to choose, and the traps to avoid.
Popular familiesβ
| Family | Core / ISA | Sweet spot |
|---|---|---|
| AVR (ATmega/ATtiny), PIC, 8051 | 8-bit | Cheap, simple, robust, low performance β Arduino Uno is AVR |
| STM32 (ST) | Arm Cortex-M0/M3/M4/M7/M33 | The lab default β huge range, rich peripherals, great tooling |
| ESP32 (Espressif) | Xtensa / RISC-V | Built-in Wi-Fi + BLE β IoT |
| Nordic nRF52/nRF53 | Cortex-M | Bluetooth Low Energy / low power |
| RP2040 / RP2350 (Raspberry Pi) | Cortex-M0+ / M33 + RISC-V | Cheap, dual-core, hobby & education |
| TI MSP430 | 16-bit | Ultra-low-power sensing |
| NXP, Renesas, Microchip SAM | Cortex-M | Industrial / automotive breadth |
| GD32, WCH CH32V, SiFive | RISC-V | Low-cost, open ISA, growing ecosystem |
Selection criteriaβ
- Performance β see the gotchas below; judge the core + features, not just MHz.
- Peripherals β the right count and type: ADC resolution/channels, timers/PWM, UART/IΒ²C/SPI/CAN/USB/Ethernet.
- Memory β enough flash + RAM, with headroom (an RTOS and stacks eat RAM).
- Power β active and sleep currents, low-power modes β critical for battery devices.
- Connectivity β is Wi-Fi/BLE/Thread/cellular integrated, or external?
- Cost β unit price at your volume, plus dev-board and tooling cost.
- Availability & lifecycle β current stock, longevity/EOL, and a second source. Supply shocks (2021β2022) stranded designs built around single-source parts.
- Operating temperature β match the grade to the environment (see below).
- Robustness & safety β brown-out detect, watchdog, ESD rating, ECC memory; safety certs (IEC 61508, ISO 26262) for critical systems.
- Ecosystem & compatibility β toolchain, HAL/RTOS support, debugger, community, and pin-compatible family members so you can scale up/down without a redesign.
- Security β TrustZone (Cortex-M33), secure boot, hardware crypto.
Operating temperature gradesβ
| Grade | Typical range | Use |
|---|---|---|
| Commercial | 0 β¦ +70 Β°C | Indoor consumer |
| Industrial | β40 β¦ +85 Β°C | Most real-world / outdoor |
| Automotive (AEC-Q100) | β40 β¦ +125 Β°C | Vehicles, harsh environments |
Match the grade to the environment
A commercial-grade part in an outdoor or engine-bay device will drift or fail. For anything beyond a benign indoor setting, default to industrial (β40β¦+85 Β°C).
Gotchas β read before you commitβ
Don't pick on clock speed aloneβ
MHz is only part of performance. Two chips at the same clock can differ several-fold:
- Architecture / IPC β a Cortex-M7 does far more per cycle than an M0+; DMIPS/MHz varies by core.
- FPU β without a hardware floating-point unit, every
floatis emulated in software (often 10Γ+ slower). An M4 @ 80 MHz with FPU can beat an M0 @ 100 MHz on math. - DSP instructions β Cortex-M4/M7 SIMD/MAC accelerate filtering and control loops.
- Flash wait states / cache β at high clocks the flash can't keep up; an accelerator/cache (or running from RAM) is what delivers the rated speed.
FPU: know what you need
Most Cortex-M4/M7 have a single-precision FPU. If your code needs double precision and the FPU is single-only, those doubles still run in software. Match the FPU to your math.
RISC-V vs. Armβ
| Arm Cortex-M | RISC-V | |
|---|---|---|
| Ecosystem | Mature β tools, RTOS, libraries, support | Younger, growing fast |
| ISA | Licensed (vendors pay Arm) | Open, royalty-free, customizable |
| Risk | Very low, proven | Tooling/fragmentation still settling |
| Cost trend | β | Often cheaper silicon |
- Choose Arm for proven tooling, broad RTOS/library support, and lowest project risk (the safe default today).
- Choose RISC-V for cost, openness, or custom silicon β and accept a less mature ecosystem.
Other things people forget
- Check the errata sheet β silicon bugs are real and can block a peripheral you rely on.
- Dev board + debugger availability β you want to prototype on day one (e.g. ST-Link/J-Link; see Programmers & Debuggers).
- Footprint/pin compatibility within a family lets you change memory/speed late without a board respin.
A quick decision flowβ
- Connectivity? Need Wi-Fi/BLE β ESP32 / nRF. Otherwise a plain MCU.
- Performance & math? Heavy float/DSP β Cortex-M4/M7 with FPU. Simple I/O β M0+/8-bit.
- Environment? Outdoor/harsh β industrial/automotive grade.
- Power? Battery β low-power family (MSP430, nRF, STM32L).
- Cost & supply? Check unit price and live stock + a second source.
- Ecosystem? Favor a family your team and tools already support.
See also: Firmware Approaches and the lab's Microcontrollers hardware guide.