From Embedded Software Engineer to Musician
In his first blog post on EmbeddedRelated, Jean Labrosse, the author of the uC/OS series and founder of Micrium, discusses his transition from an embedded software engineer to a musician.
Bit-Banged Async Serial Output And Disciplined Engineering
This post covers implementing asynchronous serial output directly on a GPIO with bit-banging. This can be a valuable debug tool for getting information out of a system. It also covers disciplined engineering, using the bit-banging module as an example and template you can apply to other projects.
Jumping from MCUs to FPGAs - 5 things you need to know
Are you a microcontroller expert beckoned by the siren song of the FPGA? Not long ago, that was me. FPGA-expert friends of mine regularly extolled the virtues of these mysterious components and I wanted in. When I made the leap, I found a world seemingly very familiar, but in reality, vastly different. I found that my years of C programming and microcontroller use often gave pre preconceived interpretations of FPGA resource material which resulted in eye-roll class mistakes in my code. I’ve gleaned five things of vital importance to help you make that transition faster than I did.
Assembly language is best - except when it isn’t
A look at why writing in C often produces more efficient code than hand-written assembly language.
C to C++: 5 Tips for Refactoring C Code into C++
The article titled "Simple Tips to Refactor C Code into C++: Improve Embedded Development" provides essential guidance for embedded developers transitioning from C to C++. The series covers fundamental details necessary for a seamless transition and emphasizes utilizing C++ as a better C rather than diving into complex language features. The article introduces five practical tips for refactoring C code into C++. Replace #define with constexpr and const: Discouraging the use of #define macros, the article advocates for safer alternatives like constexpr and const to improve type safety, debugging, namespaces, and compile-time computation. Use Namespaces: Demonstrating the benefits of organizing code into separate logical groupings through namespaces, the article explains how namespaces help avoid naming conflicts and improve code readability. Replace C-style Pointers with Smart Pointers and References: Emphasizing the significance of avoiding raw pointers, the article suggests replacing them with C++ smart pointers (unique_ptr, shared_ptr, weak_ptr) and using references
Why Should Unit Tests Feel Like Simulations?
Treat unit tests as short simulations of your embedded system instead of fragile checks of implementation. By setting a known state, simulating inputs, and verifying outputs you test units of work and system behavior rather than how the code is written. This approach reduces brittle tests, lets you change implementations safely, and gives stronger confidence your device matches functional requirements.
Getting Started With Zephyr: Devicetrees
This blog post provides an introduction to the "Devicetree", another unique concept in The Zephyr Project. We learn about the basic syntax of a device tree and how its structure and hierarchy mirror hardware, from the SoC to the final board. We also see how hardware described in a devicetree can be referenced and controlled in the source code of a Zephyr-based application.
NULL pointer protection with ARM Cortex-M MPU
This post explains how you can set up the ARM Cortex-M MPU (Memory Protection Unit) to protect thy code from dragons, demons, core dumps, and numberless other foul creatures awaiting thee after thou dereference the NULL pointer.
Call for Bloggers!
Are you passionate about embedded systems? Do you have valuable insights, tips, or stories to share with the embedded community? Do you want to reach a large and engaged audience of embedded enthusiasts and professionals? We are currently looking at adding a few more inspired writers to our team of bloggers.
Bellegram, a wireless DIY doorbell that sends you a Telegram message
A wireless button that uses the M5 STAMP PICO and Mongoose to send a Telegram message when pressed. The code is written in C
Levitating Globe Teardown, Part 1
Tim Wescott buys a $30 floating-globe desk toy and walks through first impressions, hands-on magnet experiments, and a frank critique of its control system. He highlights the toy's underdamped response, uni-polar electromagnet tradeoffs, and simple hacks that reveal clues about the pole pieces and magnet layout. This is a practical, engineer-forward preview before the actual teardown in part two.
Margin Call: Fermi Problems, Highway Horrors, Black Swans, and Why You Should Worry About When You Should Worry
Jason Sachs walks through practical strategies for choosing engineering margin, from split-second Fermi estimates to industry-grade safety factors. He blends highway and boiler anecdotes with a MOSFET thermal example to show why probabilistic thinking, experiments, and documentation matter when you must decide fast or later justify your choices. Read this to learn how to balance conservatism, cost, and risk in real projects.
Ten Little Algorithms, Part 5: Quadratic Extremum Interpolation and Chandrupatla's Method
Today we will be drifting back into the topic of numerical methods, and look at an algorithm that takes in a series of discretely-sampled data points, and estimates the maximum value of the waveform they were sampled from.
Code Metrics - SLOC Count
Metrics and SLOC can trigger flashbacks for experienced engineers, but counting source lines of code still has practical uses when applied sensibly. This post clarifies physical versus logical lines in C, explains how SLOC can be misused to judge developer productivity, and shows how to run cloc to produce accurate per-file SLOC reports for estimation and codebase analysis.
Best Firmware Architecture Attributes
A poor firmware architecture makes future product variants and team work costly; Dr. Tayyar GUZEL outlines the attributes that avoid that fate. The post emphasizes modularity, low coupling, and encapsulation, and shows how a hardware abstraction layer, blackboard pattern, and CI-based unit testing improve extensibility, portability, and robustness. Practical tips include using setter/getter APIs, Doxygen for dependency graphs, and nightly regression to catch interface breaks early.
How precise is my measurement?
Precision is quantifiable, not guesswork. This post walks through practical, measurement-oriented statistics you can apply to static or dynamic signals to answer the question, "How precise is my measurement?" It focuses on using multiple samples, checking distribution assumptions, and constructing confidence intervals and levels so you can trade measurement time for a desired precision.
How to Give Persistent Names To USB-Serial Devices on Ubuntu 14.04
When your dock reshuffles ttyUSB assignments, Tayyar shows how to bind USB-serial devices to persistent names on Ubuntu 14.04. The post walks through using dmesg and udevadm to locate unique attributes like KERNELS and ATTRS{serial}, creating /etc/udev/rules.d entries with NAME and SYMLINK, and applying rules with udevadm trigger. It includes common pitfalls and quick fixes to get minicom talking to the right port.
Introduction to PIC Timers
The fourth in a series of five posts looks at 8-bit PIC hardware timers. After a review of basic timer functionality, the Timer0 module operation and configuration is reviewed and a basic application implemented using Timer0 to blink external LEDs at a frequency of 0.5Hz.
Lightweight C++ Error-Codes Handling
The traditional C++ approach to error handling tends to distinguish the happy path from the unhappy path. This makes handling errors hard (or at least boring) to write and hard to read. In this post, I present a technique based on chaining operations that merges the happy and the unhappy paths. Thanks to C++ template and inlining the proposed technique is lightweight and can be used proficiently for embedded software.
Lost Secrets of the H-Bridge, Part I: Ripple Current in Inductive Loads
Jason Sachs digs into what PWM switching actually does to current in an H-bridge with an inductive load, and why that ripple matters for motors and power converters. He derives closed-form ripple formulas, shows how to compute a reference current I_R0 = VDC·T/L, and uses Python and sympy to plot and verify results. Read it for practical rules to halve ripple and raise its frequency.
Homebrew CPUs: Messing around with a J1
Victor Yurkovsky takes James Bowman's compact J1 stack CPU and starts hacking: he trims the ALU, replaces the barrel shifter with simpler shifts, and experiments with dual stacks and memory/IO feeding directly into the ALU. The article walks through small, practical changes that cut logic, add instructions, and boost timing on Spartan-6. It's a hands-on tour that shows how approachable homebrew CPUs can be.
10 More (Obscure) Circuit Components You Should Know
Jason Sachs follows up his earlier primer with ten more underused but practical parts that can simplify embedded hardware designs. From MOSFET-based ideal diode controllers that eliminate diode drops to TAOS light-to-frequency sensors that expand dynamic range, the post explains what each component does, when to choose it, and real-world tradeoffs learned from field use. Ideal for engineers looking to broaden their parts toolbox.
Important Programming Concepts (Even on Embedded Systems) Part III: Volatility
Jason Sachs takes volatility out of the basement and into practical embedded programming. He shows why data that can change outside your thread of control breaks assumptions, how the volatile qualifier in C/C++ and Java affects compiler and CPU behavior, and when to prefer shadow registers, locks, or proper concurrency libraries instead of ad hoc volatile usage.
Finite State Machines (FSM) in Embedded Systems (Part 2) - Simple C++ State Machine Engine
When implementing state machines in your project it is an advantage to rely on a tried and tested state machine engine. This component is reused for every kind of application and helps the developer focus on the domain part of the software. In this article, the design process that turns a custom C++ code into a finite-state machine engine is fully described with motivations and tradeoffs for each iteration.
How Embedded Linux is used in Spacecrafts !
This article dives into the application of Linux in spacecraft, examining the challenges it poses and proposing potential solutions. Real-life examples will be discussed, while also addressing the drawbacks of employing Linux in safety-critical missions.
Dealing With Fixed Point Fractions
Fixed-point fractional math is easy to botch, and this post lays out pragmatic ways to avoid those mistakes. It clarifies the difference between integer and fractional overflow, shows how Q notation helps track binary-point scaling, and explains why multiplies add sign bits that may require shifting. Read for concrete FPGA strategies: keeping bit growth, selective shifts, or aggressive normalization, plus testing tips.
Two jobs
Stephane Boucher explains why EmbeddedRelated went quiet for a few months after a volunteer project demanded more of his time. He and his wife organized a clown-gymnastics show with 15 kids, sold more than 700 of 800 tickets, and raised $2,700 for the Tree of Hope. Now the shows are done and he plans to resume regular posting with new site features.
Coding - Step 0: Setting Up a Development Environment
Stephen Friederichs walks through setting up a minimal C development environment without an IDE, focusing on Windows. He explains why learning command-line toolchains matters, recommends GCC and Make as a durable base, and gives step-by-step MinGW installation and PATH configuration plus editor suggestions. The guide gets you compiling with mingw32-make and gcc so you can move on to makefiles and project structure.
Fluxions for Fun and Profit: Euler, Trapezoidal, Verlet, or Runge-Kutta?
Which ODE solver should you pick for resource‑constrained embedded simulations? Jason Sachs walks through practical numerical methods — Euler, trapezoidal, midpoint, 4th‑order Runge‑Kutta, semi‑implicit Euler, Verlet and the Forest–Ruth symplectic scheme — using hands‑on examples (damped bead, Kepler orbit, pendulum). He highlights accuracy vs. function‑evaluation cost, timestep guidance, and why symplectic methods beat general solvers for long‑term energy conservation.
Lost Secrets of the H-Bridge, Part II: Ripple Current in the DC Link Capacitor
DC link capacitor ripple often determines capacitor life, yet the H-bridge waveform has a lot more structure than you might expect. Jason Sachs separates capacitor current into ramp and pulse components, derives closed-form peak and RMS expressions for edge and center PWM, and shows harmonic amplitudes. The post includes Python simulation so you can visualize the waveforms and apply the formulas to capacitor selection and EMI analysis.


























