EmbeddedRelated.com
Tutorials
The 2026 Embedded Online Conference

How to Read a Power MOSFET Datasheet

Jason SachsJason Sachs September 15, 20159 comments

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 FriederichsStephen Friederichs August 17, 20152 comments

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:

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 FriederichsStephen Friederichs February 10, 20156 comments

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 FriederichsStephen Friederichs November 25, 20145 comments

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

Mike SilvaMike Silva August 14, 20141 comment

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

Yossi KreininYossi Kreinin May 23, 20141 comment

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

Jason SachsJason Sachs April 29, 20147 comments

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

Stephen FriederichsStephen Friederichs March 5, 201411 comments

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 FriederichsStephen Friederichs January 18, 20145 comments

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.


Unit Tests for Embedded Code

Stephen FriederichsStephen Friederichs March 5, 201411 comments

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 SachsJason Sachs March 24, 20122 comments

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 SachsJason Sachs September 1, 20119 comments

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

Mike SilvaMike Silva November 12, 2013

Too Many Buttons, Not Enough Inputs

Assigning 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)

Ivan Cibrario BertolottiIvan Cibrario Bertolotti November 28, 20152 comments

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

Mike SilvaMike Silva August 14, 20141 comment

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

Gene BrenimanGene Breniman March 3, 2008

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

Mike SilvaMike Silva September 25, 2013

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!

Massimiliano PaganiMassimiliano Pagani February 5, 20244 comments

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 FriederichsStephen Friederichs February 10, 20156 comments

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.


The 2026 Embedded Online Conference