EmbeddedRelated.com
Tutorials
The 2026 Embedded Online Conference

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.


How to Build a Fixed-Point PI Controller That Just Works: Part I

Jason SachsJason Sachs February 26, 20127 comments

Jason Sachs digs into the implementation choices that make a fixed-point PI controller reliable in real embedded systems. He focuses on practical fixes rather than tuning: prefer scale-then-integrate, fold the timestep into the integral gain, and apply anti-windup so saturations and sensor noise do not break the loop. Part I covers discrete-time pitfalls and sets up fixed-point scaling issues for Part II.


Embedded Software Creation II - European Normative & Legislation

Dr. Maykel AlonsoDr. Maykel Alonso December 20, 20116 comments

In this post I will explain the European Normative. I will answer the main questions and I will be open to answer all the doubts any of you could have. Please leave a comment and I will answer if i could.

Why I need to look and accomplish some standards? 

The main reason is if you want to comercialize the product in the European Union, if exists any European Directive that cover the product, the product must be marked with the CE mark. For USA it work in the same way by the...


C++ on microcontrollers 4 – input pins, and decoding a rotary switch

Wouter van OoijenWouter van Ooijen November 12, 20112 comments

Wouter van Ooijen shows how to extend a small C++ I/O library for microcontrollers to support input pins and mixed I/O, and how to decode a rotary switch reliably. The post walks through a safe class hierarchy for input, output, and bidirectional pins, then builds a quadrature decoder with a saturating counter and an HC595 seven-segment demo you can run on LPCXpresso hardware.


C++ on microcontrollers 3 – a first shot at an hc595 class with 8 output pins

Wouter van OoijenWouter van Ooijen November 2, 2011

 previous parts: 1, 2

This blog series is about the use of C++ for modern microcontrollers. My plan is to show the gradual development of a basic I/O library. I will introduce the object-oriented C++ features that are used step by step, to provide a gentle yet practical introduction into C++ for C programmers.  Reader input is very much appreciated, you might even steer me in the direction you find most interesting.

In the first part of...


C++ on microcontrollers 2 - LPCXpresso, LPC-link, Code Sourcery, lpc21isp, linkerscript, LPC1114 startup

Wouter van OoijenWouter van Ooijen October 24, 20115 comments

Wouter van Ooijen walks you through getting C++ to run on a tiny LPC1114 board using LPCXpresso hardware and a command-line toolchain. He demonstrates a minimal linker script and startup code that initialize .data and .bss and call C++ global constructors, shows how to flash via the on-chip bootloader with lpc21isp when LPC-link is locked, and includes practical GPIO and SysTick LED examples.


Using XML to describe embedded devices (and speak to them)

Martin StrubelMartin Strubel October 12, 20111 comment

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.


C++ on microcontrollers 1 - introduction, and an output pin class

Wouter van OoijenWouter van Ooijen October 9, 20117 comments

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.


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.


Kind of Buggy! The state machine fantastic//

Richard DorfnerRichard Dorfner August 31, 20112 comments

Richard Dorfner shows a compact way to debug an intermittent homing failure in a Pan/Tilt camera by logging the last 30 state transitions in a circular buffer. He tags each entry with a function identifier and uses breakpoints to walk the recorded sequence backwards. That reveals a timing interaction between a 100 ms periodic flag and the homing code that stopped the motor state machine. The method is low-overhead and ideal for single-threaded embedded systems.


Five Embedded Linux Topics for Newbies !

George EmadGeorge Emad May 9, 2024

Are you an embedded systems enthusiast looking to broaden your horizons with embedded Linux? explore those 5 topics.


On hardware state machines: How to write a simple MAC controller using the RP2040 PIOs

Sergio R CaprileSergio R Caprile December 8, 2024

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…


Coding Step 4 - Design

Stephen FriederichsStephen Friederichs November 24, 2015

Articles in this series:

The last article in this series discussed how to write functional high-level requirements: specifications for what your software is supposed to do. Software design is the other side of the coin....


Getting Started with (Apache) NuttX RTOS Part 2 - Looking Inside and Creating Your Customized Image

Alan C AssisAlan C Assis July 5, 2023

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.


Deeply embedded design example - Logic replacement

Gene BrenimanGene Breniman July 9, 2011

Gene Breniman shows how a tiny PIC10F200 can replace a forest of discrete timing components to control six 10A H-bridges, letting firmware tune sequencing to cut EMI and reduce cost. He walks through analyzing the original RC/inverter delays, choosing the PIC, pinout and timer setup, and implementing compact assembly firmware that reproduces and improves the timing behavior. The result is fewer parts, saved board space, and better EMI control.


Designing Embedded Systems with FPGA-2

Pragnesh PatelPragnesh Patel November 13, 200710 comments

Turning an FPGA hardware design into a running embedded system is mostly tool work. This post walks through using Xilinx EDK to compile a base design into a .bit bitstream, generate libraries and board support packages from .mhs and .mss files, and build MicroBlaze applications with GCC. It highlights the default boot placement at 0x0 and why some apps need an explicit execution transfer.


C++ on microcontrollers 3 – a first shot at an hc595 class with 8 output pins

Wouter van OoijenWouter van Ooijen November 2, 2011

 previous parts: 1, 2

This blog series is about the use of C++ for modern microcontrollers. My plan is to show the gradual development of a basic I/O library. I will introduce the object-oriented C++ features that are used step by step, to provide a gentle yet practical introduction into C++ for C programmers.  Reader input is very much appreciated, you might even steer me in the direction you find most interesting.

In the first part of...


Picowoose: The Raspberry Pi Pico-W meets Mongoose

Sergio R CaprileSergio R Caprile October 6, 2024

This example application describes the way to adapt the George Robotics CYW43 driver, present in the Pico-SDK, to work with Cesanta's Mongoose. We are then able to use Mongoose internal TCP/IP stack (with TLS 1.3), instead of lwIP (and MbedTLS).


Making a connection 1

Ed NutterEd Nutter July 3, 20182 comments

Reliable electrical connections are the unsung foundation of any embedded system, yet connector selection and technique are often overlooked. This practical primer walks through common terminal styles, when to solder versus crimp, basic crimping steps and tool choices, plus simple checks and color-coding rules to help you make durable, serviceable wire connections without surprises.


When a Mongoose met a MicroPython, part I

Sergio R CaprileSergio R Caprile March 31, 2024

This is more a framework than an actual application, with it you can integrate MicroPython and Cesanta's Mongoose.
Mongoose runs when called by MicroPython and is able to run Python functions as callbacks for the events you decide in your event handler. The code is completely written in C, except for the example Python callback functions, of course. To try it, you can just build this example on a Linux machine, and, with just a small tweak, you can also run it on any ESP32 board.


The 2026 Embedded Online Conference