← Back to Roadmap

🤖Microcontrollers

Programmable chips that are the brains of embedded systems — from Arduino to ESP32 and ARM Cortex.

MCU Architecture

A microcontroller integrates CPU + RAM + Flash + I/O peripherals on a single chip. Harvard architecture (separate program/data buses) is common. Key specs: clock speed (MHz), Flash size (KB/MB), RAM size, I/O count, and peripherals (ADC, PWM, UART, I2C, SPI, USB, CAN). The MCU reads instructions from Flash, processes data in RAM, and interacts with the world through I/O pins.

Popular MCU Families

AVR (Arduino Uno/Nano): ATmega328P, 16MHz, 32KB Flash, 2KB RAM, 8-bit. Great for learning. ARM Cortex-M (STM32, Teensy, SAMD): 32-bit, 48-480MHz, up to 2MB Flash, DSP instructions. Industry standard. ESP32: dual-core 240MHz, WiFi+BLE built-in, 520KB RAM. IoT powerhouse. RISC-V (ESP32-C3, CH32V003): open-source ISA, growing ecosystem. PIC (Microchip): legacy but still used in industrial.

GPIO & Peripherals

GPIO (General Purpose I/O): pins configurable as input or output, often with pull-up/down resistors, open-drain mode. ADC: analog-to-digital, 10-12 bit typical (1024-4096 levels). PWM: pulse-width modulation for LED dimming, motor speed, servo control. Timers/Counters: hardware timekeeping, input capture, output compare. Communication: UART, I2C, SPI, CAN, USB, I2S (audio).

🎮 Interactive: PWM Visualizer

🎮 Interactive: PWM Visualizer
Adjust frequency and duty cycle — see the waveform and understand how PWM controls brightness/speed.
50% duty → 2.50V avg. Used for LED dimming, motor speed, servo position.

💻 Arduino Blink Example

💻 Arduino Blink Example
// The "Hello World" of embedded systems
const int LED_PIN = 13;  // Built-in LED on most Arduino

void setup() {
  pinMode(LED_PIN, OUTPUT);  // Set pin as output
}

void loop() {
  digitalWrite(LED_PIN, HIGH);  // Turn LED ON (5V)
  delay(1000);                   // Wait 1 second
  digitalWrite(LED_PIN, LOW);   // Turn LED OFF (0V)
  delay(1000);                   // Wait 1 second
}
// This toggles the LED every second
// PWM version: analogWrite(LED_PIN, 128); // 50% brightness