Microcontrollers: Basics
Overview
A microcontroller (MCU) is a tiny computer on a single chip: processor, memory, and input/output ports. The lower-level 'brain' of any robot.
What is a Microcontroller
A microcontroller is a single-chip system: processor core, flash memory, RAM, and peripherals (timers, ADCs, interfaces) in one package. It costs pennies, consumes milliwatts, and operates in real-time.
How it Differs from a Microprocessor
| Microcontroller (MCU) | Microprocessor (CPU) | |
|---|---|---|
| Memory | On-chip | External |
| OS | None or RTOS | Linux/Windows |
| Power | Milliwatts | Watts |
| Tasks | Motor control, sensor management | Calculations, applications |
| Examples | STM32, AVR, ESP32 | Intel, AMD, ARM Cortex-A |
Where Used in Robots
- Reading sensors: gyroscopes, accelerometers, encoders.
- Controlling motors and servos with millisecond latency.
- Balance reflexes — the level of 'spinal cord' in hybrid architecture.
Popular Platforms
- Arduino — the easiest entry point for learning.
- STM32 — industrial standard.
- ESP32 — built-in Wi-Fi/Bluetooth, convenient for IoT.