Foundations · Lesson 1 of 11 · about 10 min
What is a microcontroller?
The tiny computer inside every device
An embedded system is a small computer built into a device to do one job: a thermostat, a washing machine, the brakes of a car. Its heart is a microcontroller (MCU): one chip that holds a whole computer.
Every device follows the same pattern: read the inputs, decide in code, drive the outputs.
Microcontroller or microprocessor?
| Microcontroller (MCU) | Microprocessor (MPU) | |
|---|---|---|
| On the chip | CPU, memory and peripherals | Mostly the CPU |
| Memory | Kilobytes | Gigabytes |
| Software | Your C code, or a small RTOS | A full operating system such as Linux |
| Starts in | Microseconds | Seconds |
| Examples | STM32, ESP32, ATmega | Raspberry Pi, phones, laptops |
Everything is an address
The CPU sees flash, RAM and the hardware as one long list of numbered addresses. Reading a variable and switching on an LED are the same operation: write a value to an address.
The real app, running in your browser: this lesson with its 3D preview on a simulated ST NUCLEO-F401RE. No install, nothing to plug in.
int counter = 5; // the compiler picks an address in RAM
*(volatile uint32_t *)0x40020014 = (1 << 5); // GPIOA output register: pin PA5 high, LED on
What happens at power on
- The CPU reads the vector table at the start of flash: where the stack begins and where the startup code is.
- The startup code copies the initial values of variables into RAM and sets the clock.
- Your main() runs, and never returns: there is no operating system to return to.
Interview questions
- What is the difference between a microcontroller and a microprocessor?
- Where do the code and the variables live in an MCU?
- What happens between reset and main()?
No answers here on purpose: try answering out loud first. In the BoardPilot app, the interview coach reads your own answer and tells you what was right, what is missing and what a senior interviewer would ask next (it uses the AI provider you choose in the app). Embedded systems interview questions →
Key terms
Embedded system Microcontroller (MCU) MCU vs MPU (microprocessor) Peripheral Flash memory RAM (SRAM) Stack Register Memory map Vector table
In the app, the lessons come alive
The lessons have interactive demos and hands-on labs checked on your board in the app. These pages are the readable version: the demos are described in words, and the labs need the app.