Skip to content
Tutorials Center
My learning

Topics

Lesson 3 of 37 ยท Getting Started

Choosing a Board and Toolchain

Compare Arduino/AVR, STM32, ESP32, Raspberry Pi Pico, nRF52 and RISC-V boards, and learn how to pick a microcontroller and toolchain for your first embedded projects.

You can follow this whole course in a browser, because the examples simulate hardware in C. But embedded programming is most fun with a real board that blinks, beeps and reads sensors. This lesson helps you choose one, explains the main microcontroller families, and shows how to pick the software tools (the toolchain) around it.

There is no single best board. The right choice depends on what you want to learn, how much you want to spend, and what you plan to build. The good news: the concepts you learn in this track (registers, interrupts, timers, buses, scheduling) apply to every family. Switching later only means learning a new set of register names and a new vendor library.

The main families

Family Core Typical use Why people pick it
Arduino / AVR (ATmega328P, ATtiny) 8-bit AVR, 16-20 MHz, 2 KB RAM learning, simple gadgets huge community, simple, 5 V tolerant
STM32 (F0, F1, F4, L4, G0, H7) 32-bit ARM Cortex-M0 to M7 products, industry, learning ARM enormous range, rich peripherals, cheap Nucleo boards
ESP32 / ESP32-C3 / S3 Xtensa or RISC-V, 160-240 MHz Wi-Fi and Bluetooth devices, IoT radio built in, FreeRTOS included
Raspberry Pi Pico (RP2040 / RP2350) dual Cortex-M0+ or M33, 125-150 MHz learning, hobby, programmable I/O tiny price, great documentation, PIO state machines
Nordic nRF52 / nRF54 Cortex-M4 or M33 Bluetooth Low Energy wearables ultra low power radio
TI MSP430 / MSP432 / Tiva 16-bit or ARM ultra low power, education excellent documentation
Microchip PIC / SAM 8/16/32-bit industrial, automotive long product life, many variants
RISC-V (ESP32-C3, GD32V, CH32V) open ISA learning the open architecture no licensing fees, growing quickly

Do not worry about the long list. For learning, the sweet spot is a 32-bit ARM Cortex-M board (an STM32 Nucleo, a Raspberry Pi Pico, or a micro:bit) or an ESP32 if you want wireless from day one. Arduino Uno is still excellent for the first week because everything about it is simple.

What to look at on a datasheet

When you compare chips, read the front page of the datasheet for these numbers:

  1. Flash size. Where your program lives. Typical range: 8 KB to 2 MB.
  2. RAM size. Where variables and the stack live. 1 KB to 1 MB.
  3. Clock speed. Higher is faster but consumes more power.
  4. Core and instruction set. 8-bit AVR, 32-bit Cortex-M0/M3/M4/M7, RISC-V.
  5. Peripherals. Number of UARTs, SPI, I2C, timers, ADC channels and resolution, DAC, PWM channels, USB, CAN, Ethernet, radio.
  6. Supply voltage. 1.8 V, 3.3 V or 5 V. Mixing logic voltages can destroy pins.
  7. Current consumption. Active mA per MHz and sleep microamps.
  8. Package and price. A QFN-32 or a 64-pin LQFP, and the price at volume.
C Rank boards by what a project needs

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.

Toolchains and IDEs

The toolchain is the compiler, linker, debugger and flasher. Options, from easiest to most flexible:

  • Arduino IDE / Arduino CLI. One-click build and upload with a simple C++ API (digitalWrite, analogRead). Great to start; hides the registers.
  • PlatformIO (in VS Code). One project format for hundreds of boards, with libraries, unit tests and debugging. A good "grown-up" environment.
  • Vendor IDEs. STM32CubeIDE, MCUXpresso (NXP), Code Composer Studio (TI), Microchip Studio/MPLAB X, Nordic nRF Connect, Espressif ESP-IDF. They include code generators for pins and clocks.
  • Command-line with Make/CMake. arm-none-eabi-gcc, make or cmake, OpenOCD, GDB. Verbose to set up, but fully reproducible and perfect for continuous integration.
  • Vendor SDKs and HALs. CMSIS (Arm's standard core headers), STM32 HAL/LL, Pico SDK, ESP-IDF. They give you ready-made drivers.
  • Other languages. MicroPython and CircuitPython (Python on small boards), Rust with embedded-hal, and Zephyr/FreeRTOS in C. C and C++ remain dominant, which is why this course uses C.

Three layers of code are common, and it helps to know which one you are looking at:

Layer Example You write
Register level GPIOA->ODR |= (1u << 5); the fastest, most direct code
HAL / driver library HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5); portable calls provided by the vendor
Framework digitalWrite(13, HIGH); one-line calls, hides hardware

All three do the same thing underneath. This course starts from the register level so that you understand what the libraries do, then uses the libraries without fear.

C The same action at three levels (simulated)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with scanf or fgets), it gets the next line from this box.

Other items for the workbench

  • USB cable and a computer (Windows, macOS or Linux all work).
  • Breadboard, jumper wires, LEDs, resistors (220 ohm to 1 kohm), push buttons. The first projects need nothing else.
  • A USB logic analyzer (around 10 USD) lets you see signals and decode UART, I2C and SPI. It is the best first debugging tool you can buy.
  • A multimeter, and later an oscilloscope.
  • A debug probe if the board does not have one built in.
  • Sensors and displays: a temperature sensor (TMP36, DS18B20, BME280), a potentiometer, an OLED, a servo.

Safety tip: always check logic levels. Many boards are 3.3 V; connecting a 5 V signal to a 3.3 V-only pin can permanently damage it. Never connect a motor or relay coil directly to a microcontroller pin; use a transistor or driver with a flyback diode.

A sensible learning path

  1. Start with the simulations in this course to learn the ideas.
  2. Get one 32-bit board (Pico, STM32 Nucleo or ESP32) and blink an LED with a vendor library.
  3. Re-do the blink with raw register writes.
  4. Add a button with interrupts, then a UART printout.
  5. Add an I2C or SPI sensor.
  6. Run two tasks under FreeRTOS or Zephyr.
  7. Build a project (a data logger, a thermostat, a robot).

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a cross toolchain name like arm-none-eabi-gcc tell you?

    arm = target CPU, none = no OS (bare metal), eabi = the binary interface used. It produces firmware for Cortex-M chips.
  2. 2. Which is a typical fact about an ESP32 compared with an Arduino Uno?

    ESP32 chips have integrated radio, 32-bit cores at 160 MHz or more and hundreds of KB of RAM.
  3. 3. Which layer lets you write the fastest, most direct hardware code?

    Register access has no abstraction cost; frameworks and HALs add function calls and checks.
  4. 4. Why should you check logic voltage levels before wiring a sensor to a board?

    Pins have absolute maximum ratings. Exceeding them can destroy the input permanently.

Summary

  • Pick a 32-bit ARM Cortex-M board (STM32 Nucleo, Pico) or an ESP32 for learning; Arduino Uno is excellent for the very first steps.
  • Compare flash, RAM, clock, peripherals, voltage and power on the datasheet.
  • Toolchains range from Arduino IDE and PlatformIO to vendor IDEs and command-line GCC.
  • The same action can be written at register, HAL or framework level; this course starts at the register level.
  • Check logic levels and use drivers for motors; start with an LED, a button and a logic analyzer.

Next: Your First Program: Blinky