C to C++: 3 Reasons to Migrate
I’ve recently written several blogs that have set the stage with a simple premise: The C programming language no longer provides embedded software developers the tools they need to develop embedded software throughout the full software stack. Now, don’t get me wrong, C is a powerhouse, with over 80% of developers still using it; however, as embedded systems have reached unprecedented levels of complexity, C might not be the right tool for the job.
In this post, I’m kicking...
Favorite Software AND Hardware Tools for Embedded Systems Development
Last year, at the Embedded Online Conference, we interviewed the speakers and asked them what were some of their favorite software and hardware tools for Embedded development.
We aggregated all their answers in one insightful video that you can watch here.
Although you should really watch the video in order to get the full picture, I've compiled the following non-exhaustive list for the fun of it (again, I cannot overstate enough how much valuable...
Getting Started With Embedded Linux - From Nothing To A Login Prompt
One of the famous observations that have been made related to embedded systems is referred to as “Moore’s Law”, which states that the number of transistors in integrated circuits doubles every year. This observation has held mostly true for the past several decades, so powerful CPUs are no longer simply relegated to servers, desktops, and laptops. Instead, we see powerful CPUs with increased capabilities being introduced into embedded systems on devices that live at “the edge”....
A New Related Site!
We are delighted to announce the launch of the very first new Related site in 15 years! The new site will be dedicated to the trendy and quickly growing field of Machine Learning and will be called - drum roll please - MLRelated.com.
We think MLRelated fits perfectly well within the “Related” family, with:
- the fast growth of TinyML, which is a topic of great interest to the EmbeddedRelated community
- the use of Machine/Deep Learning in Signal Processing applications, which is of...
Five ‘80s Movies that Inspired Me to Become an Engineer
Five ‘80s Movies that Inspired Me to Become an Engineer
Movies and pop culture can incredibly impact society, particularly children. However, we never really know what conversation, demonstration, or movie could inspire someone to become an engineer. Recently in the Beningo house, we ran out of the film to watch for movie night. In desperation, I decided to find great movies from my childhood in the 80s. To my surprise, I realized how influential several of these films inspired me to...
3 Overlooked Embedded Software Elements
Have you ever wondered, while you and your team are busy writing software if the foundation of how embedded software systems are built has changed and left you in the dust? What if while you were busily focusing on getting your product out the door, fighting bugs, and dealing with supply issues, there were techniques and processes that you completely overlooked that could save the day? I’ve found three elements embedded software teams often underutilize that could dramatically improve...
Learning A New Microcontroller
Contents:- Introduction
- The Peripherals
- System Complexity
- Support Software
- Do It Like Phil
- The Programs
- WET And DRY Code
Development of the MOS Technology 6502: A Historical Perspective
One ubiquitous microprocessor of the late 1970s and 1980s was the MOS Technology MCS 6502. I included a section on the development of the 6502 in Part 2 of Supply Chain Games, and have posted it as an excerpt here, as I believe it is deserving in its own right.
(Note: MOS Technology is pronounced with the individual letters M-O-S “em oh ess”,[1] not “moss”, and should not be confused with another semiconductor company,
++i and i++ : what’s the difference?
Although the ++ and -- operators are well known, there are facets of their operation and implementation that are less familiar to many developers.
How to Analyze a Differential Amplifier
There are a handful of things that you just have to know if you do any decent amount of electronic circuit design work. One of them is a voltage divider. Another is the behavior of an RC filter. I'm not going to explain these two things or even link to a good reference on them — either you already know how they work, or you're smart enough to look it up yourself.
The handful of things also includes some others that are a little more interesting to discuss. One of them is this...
Mastering Modern FPGA Skills for Engineers
In the rapidly evolving tech industry, engineers must acquire proficiency in modern FPGA skills. These skills empower engineers to optimize designs, minimize resource usage, and efficiently address FPGA design challenges while ensuring functionality, security, and compliance.
Cortex-M Exception Handling (Part 2)
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.
PROCESSOR OPERATION AND PRIVILEGE MODEBefore discussing in detail the sequence of actions that occurs within the processor after an exception request...
Coding Step 1 - Hello World and Makefiles
Articles in this series:
- Coding Step 0 - Development Environments
- Coding Step 1 - Hello World and Makefiles
- Coding Step 2 - Source Control
- Coding Step 3 - High-Level Requirements
- Coding Step 4 - Design
Step 0 discussed how to install GCC and the make utility with the expectation of writing and compiling your first C program. In this article, I discuss how to use those tools we installed last time. Specifically, how to use GCC to compile a C program and...
Review: Project Management for the Unofficial Project Manager
Software development projects are notorious for having problems. Late, over budget, not working properly, making people's lives miserable all around. Embedded systems add the further complication of hardware to that.
How many of us have lived through problematic projects? Hopefully some of them have at least been ultimately successful to make all the suffering worth it in the end, but there are plenty that haven't.
I don't consider myself a project manager, or a manager...
Linear Feedback Shift Registers for the Uninitiated, Part XV: Error Detection and Correction
Last time, we talked about Gold codes, a specially-constructed set of pseudorandom bit sequences (PRBS) with low mutual cross-correlation, which are used in many spread-spectrum communications systems, including the Global Positioning System.
This time we are wading into the field of error detection and correction, in particular CRCs and Hamming codes.
Ernie, You Have a Banana in Your EarI have had a really really tough time writing this article. I like the...
How to Build a Fixed-Point PI Controller That Just Works: Part II
In Part I we talked about some of the issues around discrete-time proportional-integral (PI) controllers:
- various forms and whether to use the canonical form for z-transforms (don't do it!)
- order of operation in the integral term: whether to scale and then integrate (my recommendation), or integrate and then scale.
- saturation and anti-windup
In this part we'll talk about the issues surrounding fixed-point implementations of PI controllers. First let's recap the conceptual structure...
You Don't Need an RTOS (Part 4)
In this fourth (and final!) article I'll share with you the last of the inter-process communication (IPC) methods I mentioned in Part 3: mailboxes/queues, counting semaphores, the Observer pattern, and something I'm calling a "marquee". When we're done, we'll have created the scaffolding for tasks to interact in all sorts of different the ways. Additionally, I'll share with you another alternative design for a non-preemptive scheduler called a dispatch queue that is simple to conceptualize and, like the time-triggered scheduler, can help you schedule some of your most difficult task sets.
Using the C language to program the am335x PRU
IntroductionSome weeks ago, I published an article on how we used the PRU to implement a power supply control loop having hard realtime constraints:
//www.embeddedrelated.com/showarticle/586.php
Writing this kind of logic in assembly language is not easy. First the assembly language itself may be difficult to learn depending on your background. Then, fixed and floating point arithmetics require lot of code. While macros help to handle the complexity, they still are error prone as you...
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...
StrangeCPU #3. Instruction Slides - The Strangest CPU Yet!
Summary:Decoding instructions with a Sliding Window system. 0-Bit Sliding Register Windows.
Table of Contents:- Part 1: A new CPU - technology review, re-examination of the premises; StrangeCPU concepts; x86 notes.
- Part 2: Sliding-Window Token Machines, an in-depth exploration of this curious technology; ARM notes.
- Part 3. Instruction Slides - The Strangest CPU Yet! Decoding instructions with a Sliding...
Favorite Tools: C++11 std::array
Many embedded software and firmware projects must be developed to high standards of reliability. To meet these reliability requirements, firmware project teams will consider many design tradeoffs. For example, an engineering team may avoid or outright ban the use of dynamic memory allocation, a feature typically accessed via the C library call "malloc" or the C++ allocator "new". When authoring software under such...
Linear Feedback Shift Registers for the Uninitiated, Part XVIII: Primitive Polynomial Generation
Last time we figured out how to reverse-engineer parameters of an unknown CRC computation by providing sample inputs and analyzing the corresponding outputs. One of the things we discovered was that the polynomial \( x^{16} + x^{12} + x^5 + 1 \) used in the 16-bit X.25 CRC is not primitive — which just means that all the nonzero elements in the corresponding quotient ring can’t be generated by powers of \( x \), and therefore the corresponding 16-bit LFSR with taps in bits 0, 5,...
10 Items of Test Equipment You Should Know
When life gets rough and a circuit board is letting you down, it’s time to turn to test equipment. The obvious ones are multimeters and oscilloscopes and power supplies. But you know about those already, right?
Here are some you may not have heard of:
Non-contact current sensors. Oscilloscope probes measure voltage. When you need to measure current, you need a different approach. Especially at high voltages, where maintaining galvanic isolation is important for safety. The usual...
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...
Coding Step 2 - Source Control
Articles in this series:
- Coding Step 0 - Development Environments
- Coding Step 1 - Hello World and Makefiles
- Coding Step 2 - Source Control
- Coding Step 3 - High-Level Requirements
- Coding Step 4 - Design
When I first started out in programming, version control was not an introductory topic. Not in the least because it required a 'server' (ie, a computer which a teenaged me couldn't afford) but because it seemed difficult and only useful to teams rather than...
The Other Kind of Bypass Capacitor
There’s a type of bypass capacitor I’d like to talk about today.
It’s not the usual power supply bypass capacitor, aka decoupling capacitor, which is used to provide local charge storage to an integrated circuit, so that the high-frequency supply currents to the IC can bypass (hence the name) all the series resistance and inductance from the power supply. This reduces the noise on a DC voltage supply. I’ve...
Linear Feedback Shift Registers for the Uninitiated, Part VII: LFSR Implementations, Idiomatic C, and Compiler Explorer
The last four articles were on algorithms used to compute with finite fields and shift registers:
- multiplicative inverse
- discrete logarithm
- determining characteristic polynomial from the LFSR output
Today we’re going to come back down to earth and show how to implement LFSR updates on a microcontroller. We’ll also talk a little bit about something called “idiomatic C” and a neat online tool for experimenting with the C compiler.