From bare-metal to RTOS: 5 Reasons to use an RTOS

Jacob Beningo October 18, 20167 comments

Developers can come up with amazing and convoluted reasons to not use an RTOS. I have heard excuses ranging from they are too expensive (despite open source solutions) all the way to they aren’t efficient and use too much memory. In some circumstances some excuses are justified but there are many reasons why a developer should look to an RTOS to help with their real-time scheduling needs.

From bare-metal to RTOS Quick Links
  • Part 1: 

From Baremetal to RTOS: A review of scheduling techniques

Jacob Beningo June 8, 201616 comments

Transitioning from bare-metal embedded software development to a real-time operating system (RTOS) can be a difficult endeavor. Many developers struggle with the question of whether they should use an RTOS or simply use a bare-metal scheduler. One of the goals of this series is to walk developers through the transition and decision making process of abandoning bare-metal thinking and getting up to speed quickly with RTOSes. Before diving into the details of RTOSes, the appropriate first step...

Choosing a Microcontroller for Your Vehicle

Ed Nutter June 7, 20161 comment

There are many things to take into consideration when choosing a microcontroller or microprocessor for your autonomous vehicle.


Some processors run on 5V and others use 3.3V.  Be sure to check the documentation before you buy.  Make sure your supply has a high enough amp rating that your microcontroller doesn't lose pwer.


Can the system run using batteries?  Large, automotive sized vehicles can be run from large batteries or inverters in the vehicle.  Smaller...

Cutting Through the Confusion with ARM Cortex-M Interrupt Priorities

Miro Samek February 26, 2016

The insanely popular ARM Cortex-M processor offers very versatile interrupt priority management, but unfortunately, the multiple priority numbering conventions used in managing the interrupt priorities are often counter-intuitive, inconsistent, and confusing, which can lead to bugs. In this post I attempt to explain the subject and cut through the confusion.

The Inverse Relationship Between Priority Numbers and Urgency of the Interrupts

The most important fact to know is that ARM...

Cortex-M Exception Handling (Part 2)

Ivan Cibrario Bertolotti February 1, 20169 comments

The first part of this article described the conditions for an exception request to be accepted by a Cortex-M processor, mainly concerning the relationship of its priority with respect to the current execution priority. This part will describe instead what happens after an exception request is accepted and becomes active.


Before discussing in detail the sequence of actions that occurs within the processor after an exception request...

Metal detection: beat frequency oscillator

Fabien Le Mentec January 30, 2016
Plan Introduction Theory Electronics Software Tests ReferencesNext part: building the detector 1. Introduction

This 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

Govind Mukundan December 27, 20152 comments

When you're writing firmware, there always comes a time when you need to check the resources consumed by your efforts - perhaps because you're running out of RAM or Flash or you want to optimize something. The map file generated by your linker is a useful tool to aid in the resource analysis. I wanted to filter and sort the data generated in an interactive way so I wrote a C# WinForms application that reads the data from the map and presents it in a list view (using the awesome

Mounting plate for Arduino

Ed Nutter November 30, 2015

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.

I am using thin plexiglass type glazing material from the hardware store.  You can use the thicker material, but may have to purchase longer screws for stand-offs depending on what you use.

I like using the small Plano tackle boxes, because they can hold the plate, a few parts, batteries and a...

Cortex-M Exception Handling (Part 1)

Ivan 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. The main reason of discussing this topic in detail is that, in the past few years, the degree of sophistication (and complexity) of microcontrollers in handling interrupts steadily increased, bringing them on a par with general-purpose processors.

Trust, but Verify: Examining the Output of an Embedded Compiler

Jason Sachs September 27, 2015

I work with motor control firmware on the Microchip dsPIC33 series of microcontrollers. The vast majority of that firmware is written in C, with only a few percent in assembly. And I got to thinking recently: I programmed in C and C++ on an Intel PC from roughly 1991 to 2009. But I don’t remember ever working with x86 assembly code. Not once. Not even reading it. Which seems odd. I do that all the time with embedded firmware. And I think you should too. Before I say why, here are...

Introduction to Microcontrollers - Beginnings

Mike Silva August 20, 201311 comments

Welcome to this Introduction to Microcontroller Programming tutorial series. If you are looking to learn the basics of embedded programming for microcontrollers (and a bit of embedded hardware design as well), I hope these tutorials will help you along that journey. These are my first postings here, and I am writing this tutorial series because over the years I have seen countless newbies asking the same questions and tripping over the same stumbling blocks, and I thought I might be able to...

Introduction to Microcontrollers - Hello World

Mike Silva September 11, 201313 comments

Embedded Hello World

A standard first program on an embedded platform is the blinking LED.  Getting an LED to blink demonstrates that you have your toolchain set up correctly, that you are able to download your program code into the μC, and that the μC and associated circuitry (e.g. the power supply) is all working.  It can even give you good evidence as to the clock rate that your microcontroller is running (something that trips up a great many people,...

Introduction to Microcontrollers - Further Beginnings

Mike Silva September 1, 20133 comments
Embedded Programming Basics

This tutorial entry will discuss some further embedded programming basics that you will need to understand before proceeding on to the LED blinky and other example programs. We will do this by looking at the general organization and types of instructions found in most microcontrollers, and how that organization and those instructions are reflected (or, in some cases, ignored) by the C programming language.

Basic CPU...

Introduction to Microcontrollers - Driving WS2812 RGB LEDs

Mike Silva November 14, 201322 comments

This tutorial chapter is a bit of a detour, but I think an interesting and useful one.  It introduces a bit of assembly language programming, and demonstrates bit-banging a tight serial data protocol.  And it deals with RGB LEDs, which are just very fun in their own right, especially these new parts.  So I thought I'd post this to give readers time for some holiday lighting experimenting.

Back To The Future

Remember how we started this...

Arduino robotics #1 - motor control

Lonnie Honeycutt October 13, 20132 comments
Arduino Robotics

Beginner robotics is a series of article chronicling my first autonomous robot build, Clusterbot.  This build is meant to be affordable, relatively easy and instructive.  The total cost of the build is around $50.  

1. Arduino robotics - motor control2. Arduino robotics - chassis, locomotion and power3. Arduino robotics - wiring, coding and a test run4. 

Introduction to Microcontrollers - More On GPIO

Mike Silva September 13, 20134 comments

Now that we have our LED Blinky program nailed down, it's time to look more closely at outputs, add button/switch inputs, and work with reading inputs and driving outputs based on those inputs.

It's ON - No, It's OFF - No, It's ON...

I have to confess, I cheated.  Well, let's say I glossed over something very important.  In our LED Blinky program, we never cared about whether an output '1' or an output '0' turned on the LED.  Since we were just...

Arduino robotics #4 - HC-SR04 ultrasonic sensor

Lonnie Honeycutt October 20, 20131 comment
Arduino Robotics

Arduino robotics is a series of article chronicling my first autonomous robot build, Clusterbot.  This build is meant to be affordable, relatively easy and instructive.  The total cost of the build is around $50.  

1. Arduino robotics - motor control2. Arduino robotics - chassis, locomotion and power3. Arduino robotics - wiring, coding and a test run4.

Introduction to Microcontrollers - Interrupts

Mike Silva September 18, 20135 comments

It's Too Soon To Talk About Interrupts!

That, at least, could be one reaction to this chapter.  But over the years I've become convinced that new microcontroller programmers should understand interrupts before being introduced to any complex peripherals such as timers, UARTs, ADCs, and all the other powerful function blocks found on a modern microcontroller.  Since these peripherals are commonly used with interrupts, any introduction to them that does not...

Introduction to Microcontrollers - Timers

Mike Silva September 28, 20132 comments

Timers - Because "When" Matters

Computer programs are odd things, for one reason because they have no concept of time.  They may have the concept of sequential execution, but the time between instructions can be essentially any number and the program won't notice or care (unless assumptions about time have been built into the program by the programmer).  But the real world is not like this.  In the real world, especially the real embedded world,...

Using a RTLSDR dongle to validate NRF905 configuration

Fabien Le Mentec January 27, 20146 comments
I am currently working on a system to monitor the garage door status from my flat. Both places are 7 floors apart, and I need to send the data wirelessly. I chose to operate on the 433MHz carrier, and I ordered 2 PTR8000 modules: PTR8000 is based on the dual band sub 1GHz NRF905 chipset from NORDICSEMI: