Learning Rust For Embedded Systems
The Motivational PortionBased on recommendations from Kevin Nause, the VolksEEG project is considering using Rust as the embedded system programming language. So I've been off on a tear skimming books and e-books and watching videos at 2x to evaluate it.
My conclusion? Do it!
Most of the rest of us participants are primarily C/C++ embedded developers. I had previously been sensitized to Rust for embedded systems by
The 2021 IoT Online Conference
The IoT Online Conference is back, and this time the core focus is on IoT embedded systems and edge computing. This post will explore what will be happening at this year’s conference and how teams and developers can benefit.
The IoT Online Conference OverviewThe IoT Online Conference will be taking place December 8 – 10, 2021. This is the conferences’ fourth year, although it started as a fall embedded systems conference which was a single day of webinars. The...
Six Software Design Tools
Contents: IntroductionHere are six tools to help you with software design. The first two are very simple, almost deceptively trivial, while the last four are more involved. They apply universally, to all types of software, all types of systems, and all languages. This is part of good engineering discipline.
At face value, this is just a bunch of acronyms,...
VolksEEG Project: Initial Hardware Architecture
The initial hardware architecture for the prototype VolksEEG uses an Adafruit Feather nRF52840 Sense, which connects to a PC via USB for UI (User Interface). Through several additional chips, this provides power to and acquires data from the ADS1299 ADC.
An important topic I mentioned in my introduction to the project is isolation, ensuring there is no conductive path for current through the patient. The architecture is therefore split into...
Introducing The VolksEEG Project
IntroductionThe VolksEEG project is an open-source project with the goal of creating an electroenchephalogram (EEG) machine, fully cleared by the FDA for standard clinical use. All designs will be freely available for others to manufacture.
The project was founded by Alan Cohen, a medical device systems engineer with an electrical engineering/software (EE/SW) background in Boston, USA, and Dr. Bryan Glezerson
Video-Based STEM Embedded Systems Curriculum, Part 2
Contents:- Introduction
- Lesson Plan 1: Introducing Arduino
- Lesson Plan 2: Circuit Drawings With Fritzing
- Lesson Plan 3: Basic Electronics
- Coming Soon
This post continues from part 1. It contains the first three lesson plans.
Lesson Plan 1: Introducing ArduinoThis lesson is first because Arduino is the simplest programming environment, yet allows lots of interaction with hardware. In...
Video-Based STEM Embedded Systems Curriculum, Part 1
Contents:- Introduction
- Adapting To Your Circumstances
- Suggested Policies
- The Video Educators
- Equipment, Books, and Supplies
- Lesson Summary
- Suggested Teaching Method
Review: Prototype to Product
Prototype to Product: A Practical Guide for Getting to Market, by Alan Cohen, is a must-read for anyone involved in product development, whether in a technical, management, or executive role.
I was reminded of it by Cohen's recent episode on Embedded.fm, 388: Brains Generate EMF, which is worth listening to a couple times through, especially if you're interested in medical device development. And in fact his first episode there,
The 2021 DSP/ML Online Conference
The 2021 DSP/ML Online Conference is just around the corner and this year again, the program is packed with opportunities to learn.
By registering for the conference, not only will you have full access to all talks, workshops, and Q&A sessions at this year's event, but you'll also gain instant access to all talks from last year's edition.
We've asked the speakers to tell me a few words about their sessions, here are some of the answers we've...
Definite Article: Notes on Traceability
Electronic component distibutor Digi-Key recently announced part tracing for surface-mount components purchased in cut-tape form. This is a big deal, and it’s a feature that is a good example of traceability. Some thing or process that has traceability basically just means that it’s possible to determine an object’s history or provenance: where it came from and what has happened to it since its creation. There are a...
Lost Secrets of the H-Bridge, Part III: Practical Issues of Inductor and Capacitor Ripple Current
We've been analyzing the ripple current in an H-bridge, both in an inductive load and the DC link capacitor. Here's a really quick recap; if you want to get into more details, go back and read part I and part II until you've got equations coming out of your ears. I promise there will be a lot less grungy math in this post. So let's get most of it out of the way:
Switches QAH and QAL are being turned on and off with pulse-width modulation (PWM), to produce an average voltage DaVdc on...
Important Programming Concepts (Even on Embedded Systems) Part IV: Singletons
Other articles in this series:
- Part I: Idempotence
- Part II: Immutability
- Part III: Volatility
- Part V: State Machines
- Part VI: Abstraction
Today’s topic is the singleton. This article is unique (pun intended) in that unlike the others in this series, I tried to figure out a word to use that would be a positive concept to encourage, as an alternative to singletons, but
Data Types for Control & DSP
There's a lot of information out there on what data types to use for digital signal processing, but there's also a lot of confusion, so the topic bears repeating.
I recently posted an entry on PID control. In that article I glossed over the data types used by showing "double" in all of my example code. Numerically, this should work for most control problems, but it can be an extravagant use of processor resources. There ought to be a better way to determine what precision you need...
Turn It On Again: Modeling Power MOSFET Turn-On Dependence on Source Inductance
This is a short article explaining how to analyze part of the behavior of a power MOSFET during turn-on, and how it is influenced by the parasitic inductance at the source terminal. The brief qualitative reason that source inductance is undesirable is that it uses up voltage when current starts increasing during turn-on (remember, V = L dI/dt), voltage that would otherwise be available to turn the transistor on faster. But I want to show a quantitative approximation to understand the impact of additional source inductance, and I want to compare it to the effects of extra inductance at the gate or drain.
Fluxions for Fun and Profit: Euler, Trapezoidal, Verlet, or Runge-Kutta?
Today we're going to take another diversion from embedded systems, and into the world of differential equations, modeling, and computer simulation.
DON'T PANIC!First of all, just pretend I didn't bring up anything complicated. We're exposed to the effects of differential equations every day, whether we realize it or not. Your car speedometer and odometer are related by a differential equation, and whether you like math or not, you probably have some comprehension of what's going on: you...
C to C++: Templates and Generics – Supercharging Type Flexibility
"C to C++: Templates and Generics – Supercharging Type Flexibility" illuminates the rigidity of C when managing multiple types and the confusion of code replication or macro complexity. In contrast, C++ offers templates, acting as type-agnostic blueprints for classes and functions, which allows for the creation of versatile and reusable code without redundancy. By using templates, developers can define operations like add once and apply them to any data type, simplifying codebases significantly. Generics further this concept, enabling a single code structure to handle diverse data types efficiently—a boon for embedded systems where operations must be performed on varying data, yet code efficiency is critical due to resource limitations. The blog walks through practical applications, showcasing how templates streamline processes and ensure type safety with static_assert, all while weighing the pros and cons of their use in embedded software, advocating for careful practice to harness their full potential.
Best Firmware Architecture Attributes
Architecture of a firmware (FW) in a way defines the life-cycle of your product. Often companies start with a simple-version of a product as a response to the time-to-market caveat of the business, make some cash out of the product with a simple feature set. It takes only less than 2-3 years to reach a point where the company needs to develop multiple products derived from the same code base and multiple teams need to develop...
Introduction to Microcontrollers - More On Interrupts
A Little More Detail About The Interrupt MechanismIt's time to look a little closer at what happens in an interrupt request and response. Again this is in general terms, and different microcontroller designs may do things somewhat differently, but the basics remain the same. Most but not all interrupt requests are latched, which means the interrupt event sets a flag that stays set even if the interrupt event then goes away. It is this latched flag...
Homebrew CPUs: Messing around with a J1
In this article I will examine James Bowman's excellent J1 CPU; I will then proceed to mess around with various parts of it, making it smaller, more appropriate to my particular application, and possibly faster. I hope this will show you how easy it is to fiddle around with homemade CPUs and encourage you to make something weird and wonderful.
J1 CPUMy hat is off to James Bowman. J1 is pretty cool. It is a stack machine; it executes instructions in one cycle, it is...
Introduction to Microcontrollers - Buttons and Bouncing
What Is A Button?To your hardware, that is. As discussed in Introduction to Microcontrollers - More On GPIO, a button (or key, or switch, or any form of mechanical contact) is generally hooked up to a microcontroller so as to generate a certain logic level when pushed or closed or "active," and the opposite logic level when unpushed or open or "inactive." The active logic level can be either '0' or '1', but for reasons both historical and electrical, an...
Stairway to Thévenin
This article was inspired by a recent post on reddit asking for help on Thévenin and Norton equivalent circuits.
(With apologies to Mr. Thévenin, the rest of the e's that follow will remain unaccented.)
I still remember my introductory circuits class on the subject, roughly as follows:
(NOTE: Do not get scared of what you see in the rest of this section. We're going to point out the traditional approach for teaching linear equivalent circuits first. If you have...
Introduction to Microcontrollers - Ada - 7 Segments and Catching Errors
7 Segments the Ada WayHere is the Ada version (I should say AN Ada version) of the 7 segment multiplexing code presented in the last installment. The hardware now is the STM32F407 Discover board, which is a Cortex M4F board. There are lots of differences in GPIO and timer setup, but if you understoold the previous code in C you should not have much trouble understanding this code in Ada.
As interesting as the Ada approach to the task is the Ada ability to detect...
Creating a Hardware Abstraction Layer (HAL) in C
In my last post, C to C++: Using Abstract Interfaces to Create Hardware Abstraction Layers (HAL), I discussed how vital hardware abstraction layers are and how to use a C++ abstract interface to create them. You may be thinking, that’s great for C++, but I work in C! How do I create a HAL that can easily swap in and out different drivers? In today’s post, I will walk through exactly how to do that while using the I2C bus as an example.
Little to no benefit from C based HLS
Last updated 07-Nov-2015
As I write this I am on a plane and my destination is EELive 2014 where I am going to give a talk hardware design: the grunge era. It is a shotgun introduction to three alternative hardware description languages (alt.hdl). The three languages briefly introduced in the talk are: bsv, chisel, and myhdl. The goal of the talk is simply to raise awareness of the three...
How to make a heap profiler
We'll see how to make a heap profiler. Example code for this post makes up heapprof, a working 250-line heap profiler for programs using malloc/free.
It works out of the box on Linux (tested on "real" programs like gdb and python). The main point though is being easy to port and modify to suit your needs. The code, build and test scripts are at github.
Why roll your own heap profiler?
- It's easy! And fun, if you're that sort of person. What, not reasons enough? OK, how...
Dealing With Fixed Point Fractions
Fixed point fractional representation always gives me a headache because I screw it up the first time I try to implement an algorithm. The difference between integer operations and fractional operations is in the overflow. If the representation fits in the fixed point result, you can not tell the difference between fixed point integer and fixed point fractions. When integers overflow, they lose data off the most significant bits. When fractions overflow, they lose data off...
Jaywalking Around the Compiler
Our team had another code review recently. I looked at one of the files, and bolted upright in horror when I saw a function that looked sort of like this:
void some_function(SOMEDATA_T *psomedata) { asm volatile("push CORCON"); CORCON = 0x00E2; do_some_other_stuff(psomedata); asm volatile("pop CORCON"); }There is a serious bug here — do you see what it is?
Went 280km/h (174mph) in a Porsche Panamera in Germany!
Those of you who've been following my blog lately already know that I am going through some sort of mid-life crisis that involves going out there to meet people and make videos. It all started with Embedded World early this year, then continued at ESC Boston a couple of months ago and the latest chapter just concluded as I returned from Germany after spending a week at SEGGER's headquarters to produce a video to highlight their 25th anniversary.
The DSP Online Conference - Right Around the Corner!
It is Sunday night as I write this blog post with a few days to go before the virtual doors of the very first DSP Online Conference open..
It all started with a post in the DSPRelated forum about three months ago. We had just had a blast running the 2020 Embedded Online Conference and we thought it could be fun to organize a smaller event dedicated to the DSP community. So my goal with the post in the forum was to see if...