What does it mean to be 'Turing complete'?
The term "Turing complete" describes all computers and even some things we don't expect to be as powerful as a typical computer. In this article, I describe what it means and discuss the implications of Turing completeness on projects that need just a little more power, on alternative processor designs, and even security.
Elliptic Curve Cryptography - Security Considerations
The security of elliptic curve cryptography is determined by the elliptic curve discrete log problem. This article explains what that means. A comparison with real number logarithm and modular arithmetic gives context for why it is called a log problem.
Handling Translations in an Embedded Project
A brief walkthrough on how to handle human language translations in a low level C application. Some options are listed, each with advantages and disadvantages laid out.
Elliptic Curve Cryptography - Basic Math
An introduction to the math of elliptic curves for cryptography. Covers the basic equations of points on an elliptic curve and the concept of point addition as well as multiplication.
Square root in fixed point VHDL
In this blog we will design and implement a fixed point square root function in VHDL. The algorithm is based on the recursive Newton Raphson inverse square root algorithm and the implementation offers parametrizable pipeline depth, word length and the algorithm is built with VHDL records and procedures for easy use.
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.
Open-Source Licenses Made Easy with Buildroot and Yocto for Embedded Linux
In this article I will try to explain what are the copyrights/copyleft, what are the popular opensource software licenses, and how to make sure that your Embedded Linux system complies with them using popular build systems ; Buildroot or YOCTO projec
There are 10 kinds of people in the world
It is useful, in embedded software, to be able to specify values in binary. The C language lacks this facility. In this blog we look at how to fix that.
Getting Started With Zephyr: Devicetree Overlays
In this blog post, I show how the Devicetree overlay is a valuable construct in The Zephyr Project RTOS. Overlays allow embedded software engineers to override the default pin configuration specified in Zephyr for a particular board. In this blog post, I use I2C as an example. Specifically, I showed the default I2C pins used for the nRF52840 development kit in the nominal Zephyr Devicetree. Then, I demonstrated how an overlay can be used to override this pin configuration and the final result.
Embedded Developers, Ditch Your IDEs – Here’s Why!
Ditching your Integrated Development Environment (IDE) temporarily can be a transformative learning experience in embedded development. This post invites you to explore the underpinnings of IDEs by delving into alternative tools and processes like Makefile, CMake, Vim, GDB, and OpenOCD. Understanding these tools can demystify the background operations of IDEs, revealing the intricacies of compiling, linking, and debugging. This journey into the “under the hood” aspects of development is not just about learning new tools, but also about gaining a deeper appreciation for the convenience and efficiency that IDEs provide. By stepping out of your comfort zone and experimenting with these alternatives, you can sharpen your skills, enhance your knowledge, and possibly discover a more tailored and streamlined development experience. Whether you're a novice or a seasoned developer, this exploration promises insights and revelations that can elevate your embedded development journey.
Linear Feedback Shift Registers for the Uninitiated
In 2017 and 2018 I wrote an eighteen-part series of articles about linear feedback shift registers, or LFSRs:
div.jms-article-content ol > li { list-style-type: upper-roman } Ex-Pralite Monks and Finite Fields, in which we describe what an LFSR is as a digital circuit; its cyclic behavior over time; the definition of groups, rings, and fields; the isomorphism between N-bit LFSRs and the field \( GF(2^N) \); and the reason why I wrote this seriesSecond-Order Systems, Part I: Boing!!
I’ve already written about the unexciting (but useful) 1st-order system, and about slew-rate limiting. So now it’s time to cover second-order systems.
The most common second-order systems are RLC circuits and spring-mass-damper systems.
Spring-mass-damper systems are fairly common; you’ve seen these before, whether you realize it or not. One household example of these is the spring doorstop (BOING!!):
(For what it’s worth: the spring...
How to Build a Fixed-Point PI Controller That Just Works: Part I
This two-part article explains five tips to make a fixed-point PI controller work well. I am not going to talk about loop tuning -- there are hundreds of articles and books about that; any control-systems course will go over loop tuning enough to help you understand the fundamentals. There will always be some differences for each system you have to control, but the goals are the same: drive the average error to zero, keep the system stable, and maximize performance (keep overshoot and delay...
VHDL tutorial - combining clocked and sequential logic
In an earlier article on VHDL programming ("VHDL tutorial" and "VHDL tutorial - part 2 - Testbench", I described a design for providing a programmable clock divider for a ADC sequencer. In this example, I showed how to generate a clock signal (ADCClk), that was to be programmable over a series of fixed rates (20MHz, 10MHz, 4MHz, 2MHz, 1MHz and 400KHz), given a master clock rate of 40MHz. A reader of that article had written to ask if it was possible to extend the design to...
Linear Feedback Shift Registers for the Uninitiated, Part XVI: Reed-Solomon Error Correction
Last time, we talked about error correction and detection, covering some basics like Hamming distance, CRCs, and Hamming codes. If you are new to this topic, I would strongly suggest going back to read that article before this one.
This time we are going to cover Reed-Solomon codes. (I had meant to cover this topic in Part XV, but the article was getting to be too long, so I’ve split it roughly in half.) These are one of the workhorses of error-correction, and they are used in...
Getting Started With Zephyr: Saving Data To Files
In this blog post, I show how to implement a Zephyr application to mount a microSD card, create a new file on the microSD card, and write data to it. The lessons learned from such an application can be helpful for devices out in the field that need to write data to off-board memory periodically, especially in cases where Internet access may be sporadic.
Bit-Banged Async Serial Output And Disciplined Engineering
This post covers implementing asynchronous serial output directly on a GPIO with bit-banging. This can be a valuable debug tool for getting information out of a system. It also covers disciplined engineering, using the bit-banging module as an example and template you can apply to other projects.
Important Programming Concepts (Even on Embedded Systems) Part V: State Machines
Other articles in this series:
- Part I: Idempotence
- Part II: Immutability
- Part III: Volatility
- Part IV: Singletons
- Part VI: Abstraction
Oh, hell, this article just had to be about state machines, didn’t it? State machines! Those damned little circles and arrows and q’s.
Yeah, I know you don’t like them. They bring back bad memories from University, those Mealy and Moore machines with their state transition tables, the ones you had to write up...
Lost Secrets of the H-Bridge, Part I: Ripple Current in Inductive Loads
So you think you know about H-bridges? They're something I mentioned in my last post about signal processing with Python.
Here we have a typical H-bridge with an inductive load. (Mmmmm ahhh! It's good to draw by hand every once in a while!) There are four power switches: QAH and QAL connecting node A to the DC link, and QBH and QBL connecting node B to the DC link. The load is connected between nodes A and B, and here is represented by an inductive load in series with something else. We...
Delayed printf for real-time logging
You often debug by adding a few printfs and looking at the logs. In some real-time/low-level contexts though, you don't have time for text formatting.
You don't want prints to affect timing too much, because then timing-related bugs you're chasing might disappear. And you certainly don't want the system to stop functioning altogether because prints cause it to miss real-time deadlines.
A common alternative to prints is more "raw" logging - an event buffer, where event is a union keeping...
Lazy Properties in Python Using Descriptors
This is a bit of a side tangent from my normal at-least-vaguely-embedded-related articles, but I wanted to share a moment of enlightenment I had recently about descriptors in Python. The easiest way to explain a descriptor is a way to outsource attribute lookup and modification.
Python has a bunch of “magic” methods that are hooks into various object-oriented mechanisms that let you do all sorts of ridiculously clever things. Whether or not they’re a good idea is another...
Byte and Switch (Part 2)
In part 1 we talked about the use of a MOSFET for a power switch. Here's a different circuit that also uses a MOSFET, this time as a switch for signals:
We have a thermistor Rth that is located somewhere in an assembly, that connects to a circuit board. This acts as a variable resistor that changes with temperature. If we use it in a voltage divider, the midpoint of the voltage divider has a voltage that depends on temperature. Resistors R3 and R4 form our reference resistance; when...
Android for Embedded Devices - 5 Reasons why Android is used in Embedded Devices
The embedded purists are going to hate me for this. How can you even think of using Android on an embedded system ? It’s after all a mobile phone operating system/software.
Sigh !! Yes I did not like Android to begin with, as well - for use on an Embedded System. But sometimes I think the market and needs decide what has to be used and what should not be. This is one such thing. Over the past few years, I have learned to love Android as an embedded operating system....
Two Capacitors Are Better Than One
I was looking for a good reference for some ADC-driving circuits, and ran across this diagram in Walt Jung’s Op-Amp Applications Handbook:
And I smiled to myself, because I immediately remembered a circuit I hadn’t used for years. Years! But it’s something you should file away in your bag of tricks.
Take a look at the RC-RC circuit formed by R1, R2, C1, and C2. It’s basically a stacked RC low-pass filter. The question is, why are there two capacitors?
I...
The Least Interesting Circuit in the World
It does nothing, most of the time.
It cannot compute pi. It won’t oscillate. It doesn’t light up.
Often it makes other circuits stop working.
It is… the least interesting circuit in the world.
What is it?
About 25 years ago, I took a digital computer architecture course, and we were each given use of an ugly briefcase containing a bunch of solderless breadboards and a power supply and switches and LEDs — and a bunch of
The habitat of hardware bugs
The Moscow apartment which little me called home was also home to many other creatures, from smallish cockroaches to biggish rats. But of course we rarely met them face to face. Evolution has weeded out those animals imprudent enough to crash your dinner. However, when we moved a cupboard one time, we had the pleasure to meet a few hundreds of fabulously evolved cockroaches.
In this sense, logical bugs aren't different from actual insects. You won't find...
Arduino robotics #4 - HC-SR04 ultrasonic sensor
Arduino RoboticsArduino 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.Ten Little Algorithms, Part 4: Topological Sort
Other articles in this series:
- Part 1: Russian Peasant Multiplication
- Part 2: The Single-Pole Low-Pass Filter
- Part 3: Welford's Method (And Friends)
- Part 5: Quadratic Extremum Interpolation and Chandrupatla's Method
- Part 6: Green’s Theorem and Swept-Area Detection
Today we’re going to take a break from my usual focus on signal processing or numerical algorithms, and focus on...
Important Programming Concepts (Even on Embedded Systems) Part II: Immutability
Other articles in this series:
- Part I: Idempotence
- Part III: Volatility
- Part IV: Singletons
- Part V: State Machines
- Part VI: Abstraction
This article will discuss immutability, and some of its variations in the topic of functional programming.
There are a whole series of benefits to using program variables that… well, that aren’t actually variable, but instead are immutable. The impact of...