Understanding and Preventing Overflow (I Had Too Much to Add Last Night)
Integer overflow is stealthier than you think, and in embedded systems it can break control loops or corrupt data. Jason Sachs walks through the usual culprits, including addition, subtraction, multiplication, shifting and Q15 fixed-point traps, plus C-specific pitfalls such as undefined signed overflow and INT_MIN edge cases. He then lays out practical defenses: prefer fixed-width types, widen and saturate intermediates, enable wraparound where appropriate, and reason about modular congruence for compound arithmetic.
How to Arduino - a video toolbox
I've begun producing a new series of video tutorials for the hobbyist new to the Arduino or microcontrollers in general. My videos are very pragmatic - I prefer to answer the question "what is the quickest, simplest and most affordable way to accomplish this?". The videos are meant to be a quick source of "how to" knowledge for the hobbyist that is using an LCD display, ultrasonic sensor or accelerometer for the first time, for example. I hope you enjoy this series of...
Introduction to Microcontrollers - Driving WS2812 RGB LEDs
Mike Silva walks through a practical, cycle-counted AVR assembly implementation to bit-bang WS2812B RGB LEDs from an 8MHz AVR, hitting the chip's tight 1.25µs-per-bit timing. The post breaks down the WS2812B self-clocked protocol and GRB byte order, explains register and calling-convention choices, and includes a complete C example plus power-consumption warnings for driving LED strips.
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...
Energia - program a TI MSP430 using Arduino sketches
Energia brings Arduino simplicity to TI's MSP430, turning a fiddly toolchain into a sketch-based workflow you already know. Lonnie Honeycutt walks through why the Launchpad is a great low-cost dev option, outlines supported MSP430 families and caveats like 3.3 volt I/O, and shows a Halloween LED jack-o-lantern sketch to prove how quickly you can get blinking LEDs.
Introduction to Microcontrollers - Buttons and Bouncing
Mechanical buttons lie to your microcontroller, producing bounces and occasional noise that look like multiple presses. Mike Silva walks through practical ways to represent buttons, simple and robust software debounce strategies, and how to convert states into single-use events. The post includes ready-to-use C patterns: N-sample filters, shift-accumulator filtering, per-button data structures, and keypad debouncing examples.
Arduino robotics #4 - HC-SR04 ultrasonic sensor
Lonnie Honeycutt shows how to turn a $50 mobile platform into a simple autonomous robot by adding an HC-SR04 ultrasonic sensor to an Arduino. The post walks through wiring, a minimal test sketch and the integration code used on Clusterbot, plus practical tips on range limits, motor choices and library options to make obstacle avoidance reliable for hobby builds.
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.
Arduino robotics #2 - chassis, locomotion and power
Lonnie Honeycutt walks through building Clusterbot's round differential-drive chassis, showing how a circular base and Tamiya gearbox simplify turning and torque tradeoffs. The post covers motor selection, wheel fit, balance issues, and a practical two-battery power arrangement with VMOT for the motors and a separate 9V for the Arduino. Expect hands-on tips and lessons learned from a first-time robot build.
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.
Arduino robotics #4 - HC-SR04 ultrasonic sensor
Lonnie Honeycutt shows how to turn a $50 mobile platform into a simple autonomous robot by adding an HC-SR04 ultrasonic sensor to an Arduino. The post walks through wiring, a minimal test sketch and the integration code used on Clusterbot, plus practical tips on range limits, motor choices and library options to make obstacle avoidance reliable for hobby builds.
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.
Absolute Beginner's Guide To Getting Started With Raspberry Pi
Getting started with Raspberry Pi can feel overwhelming. This guide strips the noise and shows the simplest path from unboxing to a working desktop. It recommends buying a preloaded NOOBS microSD to avoid imaging hassles, lists exact parts and suppliers, and walks through booting, recovery, and making a backup. If you want embedded electronics it also lists starter parts and ESD safety tips.
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.
C++ on microcontrollers 1 - introduction, and an output pin class
Wouter van Ooijen shows how small C++ abstractions make GPIO code portable and reusable. Starting from a simple output_pin interface he implements concrete pins for an LPC2148 GPIO and a 74HC595 shift register, then composes behaviors with wrappers like tee and invert. The post demonstrates virtual methods, references, and constructor initialization lists to build drivers you can reuse across boards.
Real-time clocks: Does anybody really know what time it is?
Most RTC chips still expose calendar fields rather than seconds-since-epoch, forcing embedded engineers to write ugly conversion code. Jason Sachs makes the case for offset encoding, subseconds, and an explicit snapshot feature to simplify interval math, raise precision, and avoid rare timing bugs. Read this practical take on RTC trade-offs and a short wishlist for chip makers.
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.
Getting Started With Zephyr: Writing Data to EEPROM
In this blog post, I show how to implement a Zephyr application to interact with EEPROM. I show how the Zephyr device driver model allows application writers to be free of the underlying implementation details. Unfortunately, the application didn't work as expected, and I'm still troubleshooting the cause.
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 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.
Arduino robotics #4 - HC-SR04 ultrasonic sensor
Lonnie Honeycutt shows how to turn a $50 mobile platform into a simple autonomous robot by adding an HC-SR04 ultrasonic sensor to an Arduino. The post walks through wiring, a minimal test sketch and the integration code used on Clusterbot, plus practical tips on range limits, motor choices and library options to make obstacle avoidance reliable for hobby builds.
C Programming Techniques: Function Call Inlining
Fabien Le Mentec shows how you can keep clean C interfaces while recovering the cycles lost to function call overhead. The post demonstrates static inline and header inclusion techniques, then compares generated ARM assembly for an inlined versus non inlined bit test. Read it to see concrete assembly differences, compiler hints, and the practical trade off between speed and code size on embedded targets.
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.
Practical CRCs for Embedded Systems
Stephen Friederichs shows a practical way to get correct CRC code quickly by using PyCRC to generate C implementations, then verifying them on the desktop and an AVR ATMega328P. The post walks through the common generation algorithms, how to self-test with the standard "123456789" check value, and a real timing comparison that exposes the speed versus memory tradeoffs for embedded systems.
Real-time clocks: Does anybody really know what time it is?
Most RTC chips still expose calendar fields rather than seconds-since-epoch, forcing embedded engineers to write ugly conversion code. Jason Sachs makes the case for offset encoding, subseconds, and an explicit snapshot feature to simplify interval math, raise precision, and avoid rare timing bugs. Read this practical take on RTC trade-offs and a short wishlist for chip makers.
Energia - program a TI MSP430 using Arduino sketches
Energia brings Arduino simplicity to TI's MSP430, turning a fiddly toolchain into a sketch-based workflow you already know. Lonnie Honeycutt walks through why the Launchpad is a great low-cost dev option, outlines supported MSP430 families and caveats like 3.3 volt I/O, and shows a Halloween LED jack-o-lantern sketch to prove how quickly you can get blinking LEDs.
Introduction to Microcontrollers - Adding Some Real-World Hardware
Two blinking LEDs only teach you so much, so Mike designed a docking board that adds a 4x20 HD44780 LCD, a 4x4 button matrix, four LEDs, DIP switches and an ADC potentiometer for AVR and STM32 experiments. This post shows how to wire and drive the HD44780 in 4-bit mode, calibrate microsecond and millisecond software delays, use the busy flag to speed writes, and includes AVR example code to get the display running.
Using XML to describe embedded devices (and speak to them)
Make embedded devices tell you what they can do. Martin Strubel shows how to use XML and XSLT with the DClib/netpp framework to describe hardware, map registers into abstract properties, and auto-generate compact C, documentation, and VHDL. The netpp property protocol then lets you probe, query, and control those properties over TCP, UDP, or other transports, simplifying test benches and multi-device families.
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 - 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.

















