Start from the requirements, not the chip
It’s tempting to pick a microcontroller first, often the one you used last time or the one on a popular development board, and design the rest of the project around it. That works for quick experiments, but for anything you plan to build more than once, it’s better to work out what the system needs and then find the part that fits.
Before looking at any datasheets, sketch:
- A block diagram of the hardware: sensors, actuators, displays, radios, storage and power.
- A rough list of software tasks: what runs, how often, and how quickly each must respond.
- The constraints: battery life, size, operating temperature, budget per unit, expected production volume and any certifications.
These feed directly into the steps below. Microcontroller selection is one step in the wider embedded system design flow, and it is closely tied to how you split work between hardware and software, covered in hardware-software co-design.
Step 1: List every interface and pin you need
Go through the block diagram and list every connection the MCU must make:
- Communication interfaces: UART, SPI, I2C, USB, CAN, Ethernet, I2S for audio, SDIO for SD cards.
- Digital I/O: buttons, LEDs, relays, chip-select and interrupt lines.
- Analog inputs: sensors that output a voltage, battery monitoring.
- Timing and control outputs: PWM for motors, LEDs and servos, timer inputs for encoders.
- Debug and programming: SWD or JTAG pins, a bootloader UART.
Count the pins, then add spares for things you’ll inevitably add later. Note any interfaces that need specific hardware: USB device support, CAN controllers and Ethernet MACs are not on every part, and they also need more program memory for their software stacks.
Check pin multiplexing too. A datasheet may list three SPI ports and four UARTs, but on a given package they may share pins, so you can’t always use them all at once. Vendor pin-configuration tools, such as STM32CubeMX or MCUXpresso Config Tools, make this easier to check.
Step 2: Estimate the processing load
Work out roughly how much computation the software needs:
- How often do control loops run, and how quickly must they respond?
- Is there signal processing, such as filtering, FFTs or audio?
- Does any algorithm need floating-point maths? A hardware floating-point unit (FPU) makes this much faster.
- Will there be a graphical display, a file system, encryption or a network stack?
- Will you use an RTOS?
You don’t need precise figures. An order-of-magnitude estimate, such as “a few thousand simple operations per second” versus “real-time audio processing,” is enough to narrow the field.
Step 3: Choose the core and bit width
Microcontrollers broadly come in three sizes:
- 8-bit (for example AVR and many PIC parts): simple, robust, often very low cost and easy to learn at the register level. Good for simple control tasks.
- 16-bit (for example MSP430 and PIC24): historically popular for low-power and mixed-signal work.
- 32-bit (mostly Arm Cortex-M, plus a growing number of RISC-V parts): now the default for many new designs, because prices have fallen and they offer much more performance, memory and software support.
Within Arm, the Cortex-M0/M0+ cores target low cost and low power, Cortex-M3 and M4 offer more performance (with the M4 adding DSP instructions and an optional FPU), and Cortex-M7 and M33/M55-class parts target higher performance or security. Don’t pick the smallest core that just works; leave room for feature growth.
Step 4: Estimate flash and RAM, then add headroom
Flash holds the program and constant data; RAM holds variables, buffers and stacks.
- Look at similar past projects or example applications for a starting estimate.
- Add the size of any libraries: USB, TCP/IP, Bluetooth and graphics stacks can be large.
- Budget RAM for communication buffers, display frame buffers and each RTOS task’s stack.
- If you’ll support firmware updates over the air, you may need space for two firmware images.
Running out of memory late in a project is painful, so choose a part with generous headroom. A practical approach is to prototype on a larger-memory member of a family, then move to a smaller, cheaper pin-compatible part later if the final code allows it.
Step 5: Check the analog and timing peripherals
These details often decide between otherwise similar parts:
- ADC: resolution, sample rate, number of channels, and real-world accuracy. A “12-bit” ADC’s effective accuracy depends on noise, reference voltage and layout.
- DAC, comparators and op-amps: some MCUs include them, saving external parts.
- Timers: enough channels for your PWM outputs, advanced timers for motor control, input capture for encoders.
- DMA: lets peripherals move data without the CPU, important for high-speed data or low-power designs.
- Clocking: an accurate internal oscillator may be fine for simple designs, but USB, CAN and precise timing usually need a crystal.
Step 6: Consider power and supply voltage
- Supply voltage: most modern MCUs run from about 1.8 V to 3.6 V. If you need to connect to 5 V parts, check whether the I/O pins you need are 5 V tolerant, or plan level shifting.
- Active current: typically quoted per MHz; compare at the clock speed you’ll actually use.
- Sleep currents: compare in the specific mode you’ll use, with the RTC running and RAM retained if you need them, not just the lowest headline number.
- Wake-up time: important for devices that wake frequently.
For battery products, power is often the deciding factor. Our article on low-power embedded design explains how to evaluate it.
Step 7: Do you need built-in wireless?
If the product needs Wi-Fi or Bluetooth, a wireless system-on-chip (SoC) that combines the MCU and radio, such as Espressif’s ESP32 family or Nordic’s nRF52/nRF53 series, often simplifies the design. Wireless modules with pre-approved radio certification can also reduce the work of regulatory testing, though the final product usually still needs its own compliance checks. The alternative is a separate MCU with an external radio module, which gives more freedom of choice but adds parts and complexity.
Step 8: Look at cost, availability and longevity
- Unit price: check price at your expected volume, not just one-off price. Prices can differ a lot between quantities.
- Availability: check stock at several distributors and the typical lead times. Component shortages in recent years showed how a single unavailable chip can halt production.
- Second sources and families: a part with pin-compatible siblings gives you options if one variant becomes scarce or you need more memory.
- Longevity: for industrial or long-lived products, check whether the manufacturer has a longevity programme that commits to producing the part for a set number of years.
These factors connect to the cost metrics discussed in what are the design metrics of embedded systems.
Step 9: Evaluate tools, documentation and ecosystem
A capable chip with poor tools can cost more in engineering time than it saves in unit price. Check:
- Development boards: affordable evaluation boards let you start firmware before your hardware exists.
- IDE and compiler: free vendor IDEs, GCC or LLVM support, and compatibility with tools like PlatformIO.
- Debugging: support for common debug probes and features such as trace.
- Software libraries: HAL and driver quality, example code, RTOS ports (FreeRTOS, Zephyr) and middleware.
- Documentation: clear datasheets, reference manuals and errata sheets.
- Community: for hobbyists and small teams, a large community (Arduino, Raspberry Pi Pico, ESP32 and STM32 all have big ones) means more libraries, tutorials and answered questions.
Step 10: Consider package and manufacturing
- Package: QFP and QFN packages are common; BGA packages are compact but need more advanced PCB and assembly. If you’ll hand-solder prototypes, leaded packages such as TQFP or SOIC are easier.
- Assembly: check that your PCB assembler can handle the package.
- Programming in production: plan how firmware will be loaded on the production line.
If you’re turning a hobby prototype into a product, our guide from Arduino prototype to custom PCB covers these practical steps.
Step 11: Security and safety features
For connected or safety-related products, check for:
- Secure boot and the ability to lock the debug port.
- Hardware cryptographic accelerators and a true random number generator.
- Memory protection and, on some newer cores, Arm TrustZone for Cortex-M.
- Safety documentation and certified software libraries, if you need to meet standards like IEC 61508 or ISO 26262.
Microcontroller or microprocessor?
If the requirements include a rich graphical interface, a full networking stack with many services, large amounts of memory, or running Linux, a microprocessor (MPU) or application processor may be a better fit. These typically run embedded Linux, use external RAM and storage, and take longer to boot. A microcontroller is usually better for real-time control, low power, fast start-up, simpler hardware and lower cost. Some products use both: an MPU for the user interface and an MCU for time-critical control.
Popular microcontroller families compared
This table gives a broad, simplified picture; exact features vary a lot within each family, so always check the specific part.
| Family | Core | Typical strengths | Common use |
|---|---|---|---|
| Microchip AVR (e.g. ATmega328P) | 8-bit AVR | Simple, well documented, huge Arduino community | Learning, simple control, hobby projects |
| Microchip PIC | 8/16/32-bit | Very wide range, long availability, low-cost parts | Industrial and consumer control |
| ST STM32 | Arm Cortex-M (M0 to M7, M33) | Very broad family, strong tooling, many peripherals | General-purpose products of all sizes |
| Raspberry Pi RP2040 / RP2350 | Dual Arm Cortex-M0+ (RP2040); Cortex-M33 or RISC-V (RP2350) | Low cost, programmable I/O, good documentation | Hobby, education, cost-sensitive products |
| Espressif ESP32 family | Xtensa or RISC-V | Built-in Wi-Fi and/or Bluetooth, low cost | Connected devices, IoT |
| Nordic nRF52 / nRF53 | Arm Cortex-M4 / M33 | Bluetooth Low Energy, low power | Wearables, BLE sensors |
| TI MSP430 | 16-bit | Very low power, mixed-signal | Metering, low-power sensing |
| NXP LPC / i.MX RT / Kinetis | Arm Cortex-M | Broad range, high-performance crossover parts | Industrial, audio, high-speed control |
Worked example: choosing an MCU for a plant-watering controller
Imagine a small product that monitors soil moisture in four pots and waters them with small pumps, reporting to a phone app.
- Interfaces: four analog inputs for moisture sensors, four PWM or digital outputs for pump drivers, one I2C bus for a temperature and humidity sensor, a button and a status LED, plus SWD for debugging.
- Processing: light. Readings every few minutes, simple threshold logic, no floating-point-heavy algorithms.
- Connectivity: the phone app needs Wi-Fi or Bluetooth. Wi-Fi lets it report remotely without a hub.
- Memory: the Wi-Fi stack and an over-the-air update scheme dominate flash and RAM needs.
- Power: mains powered via a USB adapter, so ultra-low sleep current is not critical, but pump current needs a separate, robust supply path.
- Cost and volume: a small batch at first, so development speed matters more than saving cents.
- Ecosystem: mature Wi-Fi libraries and examples are important.
Result: a Wi-Fi-capable SoC from the ESP32 family, ideally as a pre-certified module, is a reasonable fit. It covers the analog inputs, PWM and I2C, includes Wi-Fi and has a large community. If the product were battery-powered and talked only to a nearby phone, a Bluetooth Low Energy part such as an nRF52 might be the better choice instead.
Prototype before you commit
Even after careful selection, buy a development board and test the risky parts early: the ADC’s real accuracy with your sensors, the radio’s range, the sleep current, and how well the libraries you need actually work. It is far cheaper to change microcontrollers at this stage than after the PCB is designed. Before you lay out a board around the chosen part, read our guide to power supply and decoupling design for microcontroller circuits.