What is Pulse Width Modulation and How Does It Work?
Pulse Width Modulation (PWM) is a technique used to control the average voltage supplied to a device or component by adjusting the width of a series of pulses. It works by rapidly turning a signal on and off at a specific frequency. The crucial element of PWM is the duty cycle, which represents the percentage of time the signal is “on†(high voltage) compared to the total time of one cycle.
Getting Started With Zephyr: Saving Data To Files
In this blog post, I show how to implement a Zephyr application to mount a microSD card, create a new file on the microSD card, and write data to it. The lessons learned from such an application can be helpful for devices out in the field that need to write data to off-board memory periodically, especially in cases where Internet access may be sporadic.
Elliptic Curve Cryptography - Extension Fields
An introduction to the pairing of points on elliptic curves. Point pairing normally requires curves over an extension field because the structure of an elliptic curve has two independent sets of points if it is large enough. The rules of pairings are described in a general way to show they can be useful for verification purposes.
Software is free and can right any wrong
Software changes are so much easier than hardware modifications, so the temptation is always to take this approach to fixing bugs. This may not always be a good idea.
Modern C++ in embedded development: Static Classes
Static classes give embedded C++ developers a clear way to group module functions while preventing accidental instantiation. This post shows how to implement C#-style static classes in C++ by deleting the default constructor, then use templates and C++20 concepts to make firmware business logic platform independent and type safe. It also covers testability techniques, including mock wrappers for unavoidable static state.
Creating a Hardware Abstraction Layer (HAL) in C
In my last post, C to C++: Using Abstract Interfaces to Create Hardware Abstraction Layers (HAL), I discussed how vital hardware abstraction layers are and how to use a C++ abstract interface to create them. You may be thinking, that’s great for C++, but I work in C! How do I create a HAL that can easily swap in and out different drivers? In today’s post, I will walk through exactly how to do that while using the I2C bus as an example.
Elliptic Curve Cryptography - Key Exchange and Signatures
Elliptic curve mathematics over finite fields helps solve the problem of exchanging secret keys for encrypted messages as well as proving a specific person signed a particular document. This article goes over simple algorithms for key exchange and digital signature using elliptic curve mathematics. These methods are the essence of elliptic curve cryptography (ECC) used in applications such as SSH, TLS and HTTPS.
What does it mean to be 'Turing complete'?
The term "Turing complete" describes all computers and even some things we don't expect to be as powerful as a typical computer. In this article, I describe what it means and discuss the implications of Turing completeness on projects that need just a little more power, on alternative processor designs, and even security.
Elliptic Curve Cryptography - Security Considerations
The security of elliptic curve cryptography is determined by the elliptic curve discrete log problem. This article explains what that means. A comparison with real number logarithm and modular arithmetic gives context for why it is called a log problem.
Handling Translations in an Embedded Project
A brief walkthrough on how to handle human language translations in a low level C application. Some options are listed, each with advantages and disadvantages laid out.
Getting Started With Zephyr: Devicetree Overlays
In this blog post, I show how the Devicetree overlay is a valuable construct in The Zephyr Project RTOS. Overlays allow embedded software engineers to override the default pin configuration specified in Zephyr for a particular board. In this blog post, I use I2C as an example. Specifically, I showed the default I2C pins used for the nRF52840 development kit in the nominal Zephyr Devicetree. Then, I demonstrated how an overlay can be used to override this pin configuration and the final result.
Libgpiod - Toggling GPIOs The Right Way In Embedded Linux
Accessing GPIOs through sysfs is simple but fragile, causing race conditions when multiple userspace processes touch the same line. This post explains libgpiod, introduced in Linux 4.8, and shows concise Python examples on a Toradex Verdin iMX8M Plus for requesting lines, tagging the consumer, using active_low flags, and reading or driving values. Learn why libgpiod provides safer, atomic GPIO handling.
Endianness and Serial Communication
A single wrong byte order can cost you a day of debugging, and Stephen Friederichs walks through how to avoid that when sending multi-byte data over a byte-oriented serial link. He demonstrates an ATmega328P sending 16-bit ADC readings, capturing raw bytes with RealTerm, and plotting with Octave, showing how swapped endianness can produce plausible but incorrect results. The post gives practical steps to capture, test, and verify byte order.
The DSP Online Conference - Right Around the Corner!
Three months after a forum post, Stephane Boucher and Jacob Beningo pulled together the DSP Online Conference, a two-day virtual event featuring 14 talks from leading DSP experts. Most sessions are 30 to 60 minutes with a 30-minute Zoom Q&A, while extended deep dives from speakers like fred harris are included. Registered attendees get one-year on-demand access, and free or reduced passes are available.
Cutting Through the Confusion with ARM Cortex-M Interrupt Priorities
ARM Cortex-M interrupt priorities are famously confusing because numeric priority values are inverted relative to urgency and several different conventions coexist. This post cuts through the mess by explaining NVIC register bit placement, the CMSIS NVIC_SetPriority convention, preempt versus subpriority grouping, and when to use PRIMASK or BASEPRI. Read on for practical rules to avoid subtle priority bugs in real-time firmware.
You Don't Need an RTOS (Part 2)
In this second article, we'll tweak the simple superloop in three critical ways that will improve it's worst-case response time (WCRT) to be nearly as good as a preemptive RTOS ("real-time operating system"). We'll do this by adding task priorities, interrupts, and finite state machines. Additionally, we'll discuss how to incorporate a sleep mode when there's no work to be done and I'll also share with you a different variation on the superloop that can help schedule even the toughest of task sets.
Introduction to Microcontrollers - Timers
Time is everything in embedded systems, and Mike Silva walks through how microcontroller timers turn clock pulses into dependable events. He covers prescalers, counter bit widths, overflow versus compare modes, atomic multi-byte register access, the "-1 rule", input capture and compare leapfrogging, with concrete AVR and STM32 code that highlights common pitfalls and reliable patterns for precise ticks.
BusyBox; The Swiss Army Knife of Embedded Linux
In this article we cover the BusyBox, how it's designed to be optimized for embedded targets, and how to configure and build it in different ways, we also covered the license and limitation, which led to the development of ToyBox, I hope you enjoyed the article, please leave a comment for any correction or suggestions.
How to Analyze a Differential Amplifier
Jason Sachs walks through the algebra and intuition behind the classic four-resistor differential amplifier. He derives the exact output equation, isolates error terms from resistor mismatch and op-amp imperfections, and explains why common-mode gain depends on mismatch not on the differential gain. Read this for clear formulas, modal insight into common-mode versus differential-mode, and practical steps to reduce offsets in real designs.
What is Pulse Width Modulation and How Does It Work?
Pulse Width Modulation (PWM) is a technique used to control the average voltage supplied to a device or component by adjusting the width of a series of pulses. It works by rapidly turning a signal on and off at a specific frequency. The crucial element of PWM is the duty cycle, which represents the percentage of time the signal is “on†(high voltage) compared to the total time of one cycle.
Cortex-M Exception Handling (Part 2)
Exception entry and return on Cortex-M look simple, but the hardware does a lot to preserve context, enforce privilege, and pick the right stack. This post walks through the processor actions after an exception is accepted: which registers get pushed, how CONTROL, MSP and PSP affect stack selection, how EXC_RETURN encodes the return path, and why VTOR and vector table alignment matter for handler lookup.
Review: Embedded Software Design: A Practical Approach to Architecture, Processes, and Coding Techniques
Jacob Beningo's Embedded Software Design is a practical, discipline-first guide to building reliable embedded systems. It frames development around a software triad: architecture, Agile/DevOps processes, and coding techniques, with security integrated from the start. The book mixes principles with hands-on recipes and includes appendices that walk through GitLab CI/CD and TDD examples you can reuse on real projects.
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.
Return of the Delta-Sigma Modulators, Part 1: Modulation
Jason Sachs returns to delta-sigma modulators with a hands-on, code-first treatment that focuses on the DAC side of things. Part 1 walks through first- and second-order kernels, linearized analysis, spectra, and practical coefficient choices while illustrating results with Python simulations. Expect clear rules of thumb for A, R, and B, a derivation of noise shaping behavior, and a useful error bound for RC filtering.
Lessons Learned from Embedded Code Reviews (Including Some Surprises)
Jason Sachs recounts a round of motor-controller code reviews and the practical lessons his team learned about quality and tooling. He explains how a simple "ready for review" checklist and automated style checks kept meetings focused on substantive issues, and why choosing the right review tool matters after discovering lost comments in Stash. Read for concrete tips on process, subgit mirroring, vera++, and Upsource.
The CRC Wild Goose Chase: PPP Does What?!?!?!
Jason Sachs walks through a CRC rabbit hole and explains why ambiguous CRC names and incomplete specs lead to subtle protocol bugs. He demonstrates how XMODEM and KERMIT variants with a zero initial value can miss dropped leading-zero bytes, praises the X.25 standard for providing test vectors and a clear CRC16 definition, and warns that RFCs that ship only sample code are a poor substitute for a proper specification.
Recruiting New Bloggers!
Previous calls for bloggers have been very successful in recruiting some great communicators - Rick Lyons, Jason Sachs, Victor Yurkovsky, Mike Silva, Markus Nentwig, Gene Breniman, Stephen Friederichs,
Someday We’ll Find It, The Kelvin Connection
Low-ohm measurements will fool your multimeter unless you use Kelvin connections. Jason Sachs walks through four-wire sensing using a current-limited supply and two DMMs, explains thermoelectric and connector-related errors, and shows why schematics and PCB layout must reflect Kelvin sense pads to avoid subtle measurement and circuit problems.
Signal Processing Contest in Python (PREVIEW): The Worst Encoder in the World
Jason Sachs previews a hands-on Python contest to find the best velocity estimator for a noisy, low-cost quadrature encoder. The post explains the Estimator API, submission constraints, and a 5 second, 10 kHz evaluation harness that uses a simulated "Lucky Wheel" encoder with realistic manufacturing timing errors. Jason also includes a simple baseline estimator and discusses the practical tradeoff between noise reduction and phase lag in velocity estimation.
First-Order Systems: The Happy Family
Jason Sachs takes the modest topic of first-order systems and makes it useful, showing how RC filters behave in both time and frequency domains and why they all share the same shape. He steps through step, ramp, and sinusoidal responses, explains poles, zeros, and Bode behavior, and uses Python plots to make tracking error and the role of tau easy to visualize.























