MyRoboPath
Discipline Hub · 8 Technical Guides

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++

Guide 01
15 min read

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.

Key Takeaway:

Pin deterministic control loops (PID, encoders) to Core 1 and non-deterministic tasks (WiFi, HTTP, micro-ROS) to Core 0.

Difficulty: IntermediateRead Full Tutorial
Guide 02
13 min read

Object-Oriented C++ for Modular Robotics Firmware

Design reusable, testable hardware abstraction classes for DC motors, encoders, ultrasonic distance sensors, and state machines.

Key Takeaway:

Encapsulate pin definitions, calibration parameters, and internal state within dedicated C++ classes.

Difficulty: BeginnerRead Full Tutorial
Guide 03
16 min read

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.

Key Takeaway:

STM32 hardware timers feature built-in Quadrature Encoder Interface (SMS=001/010/011) that increments counter registers with zero CPU interrupts.

Difficulty: AdvancedRead Full Tutorial
Guide 04
14 min read

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.

Key Takeaway:

Use SPI for high-bandwidth sensors (IMUs at 1kHz+, TFT displays, SD cards).

Difficulty: BeginnerRead Full Tutorial
Guide 05
12 min read

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.

Key Takeaway:

A 16-element transition table in Flash RAM enables direction and count updates in fewer than 10 assembly instructions.

Difficulty: IntermediateRead Full Tutorial
Guide 06
15 min read

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.

Key Takeaway:

CAN bus uses differential pair lines (CAN_H, CAN_L) terminated with 120Ω resistors at each bus extremity to cancel common-mode noise.

Difficulty: AdvancedRead Full Tutorial
Guide 07
11 min read

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.

Key Takeaway:

An active ESP32 consumes ~80-240mA; entering Deep Sleep slashes consumption to under 10µA.

Difficulty: IntermediateRead Full Tutorial
Guide 08
15 min read

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.

Key Takeaway:

micro-ROS brings ROS 2 to resource-constrained microcontrollers with as little as 32KB RAM.

Difficulty: AdvancedRead Full Tutorial