SIOT Logs
UART links exactly two devices over TX/RX with an agreed baud rate; I2C shares two wires among many addressed devices; SPI uses four wires and a chip-select per device for the highest speed.
* Three buses, three wiring patterns: point-to-point, shared and addressed, or shared wi...
Q What is Compiler Explorer (godbolt.org), and what is it useful for?
A website that compiles code as you type and shows the resulting assembly side by side, for many languages, compilers and versions, so you can see exactly what the compiler made of your code.
You pick a language (C, C++, Rust, Go and dozens more), a compiler and version (for exam...
Q In a preemptive RTOS scheduler, when does a running thread stop running, and what does time-slice sc...
A running thread keeps the processor until it finishes, a higher-priority thread becomes ready, or it gives up the processor to wait for something (e.g. calls sleep). Time slicing additionally guarantees that threads of equal priority each get a turn.
The scheduler decides which...
Q In the ESP32 blink demo, what are the roles of the laptop, the cross-compiler and FreeRTOS?
The laptop (Linux) writes the C app and builds it with a cross-compiler that produces machine code for the ESP32's Xtensa processor; the image, containing the app and FreeRTOS, is uploaded over USB; on the board FreeRTOS schedules the task that switches the LED on and off.
The de...
Q What separates a single-board computer like the Raspberry Pi from a microcontroller board like the A...
A single-board computer has an application processor, gigabytes of RAM and runs a full OS such as Linux. A microcontroller board has kilobytes of RAM, runs one bare-metal or RTOS program, and uses a tiny fraction of the power.
* IoT boards span six orders of magnitude of RAM. Th...
Q What are an FTDI adapter and a breakout board, and why are they in the IoT prototyping toolkit?
An FTDI adapter is a USB-to-serial converter that lets a laptop program or talk to a board without its own USB port; a breakout board mounts a tiny chip on a PCB with standard pins so it can be wired up by hand.
Prototyping is mostly about getting parts connected before designing...
Q How do bare metal, embedded Linux and an RTOS compare as ways to program an IoT device?
Bare metal is one stand-alone program with no kernel. Embedded Linux gives a full OS with drivers and tools at the cost of size and power. An RTOS sits between them: a small real-time kernel that runs tasks concurrently with predictable timing.
* Three ways to structure device s...
Q What are the four task states in FreeRTOS, and what moves a task between them?
Running (on the CPU), Ready (able to run, waiting for the CPU), Blocked (waiting for an event or timeout) and Suspended (removed from scheduling until explicitly resumed). The scheduler always runs the highest-priority Ready task.
* The scheduler only chooses among Ready tasks....
Q How is the LED wired to the ESP32 dev board in the blink demo, and why is the resistor there?
The LED's anode (long leg) goes to GPIO pin IO5; its cathode (short leg) goes through a 330 Ω resistor to GND. The resistor limits the current the pin has to supply.
LED
Resistor
ESP32
Anode (long leg)
—
IO5
Cathode (short leg)
330 Ω
GND
When the program sets IO5 high...
Q An Arduino Uno R3 has 32 KB of flash, 2 KB of SRAM and 1 KB of EEPROM. What is each memory used for?...
Flash holds the program, SRAM holds the variables while it runs, and EEPROM keeps small settings across power cycles.
The three memories differ in whether they survive power loss and how often they can be written:
Memory
Keeps data without power?
Holds
Constraint
Flash (32...