5 exercises — vocabulary every embedded and IoT engineer needs in English: bare metal vs RTOS, MQTT messaging, volatile and ISRs, edge computing, and hardware communication protocols.
Core embedded & IoT vocabulary clusters
System types: bare metal, RTOS (FreeRTOS, Zephyr), bootloader, HAL, BSP, microcontroller (MCU)
A firmware engineer explains a system design: "We don't use an RTOS — the timing requirements are hard enough that we run on bare metal and handle everything in interrupt service routines directly." What is bare metal programming in embedded systems?
Bare metal programming means running code directly on the microcontroller without any operating system — no RTOS, no Linux, no scheduler. The firmware is the only software running on the hardware. Bare metal vs RTOS: Bare metal — you write your own main loop and interrupt handlers; full control, lowest latency, no OS overhead. Suitable for simple devices with deterministic timing. RTOS (Real-Time Operating System) — provides task scheduling, timing, IPC (semaphores, mutexes, queues). Examples: FreeRTOS, Zephyr, RTEMS. Suitable for complex firmware with multiple concurrent tasks. Key embedded vocabulary: HAL (Hardware Abstraction Layer) — a library (e.g., STM32 HAL) that wraps register access in functions. BSP (Board Support Package) — hardware-specific code for a particular board. Peripheral — on-chip hardware modules (GPIO, UART, SPI, I2C, timers, ADC). Register — memory-mapped hardware control locations. Bootloader — code that runs at power-on before the main firmware, often handling firmware updates. In conversation: "We kept it bare metal — the device only does one thing and the latency requirements are under 10 microseconds."
2 / 5
An IoT architect says: "Every sensor publishes its readings to an MQTT broker. The processing service subscribes to the temperature and pressure topics and stores the data in a time-series database." What is MQTT and why is it used in IoT?
MQTT (Message Queuing Telemetry Transport) is a publish-subscribe protocol designed for constrained environments: low bandwidth, high latency, or unreliable networks. Originally developed by IBM for monitoring oil pipelines via satellite. MQTT vocabulary: Broker — the central server that receives and routes messages (Mosquitto, EMQX, HiveMQ, AWS IoT). Publisher — a device that sends messages to topics. Subscriber — a client that receives messages on topics it subscribed to. Topic — a hierarchical string identifier (e.g., "sensors/floor2/temperature"). QoS (Quality of Service) — 0 = at most once (fire and forget), 1 = at least once, 2 = exactly once. Retain — the broker stores the last message on a topic for new subscribers. LWT (Last Will and Testament) — a pre-configured message the broker sends if a device disconnects unexpectedly. Why MQTT over HTTP for IoT: smaller packet overhead (2-byte header vs HTTP headers), persistent connections, push model vs polling, QoS guarantees. CoAP is another IoT protocol (UDP-based, even lighter). In conversation: "We use MQTT QoS 1 for sensor data — some duplicates are acceptable, but we can't afford to lose readings in the database."
3 / 5
A firmware developer writes in a code review: "You need to declare this variable as volatile — the compiler is optimising it out because it doesn't see any writes to it in the main loop, but the ISR modifies it." What does volatile do, and what is an ISR?
volatile in C/C++ instructs the compiler: "do not optimise, cache, or reorder accesses to this variable — always read it from memory." Without volatile, the compiler may cache the variable in a register and never re-read it from memory, missing updates made by an ISR. ISR (Interrupt Service Routine) is a function that runs asynchronously when a hardware interrupt fires — timer overflow, GPIO edge, UART receive complete, etc. ISR best practices: keep ISRs extremely short (set a flag, copy data to a buffer); never do heavy computation, blocking calls, or dynamic memory allocation in an ISR; variables shared between ISR and main code must be declared volatile. Atomic access: on 32-bit systems reading a 32-bit variable is atomic; reading a 64-bit variable in two instructions is not — an ISR could fire between the two reads. Solution: disable interrupts around multi-byte reads, or use atomic types. In conversation: "The bug was a race condition — the main loop read the ring buffer head pointer between the ISR's two writes, seeing a partially-updated index."
4 / 5
An IoT engineer discusses a connectivity architecture: "Edge devices don't have direct internet access — they send sensor data to local gateways over BLE or Zigbee. The gateway aggregates the data and forwards it securely to the cloud over MQTT. This reduces latency for local decisions." What is edge computing in this context?
Edge computing is processing data at or near the source of generation — on the device, gateway, or a local server — rather than sending everything to the cloud. Benefits: Low latency — local decisions (e.g., stopping a machine) don't depend on round-trip to the cloud. Bandwidth reduction — only relevant/aggregated data is sent to cloud. Offline resilience — the system works even when cloud connectivity is lost. Privacy — sensitive data can be processed locally without leaving the premises. Edge computing vocabulary: Edge device — a sensor, camera, or controller at the data source. Edge gateway — a more powerful device that aggregates and pre-processes data from multiple edge devices. Fog computing — Cisco's term for a hierarchy of edge nodes between devices and cloud. Inference at the edge — running ML models locally (e.g., on-device image recognition). In contrast, cloud computing centralises processing. The architecture: Device (sensor) → Gateway (edge) → Cloud (long-term storage, analytics). In conversation: "We run ONNX models on the gateway for real-time defect detection; only anomalies are uploaded to the cloud for human review."
5 / 5
A hardware engineer says: "We're using I2C to connect multiple sensors to the MCU on a shared bus. Each device has a unique 7-bit address, and the master initiates every transaction." What is I2C, and what does master/slave mean in this context?
I2C (Inter-Integrated Circuit) is a synchronous, 2-wire serial protocol: SDA (data) and SCL (clock). A single master can communicate with multiple slaves on the same bus, each identified by a unique 7-bit address. I2C characteristics: Speed — Standard (100 kHz), Fast (400 kHz), Fast-Plus (1 MHz). Multi-master — multiple masters possible but requires arbitration. Open-drain — both lines require pull-up resistors. Common I2C devices: temperature sensors (LM75), IMUs (MPU-6050), OLEDs (SSD1306), EEPROMs, RTC chips. Comparison with other embedded protocols: SPI (Serial Peripheral Interface) — 4-wire, faster (MHz), full-duplex, hardware select per device. Better for high-speed peripherals (displays, SD cards). UART — asynchronous, 2-wire, point-to-point only. Used for GPS, Bluetooth modules, debug output. CAN bus — used in automotive and industrial, robust noise immunity, multi-master, long cables. Note: "master/slave" terminology is being replaced in some communities with "controller/responder" or "host/peripheral." In conversation: "We had I2C address conflicts — two sensors had the same default address, so we had to pull the ADDR pin low on one to change its address to 0x49."