Microcontrollers & C++
Program bare-metal and real-time operating systems on ESP32, STM32, and AVR microcontrollers. Master timers, hardware interrupts, PWM motor control, UART/SPI/I2C protocols, and deterministic firmware architecture.
All Guides in Microcontrollers & C++
ESP32 FreeRTOS Dual-Core Architecture for Robotics
Harness both Xtensa LX6/LX7 cores on the ESP32: run high-frequency PID motor loops on Core 1 and Wi-Fi telemetry / ROS 2 bridging on Core 0 without jitter.
Pin deterministic control loops (PID, encoders) to Core 1 and non-deterministic tasks (WiFi, HTTP, micro-ROS) to Core 0.
Object-Oriented C++ for Modular Robotics Firmware
Design reusable, testable hardware abstraction classes for DC motors, encoders, ultrasonic distance sensors, and state machines.
Encapsulate pin definitions, calibration parameters, and internal state within dedicated C++ classes.
STM32 Bare-Metal Advanced Timers & High-Frequency PWM
Direct register manipulation of STM32 Advanced-Control Timers (TIM1 / TIM8) for complementary PWM, dead-time insertion, and encoder interface modes.
STM32 hardware timers feature built-in Quadrature Encoder Interface (SMS=001/010/011) that increments counter registers with zero CPU interrupts.
Serial Protocols for Robotics: UART, SPI & I2C Deep Dive
Compare speed, wire count, arbitration, and signal integrity for UART (RS485), SPI, and I2C across robotic sensors, displays, and master-slave coprocessors.
Use SPI for high-bandwidth sensors (IMUs at 1kHz+, TFT displays, SD cards).
Precise Quadrature Optical & Magnetic Encoder Decoding in C++
Implement glitch-filtered 4x quadrature encoder decoding using external GPIO hardware interrupts and lookup state transition tables.
A 16-element transition table in Flash RAM enables direction and count updates in fewer than 10 assembly instructions.
CAN Bus & CAN-FD for Industrial Robotics Networks
Connect high-torque BLDC actuators and smart joint modules using Controller Area Network (CAN 2.0B) with hardware message filtering and CRC validation.
CAN bus uses differential pair lines (CAN_H, CAN_L) terminated with 120Ω resistors at each bus extremity to cancel common-mode noise.
Low-Power Robotics: Deep Sleep & Wakeup Interrupts
Extend battery life of field environmental robots from hours to months using ESP32/STM32 deep sleep states, ULP coprocessors, and RTC GPIO timers.
An active ESP32 consumes ~80-240mA; entering Deep Sleep slashes consumption to under 10µA.
micro-ROS on ESP32: Seamless ROS 2 Integration on Microcontrollers
Run native ROS 2 nodes directly on microcontrollers: publish sensor topics and subscribe to cmd_vel using micro-ROS and the XRCE-DDS Agent.
micro-ROS brings ROS 2 to resource-constrained microcontrollers with as little as 32KB RAM.