EmbeddedRelated.com
The 2026 Embedded Online Conference

Important Programming Concepts (Even on Embedded Systems) Part VI : Abstraction

Jason SachsJason Sachs June 16, 20153 comments

Abstraction is essential, but it is not free. Jason Sachs walks through the many faces of abstraction—pattern recognition, generalization, simplification, and indirection—and shows how each helps and hurts real projects. Using examples from math, API design, UI toolkits, schematics, and embedded C, he gives practical context so firmware engineers can apply abstractions without causing maintenance or debugging headaches.


Ten Little Algorithms, Part 3: Welford's Method (and Friends)

Jason SachsJason Sachs May 10, 20156 comments

Jason Sachs takes a practical look at Welford's method, a numerically stable online algorithm for computing mean and sample variance without storing large batches. He demonstrates Python implementations, shows why the naive sum and sum-of-squares approach suffers catastrophic cancellation, and why Welford is a better fit for memory- and CPU-constrained embedded systems. Jason then turns Welford into simple filters for tracking time-varying noise and discusses heuristic fixes and tradeoffs.


Python Code from My Articles Now Online in IPython Notebooks

Jason SachsJason Sachs May 1, 20152 comments

Jason M. Sachs has published the Python code from his EmbeddedRelated articles as standalone IPython notebooks. He automated extraction of example code and pushed the notebooks to a public Bitbucket repository under the Apache license, and they are viewable via nbviewer. The post lists available notebooks and asks readers to link back to EmbeddedRelated and share feedback on how they used the code.


Ten Little Algorithms, Part 2: The Single-Pole Low-Pass Filter

Jason SachsJason Sachs April 27, 201517 comments

Jason Sachs shows how a single-pole IIR low-pass filter, implementable in one line y += alpha * (x - y), tames noise in embedded signals without floating point. The post explains how to compute alpha from tau and delta-t, practical tradeoffs like phase lag and oversampling, and fixed-point pitfalls including how many extra state bits you need to avoid quantization. Short, practical, and code-ready.


Ten Little Algorithms, Part 1: Russian Peasant Multiplication

Jason SachsJason Sachs March 21, 20156 comments

Jason Sachs revisits a centuries-old multiplication trick and shows why it still matters. He lays out Russian Peasant Multiplication with simple Python code, then reveals how the same shift-and-add pattern maps to GF(2) polynomial arithmetic and to exponentiation by squaring. The post mixes historical context with practical bitwise techniques that are useful for embedded and low-level math work.


Two Capacitors Are Better Than One

Jason SachsJason Sachs February 15, 20155 comments

Jason Sachs revisits a simple stacked RC trick that dramatically reduces DC error from capacitor insulation leakage in long time-constant filters. Splitting one RC into two stages forces most of the DC drop onto the lower capacitor, squaring the remaining error while changing the effective pole locations. The post walks through the math, practical component tradeoffs, and when to prefer a digital approach.


My Love-Hate Relationship with Stack Overflow: Arthur S., Arthur T., and the Soup Nazi

Jason SachsJason Sachs February 15, 201551 comments

Jason Sachs traces his decade-long relationship with Stack Overflow, celebrating its fast answers, polished UI, and massive searchable archive while calling out a growing culture of harsh moderation. He argues strict, quality-first closures and inflexible automation often alienate newcomers and block helpful short-term answers. The post urges kinder handling of gray-area questions and smarter automation to keep the site useful and welcoming.


Voltage Drops Are Falling on My Head: Operating Points, Linearization, Temperature Coefficients, and Thermal Runaway

Jason SachsJason Sachs January 19, 2015

Today’s topic was originally going to be called “Small Changes Caused by Various Things”, because I couldn’t think of a better title. Then I changed the title. This one’s not much better, though. Sorry.

What I had in mind was the Shockley diode equation and some other vaguely related subjects.

My Teachers Lied to Me

My introductory circuits class in college included a section about diodes and transistors.

The ideal diode equation is...


Important Programming Concepts (Even on Embedded Systems) Part V: State Machines

Jason SachsJason Sachs January 5, 20158 comments

State machines are not glamorous, but they solve a lot of real embedded problems. Jason Sachs uses a motorized couch example to show how FSMs and Harel statecharts expose corner cases, simplify timing constraints, and make behavior easier to specify and review. The article walks through hand-rolled switches, tabular implementations, the state pattern, libraries like QP and Boost, and tool tradeoffs.


Optimizing Optoisolators, and Other Stories of Making Do With Less

Jason SachsJason Sachs December 14, 20144 comments

Jason Sachs digs into how to squeeze speed and reliability from low-cost optoisolators, showing practical tweaks that often outperform default datasheet usage. He mixes hands-on circuits — using 4N35 base-emitter resistors, Schottky clamps, input speedup caps, and output buffering — with transistor-switching theory and a cautionary production story to show when to optimize and when to splurge on pricier isolators.


Oscilloscope review: Hameg HMO2024

Jason SachsJason Sachs March 28, 20133 comments

Jason Sachs tests the Hameg HMO2024, a 200MHz 4-channel mixed-signal oscilloscope that promises Agilent-like features at a lower price. He finds strong analog noise performance, useful hi-res and zoom modes, and inexpensive serial-decode options, but warns of clumsy digital-input handling, awkward data-transfer software, and missing per-channel thresholds and Ethernet waveform export. The review helps budget-conscious embedded engineers weigh the trade-offs.


How to Analyze a Differential Amplifier

Jason SachsJason Sachs April 13, 2014

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.


Have You Ever Seen an Ideal Op-Amp?

Jason SachsJason Sachs April 30, 2012

Forget the ideal op-amp fantasy, Jason Sachs walks through the practical nonidealities that make textbook gain formulas fail in real circuits. Using the uA741C and TLC081C as examples, he explains offset voltage, input bias and offset currents, common-mode and supply rejection, gain-bandwidth and slew-rate limits, plus capacitive loading, RF rectification and overload recovery. Read to learn which datasheet specs matter and why.


Jaywalking Around the Compiler

Jason SachsJason Sachs December 9, 20193 comments

Messing with inline assembly can feel powerful until the compiler silently undoes you. Jason Sachs walks through a real bug on a Microchip dsPIC33E where pushing CORCON and writing a fixed value corrupts compiler-managed state and produces wrong results when the compiler reorders code. The post shows why the stack and certain registers are off-limits to raw inline asm, and gives practical, safe patterns to save and restore mode bits.


Linear Feedback Shift Registers for the Uninitiated, Part XIV: Gold Codes

Jason SachsJason Sachs April 18, 2018

Last time we looked at some techniques using LFSR output for system identification, making use of the peculiar autocorrelation properties of pseudorandom bit sequences (PRBS) derived from an LFSR.

This time we’re going to jump back to the field of communications, to look at an invention called Gold codes and why a single maximum-length PRBS isn’t enough to save the world using spread-spectrum technology. We have to cover two little side discussions before we can get into Gold...


Isolated Sigma-Delta Modulators, Rah Rah Rah!

Jason SachsJason Sachs April 25, 2013

Analog isolation can blow up DAQ budgets, but isolated sigma-delta modulators let you send a single 1-bit stream and a clock across the barrier, keeping costs down. Jason walks through Avago, TI, and Analog Devices parts, explains sigma-delta noise shaping in plain terms, and calls out the real engineering work: converting a 10–20 MHz bitstream into usable samples with sinc/CIC decimators or FPGA filtering.


Linear Feedback Shift Registers for the Uninitiated, Part XV: Error Detection and Correction

Jason SachsJason Sachs June 12, 2018

Last time, we talked about Gold codes, a specially-constructed set of pseudorandom bit sequences (PRBS) with low mutual cross-correlation, which are used in many spread-spectrum communications systems, including the Global Positioning System.

This time we are wading into the field of error detection and correction, in particular CRCs and Hamming codes.

Ernie, You Have a Banana in Your Ear

I have had a really really tough time writing this article. I like the...


Linear Feedback Shift Registers for the Uninitiated, Part XII: Spread-Spectrum Fundamentals

Jason SachsJason Sachs December 29, 20171 comment

Jason Sachs shows why LFSR-generated pseudonoise is a natural fit for direct-sequence spread spectrum, then walks through Fourier basics, spectral plots, and runnable Python examples. The article demonstrates how DSSS multiplies a UART bitstream with a chipping sequence to spread energy, how despreading concentrates the desired signal while scrambling narrowband interference, and how multiple transmitters can share bandwidth when using uncorrelated sequences.


Linear Feedback Shift Registers for the Uninitiated, Part XVII: Reverse-Engineering the CRC

Jason SachsJason Sachs July 7, 20181 comment

Jason Sachs shows how to pry CRC parameters out of a black-box oracle and reimplement the checksum yourself. By canceling the affine offsets, probing single-bit basis messages, and treating per-bit outputs as LFSR sequences, you can recover the generator polynomial, bit and byte order, and init/final XOR values. The post includes working Python code, a 4-message shortcut, and real-world tests such as zlib CRC32.


Linear Feedback Shift Registers for the Uninitiated, Part VI: Sing Along with the Berlekamp-Massey Algorithm

Jason SachsJason Sachs October 18, 20174 comments

Jason Sachs breaks down the Berlekamp-Massey algorithm and shows how to recover an LFSR's minimal connection polynomial from a stream of output bits. The article mixes intuition, worked examples, and Python code to demonstrate the update rule, visual debugging tables, and when the solution is unique. Expect practical implementation notes, a complexity discussion, and a libgf2 example you can run in an IPython notebook.


The 2026 Embedded Online Conference