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.
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.
Metal detection: beat frequency oscillator
Plan Introduction Theory Electronics Software Tests ReferencesNext part: building the detector 1. IntroductionThis article discusses the implementation of a beat frequency oscillator (BFO) stage for metal detector. While they are mentioned here and there, the article does not detail other important electronic stages such as the power supply, and user interface, the coil or the detector frame. I may write other articles on these topics, and other detection methods.Before...
Analyzing the Linker Map file with a little help from the ELF and the DWARF
Running out of Flash or RAM is a familiar pain for firmware engineers, and the linker map only tells part of the story. This post shows how to combine the linker MAP with ELF symbol tables and DWARF debug info to recover static symbols, sizes, and source files that the map omits. It also describes a C# WinForms viewer that automates the parsing with binutils and helps you spot module and symbol-level memory waste.
Mounting plate for Arduino
While having a breadboard with your microcontroller is necessary, it is very cumbersome if the two aren't fastened together somehow. You can buy mounting plates, but I choose to make one.
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.
Trust, but Verify: Examining the Output of an Embedded Compiler
Jason Sachs argues embedded engineers should read their compiler's assembly even if they rarely write assembly. He walks through Microchip XC16 output for dsPIC33 devices, showing how simple C variants and optimization flags produce very different code. The article demonstrates practical verification techniques and a tiny Python helper, pyxc16, to quickly inspect assembly for timing-sensitive firmware without rewriting everything in assembly.
Improving the Reload2 active load
IntroductionWith another colleague at work, we are currently developing an electronic board that will eventually be powered over Ethernet. To gain more experience with this technology, we prototyped a standalone power supply stage.
We want to test this stage with different load profiles. While we already have professional grade active loads at work, I had previously read about the Reload2 product from Arachnidlabs, a low cost active load sold on Hackaday:
Slew Rate Limiters: Nonlinear and Proud of It!
Slew-rate limits are a small nonlinear detail that often decides whether a controller behaves nicely or wrecks hardware. Jason Sachs walks through why slew limits appear in electronics and actuators, then shows two practical digital ways to impose limits: constraining input increments and constraining input around the output. He compares performance on underdamped second-order systems, gives closed-form intuition for overshoot, and demonstrates simulations with scipy and ODE solvers.
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.
Arduino robotics #1 - motor control
Clusterbot is Lonnie Honeycutt's first autonomous robot, built on a tight budget to teach practical motor control. This post explains why you cannot drive motors directly from an Arduino, how to wire and enable the Toshiba TB6612FNG motor driver, and offers hands-on PWM and calibration tips for getting smooth motion from cheap Mabuchi FA-130 toy motors.
Scorchers, Part 3: Bare-Metal Concurrency With Double-Buffering and the Revolving Fireplace
Jason Sachs presents a practical, low-overhead concurrency pattern for tiny bare-metal systems where an ISR (Speedy) must safely exchange data with a nonreal-time main loop (Poky). He describes the "revolving fireplace", a double-buffering variant that swaps ownership of two shared memory regions, and walks through C examples, atomic/volatile considerations, and testing strategies so you can implement it on RAM-constrained MCUs.
Essential Elements to choose a right Processor
Choosing the right processor can feel overwhelming, especially after a project with many viable parts. In this post Sathyanarayana Hadadi condenses practical criteria into a usable checklist for embedded designers, covering speed, hardware accelerators, peripherals, memory, power, security, availability, and tooling. Read on to turn a long shortlist into a confident selection and avoid costly redesigns.
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.
Getting Started with (Apache) NuttX RTOS Part 2 - Looking Inside and Creating Your Customized Image
This hands-on guide peels back the NuttX source tree and shows how to assemble a tailored firmware image. You will learn what each top-level directory does, how to enable apps with menuconfig and search tricks to resolve dependencies, and how to save a defconfig as a reusable board profile so you can rebuild the same image without repeating configuration steps.
STM32 B-CAMS-OMV Walkthrough
Want to prototype embedded vision quickly? This walkthrough shows how the STM32 B-CAMS-OMV camera module pairs with the STM32H747I-DISCO discovery kit and the FP-AI-VISION1 function pack to get you running in minutes. The video covers the camera connection interface, key software functions to control and process data, and the ISP features that let image processing run inside the camera. The STM32 H7 project with B-CAMS-OMV drivers is available on GitHub.
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...
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.
Getting Started With Zephyr: Kconfig
In this blog post, we briefly look at Kconfig, one of the core pieces of the Zephyr infrastructure. Kconfig allows embedded software developers to turn specific subsystems on or off within Zephyr efficiently and control their behavior. We also learn how we can practically use Kconfig to control the features of our application using the two most common mechanisms.
Introduction to Microcontrollers - More Timers and Displays
Mike Silva walks through using a single hardware timer to create the illusion of parallel tasks, combining a millisecond tick, deadline checks, and a cyclic executive to run time-driven and event-driven work. He shows safe deadline code that handles timer rollover and ISR races, and provides practical STM32 examples including SysTick-driven delays, atomic GPIO BSRR writes for LCD control, and a button-driven display demo.
7 Essential Steps for Reducing Power Consumption in Embedded Devices
Reducing the amount of power your embedded device is consuming is not trivial. With so many devices moving to battery operations today, maximizing battery life can be the difference between a happy, raving customer and an unhappy one that ruins your company's reputation. This post explores seven steps for optimizing your embedded systems' power consumption. You'll gain insights into the steps and techniques necessary along with receiving a few resources to help you on your journey.
Trust, but Verify: Examining the Output of an Embedded Compiler
Jason Sachs argues embedded engineers should read their compiler's assembly even if they rarely write assembly. He walks through Microchip XC16 output for dsPIC33 devices, showing how simple C variants and optimization flags produce very different code. The article demonstrates practical verification techniques and a tiny Python helper, pyxc16, to quickly inspect assembly for timing-sensitive firmware without rewriting everything in assembly.
Are We Shooting Ourselves in the Foot with Stack Overflow?
Most traditional, beaten-path memory layouts allocate the stack space above the data sections in RAM, even though the stack grows “down” (towards the lower memory addresses) in most embedded processors. This arrangement puts your program data in the path of destruction of a stack overflow. In other words, you violate the first Gun Safety Rule (ALWAYS keep the gun pointed in a safe direction!) and you end up shooting yourself in the foot. This article shows how to locate the stack at the BEGINNING of RAM and thus point it in the "safe" direction.
Arduino robotics #3 - wiring, coding and a test run
Lonnie Honeycutt walks through wiring, coding, and the first test run of Clusterbot, a budget Arduino robot build costing about $50. The post provides a clear pin-mapping to the TB6612FNG motor driver, ready-to-upload Arduino movement functions, and practical tips like tinning thin battery wires. You also get PWM calibration values and the measured RPM timing the author used to make reliable turns.
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.
Getting Started With Zephyr: Kconfig
In this blog post, we briefly look at Kconfig, one of the core pieces of the Zephyr infrastructure. Kconfig allows embedded software developers to turn specific subsystems on or off within Zephyr efficiently and control their behavior. We also learn how we can practically use Kconfig to control the features of our application using the two most common mechanisms.
Understanding Microchip 8-bit PIC Configuration
The second post of a five part series picks up getting started developing with Microchip 8-bit PIC Microcontroller by examining the how and why of processor configuration. Topics discussed include selecting the oscillator to use during processor startup and refining the configuration once the application starts. A walk through of the code generated by the Microchip IDE provides a concrete example of the specific Configuration Word and SFR values needed to configure the project specific clock configuration.
Choosing a Microcontroller for Your Vehicle
Picking the right microcontroller can make or break an autonomous vehicle project, and this post gives a practical checklist to help. It walks through voltage and power needs, memory and IO planning, cost and availability tradeoffs, and when to step up from an 8-bit MCU to a 32-bit controller or single-board computer. Real-world board examples illustrate the choices.
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.
Working with Microchip PIC 8-bit GPIO
The third in a series of five posts looks at GPIO with PIC 8-bit microcontrollers. After a detailed review of the registers for configuring and managing GPIO on the PIC18F47Q10 processor, a basic application is stood up programming those registers to blink external LEDs at 0.5Hz.




















