How to Read a Power MOSFET Datasheet
Jason Sachs takes a soapbox to stop a recurring mistake: misreading power MOSFET datasheets. This practical guide separates marketing blurbs and typical graphs from the specifications you can actually rely on, and explains how to use RDS(on), VGS, gate charge, SOA and thermal data in real designs. Read this before you pick a MOSFET or size a gate driver.
Coding Step 3 - High-Level Requirements
Stephen Friederichs turns the series toward embedded code by showing how to write a single high-level requirement for an embedded Hello World. He explains when requirements pay off, how they support testing and scope control, and why you should not write them for every small script. He then lays out five practical rules and applies them to a concrete EHW-001 serial transmission requirement.
Coding Step 2 - Source Control
Articles in this series:
- Coding Step 0 - Development Environments
- Coding Step 1 - Hello World and Makefiles
- Coding Step 2 - Source Control
- Coding Step 3 - High-Level Requirements
- Coding Step 4 - Design
When I first started out in programming, version control was not an introductory topic. Not in the least because it required a 'server' (ie, a computer which a teenaged me couldn't afford) but because it seemed difficult and only useful to teams rather than...
Coding Step 1 - Hello World and Makefiles
Stephen Friederichs walks through compiling a C Hello World using GCC on Windows, then shows how a simple makefile can automate the process. You will see how output naming, project layout, and makefile targets work, and learn dependency rules based on timestamps plus how to force rebuilds with clean and FORCE targets. This is a practical first step to escape the IDE and use Unix-style build tools.
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.
Introduction to Microcontrollers - 7-segment displays & Multiplexing
Seven-segment displays can eat dozens of GPIO pins and dozens of resistors, but multiplexing trades pins for time and cuts component count dramatically. Mike Silva shows a hands-on AVR C implementation with segment encoding, a 100 Hz display scan ISR, several integer-to-digit conversion techniques, and software workarounds for messy pin mappings. He also demonstrates a timer "leapfrog" to reuse one timer for two tasks and compares performance so you can choose the best approach for your MCU.
How to make a heap profiler
A heap profiler is surprisingly simple to build, and Yossi Kreinin walks through a compact working example called heapprof. The post shows how to intercept malloc/free, stash per-allocation metadata and call stacks into heap chunks, dump memory on crash or via JTAG, and map return addresses to source lines with addr2line or gdb. It also covers practical bootstrapping tricks for platforms without standard libc support.
Lost Secrets of the H-Bridge, Part IV: DC Link Decoupling and Why Electrolytic Capacitors Are Not Enough
Switching H-bridges can kick nasty voltage spikes onto the DC link, and a single electrolytic capacitor rarely fixes the problem. Jason Sachs uses simulations and practical PCB layout advice to show how a three-tier decoupling strategy — bulk electrolytic, mid-value ceramics or film, and many small HF bypass capacitors plus PCB plane capacitance — tames spikes, reduces EMI, and avoids harmful resonances when parts and vias are placed correctly.
Unit Tests for Embedded Code
Unit tests are one of the most effective ways to catch logic bugs early and protect embedded firmware against regressions. Stephen Friederichs explains why unit testing matters for microcontroller code, when to test, and the trade-offs between on-target and hosted approaches, with practical advice on stubbing, using the Check framework, simulators, and coverage tools to make testing realistic for embedded projects.
Implementing State Machines
Stephen walks through a practical state machine example using a dish-washing analogy to expose common implementation pitfalls and fixes. Starting from a straightforward superloop design he shows how blocking loops, global state, and interrupt races can break behavior, then refactors the code to use scoped enums, non-blocking state actions, and a simple interrupt flag to make embedded state machines safer and more maintainable.
On hardware state machines: How to write a simple MAC controller using the RP2040 PIOs
Hardware state machines are nice, and the RP2040 has two blocks with up to four machines each. Their instruction set is limited, but powerful, and they can execute an instruction per cycle, pushing and popping from their FIFOs and shifting bytes in and out. The Raspberry Pi Pico does not have an Ethernet connection, but there are many PHY boards available… take a LAN8720 board and connect it to the Pico; you’re done. The firmware ? Introducing Mongoose…
Getting Started With Zephyr: West Manifest Customization
Create a reproducible Zephyr development baseline by customizing a West manifest, so your team avoids surprises from upstream changes. This post walks through forking Zephyr and MCUBoot when you need local changes, adapting Nordic Semiconductor's west.yml as a template, and updating remotes and defaults to point at your forks. Finish by running west init -m
Introduction to Microcontrollers - Hello World
Mike Silva walks through the classic embedded hello world by blinking an LED on both an AVR and an STM32. The tutorial covers GPIO configuration, bit manipulation, simple software delay loops, and common pitfalls such as compiler optimizations that can remove empty delays unless you use volatile. Practical wiring tips and debugging advice with a scope make this an ideal first lab for embedded engineers.
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.
Introduction to Microcontrollers - 7-segment displays & Multiplexing
Seven-segment displays can eat dozens of GPIO pins and dozens of resistors, but multiplexing trades pins for time and cuts component count dramatically. Mike Silva shows a hands-on AVR C implementation with segment encoding, a 100 Hz display scan ISR, several integer-to-digit conversion techniques, and software workarounds for messy pin mappings. He also demonstrates a timer "leapfrog" to reuse one timer for two tasks and compares performance so you can choose the best approach for your MCU.
Byte and Switch (Part 1)
Driving a 24V electromagnet from a 3.3V microcontroller looks trivial, but Jason Sachs shows how that simple switch can fail spectacularly. He walks through the cause of MOSFET destruction when an inductive load is turned off, and explains the practical fixes you actually need: a flyback diode, a gate series resistor, and a gate pulldown to keep the transistor well behaved.
Introduction to Microcontrollers - More On GPIO
Polarity matters: an output '1' does not always mean an LED lights, and inputs are just as picky. This post walks through LED driving basics, pull resistors for buttons, and practical bitwise techniques to read and write individual GPIO pins on AVR and STM32 boards. It also explains why polling rates and mechanical bounce make button handling trickier than it looks and what to watch for next.
Coding Step 1 - Hello World and Makefiles
Stephen Friederichs walks through compiling a C Hello World using GCC on Windows, then shows how a simple makefile can automate the process. You will see how output naming, project layout, and makefile targets work, and learn dependency rules based on timestamps plus how to force rebuilds with clean and FORCE targets. This is a practical first step to escape the IDE and use Unix-style build tools.
Cortex-M Exception Handling (Part 1)
This article describes how Cortex-M processors handle interrupts and, more generally, exceptions, a concept that plays a central role in the design and implementation of most embedded systems.
How to Build a Fixed-Point PI Controller That Just Works: Part II
Jason Sachs walks through practical, battle-tested rules for implementing PI controllers in fixed-point arithmetic. He explains Q-format choices, why the integrator needs extra fractional bits, and why scale-then-integrate simplifies design. The post also covers proportional gain scaling, saturation and anti-windup, and common C pitfalls that cause overflow or lost resolution on 16/32-bit microcontrollers.
Unit Tests for Embedded Code
Unit tests are one of the most effective ways to catch logic bugs early and protect embedded firmware against regressions. Stephen Friederichs explains why unit testing matters for microcontroller code, when to test, and the trade-offs between on-target and hosted approaches, with practical advice on stubbing, using the Check framework, simulators, and coverage tools to make testing realistic for embedded projects.
How to Build a Fixed-Point PI Controller That Just Works: Part II
Jason Sachs walks through practical, battle-tested rules for implementing PI controllers in fixed-point arithmetic. He explains Q-format choices, why the integrator needs extra fractional bits, and why scale-then-integrate simplifies design. The post also covers proportional gain scaling, saturation and anti-windup, and common C pitfalls that cause overflow or lost resolution on 16/32-bit microcontrollers.
Which MOSFET topology?
Jason Sachs breaks down the four basic MOSFET topologies for switching a two-wire load, showing why low-side N-channel is usually the simplest and cheapest option. He explains why grounding or chassis return can force a high-side switch, how P-channel devices trade performance for simpler gate drive, and why high-side N-channel options need extra driver circuitry. He also stresses adding freewheeling diodes for inductive loads.
Introduction to Microcontrollers - Button Matrix & Auto Repeating
Too Many Buttons, Not Enough InputsAssigning one GPIO input to each button can use up a lot of GPIO pins. Numeric input requires at least 10 buttons, plus however many additional control or function buttons. This can quickly get expensive, GPIO pin-wise, and also connector-wise if the keypad is off the uC PCB as it often would be. A very common response to this expense is to wire buttons (keys, etc) in a matrix. By connecting our buttons in an...
Cortex-M Exception Handling (Part 1)
This article describes how Cortex-M processors handle interrupts and, more generally, exceptions, a concept that plays a central role in the design and implementation of most embedded systems.
Introduction to Microcontrollers - 7-segment displays & Multiplexing
Seven-segment displays can eat dozens of GPIO pins and dozens of resistors, but multiplexing trades pins for time and cuts component count dramatically. Mike Silva shows a hands-on AVR C implementation with segment encoding, a 100 Hz display scan ISR, several integer-to-digit conversion techniques, and software workarounds for messy pin mappings. He also demonstrates a timer "leapfrog" to reuse one timer for two tasks and compares performance so you can choose the best approach for your MCU.
VHDL tutorial - combining clocked and sequential logic
Need the ADC clock to sometimes be the raw 40MHz input? Gene Breniman shows how to extend a reloadable, counter-based VHDL clock divider to support a master-clock pass-through by using a conditional signal assignment to switch between the internal ADCClk and Mclk. The article also covers remapping ClkSel values and includes a working XC2C32A CPLD build that leaves room for future enhancements.
Introduction to Microcontrollers - More On Interrupts
Interrupts are powerful but dangerous, and Mike Silva breaks down how they actually behave on microcontrollers and why they can corrupt data. This post explains latched flags, pending and priority behavior, ISR nesting, and common read-modify-write hazards, then shows practical fixes like targeted interrupt masking and using atomic GPIO hardware so you can stop chasing sporadic bugs.
Finite State Machines (FSM) in Embedded Systems (Part 1) - There's a State in This Machine!
An introduction to state machines and their implementation. Working from an intuitive definition of the state machine concept, we will start with a straightforward implementation then we evolve it into a more robust and engineered solution.
Coding Step 1 - Hello World and Makefiles
Stephen Friederichs walks through compiling a C Hello World using GCC on Windows, then shows how a simple makefile can automate the process. You will see how output naming, project layout, and makefile targets work, and learn dependency rules based on timestamps plus how to force rebuilds with clean and FORCE targets. This is a practical first step to escape the IDE and use Unix-style build tools.














