
Lightweight hardware abstraction
Some lessons are tougher than others to master. You would think that hard fought battles would be easier to remember, but sometimes it just does not work that way. Recently, I was asked to pick-up a project that had been managed by another employee. The project was yet another cost reduction project. The hardware group was tasked with updating a currently shipping product, to reduce the existing failure rate, while at the same time to remove cost from the...
Embedded Software Creation II - European Normative & Legislation
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
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.
So far I...
Modulation Alternatives for the Software Engineer
Before I get to talking about modulation, here's a brief diversion.
A long time ago -- 1993, to be precise -- I took my first course on digital electronics and processors. In that class, we had to buy a copy of the TTL Data Book* from Texas Instruments.
If you have any experience in digital logic design you probably know that TTL stands for Transistor-transistor logic (thereby making the phrase "TTL Logic" an example of RAS...
C++ on microcontrollers 3 – a first shot at an hc595 class with 8 output pins
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...
A true pioneer passes away... A farewell to Ritchie.
We all have our heroes. We all have people who were important to our professional developments. For me, Dennis Ritchie was one of those people. I was an early adopter of the C programming language. Back in the very early 80's a friend and neighbor had excitedly shared with me his copy of "The C Programming Language" by Kernighan and Ritchie. At first I was a non-believer. I had for several years been a happy and productive assembly language...
Using XML to describe embedded devices (and speak to them)
This article discusses one of the typical development cycles in embedded device and communication design and presents a possible, light weight solution using the free DClib/netpp framework.
The challengeAssume we're faced with the design of an embedded device, be it a simple SoC unit or a more complex, uC controlled engine with various attached peripherals. From first prototype to the market, the following development cycle is typically walked through:
C++ on microcontrollers 1 - introduction, and an output pin class
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.
I am lazy. I am also a programmer. Luckily, being a lazy...
Kind of Buggy! The state machine fantastic//
Over the years, I have had the opportunity to experience a lot of different kinds of coding mistakes. There were many that most programmers are familiar with, counting errors, indexing errors (the infamous 'off by one' bug), memory space sharing errors (A threading issue) as well as numerous others. I ran into one recently that I wound up using an old trick to help find.
My current project is a Pan/Tilt camera that was, upon occasion, not homing properly in one axis. The camera is a...
Get your microcontroller and PC to talk
(and get it done free ‘n’ easy!)
The Need
Specifications can dynamically change during the product development cycle. Bosses/clients suddenly approach us with additional requirements, which, however simple, can put us in a fix. One such requirement could be to have a PC based design interface for a standalone microcontroller project.
On many occasions, the required PC software has to just behave like a slave...
Favorite Tools - Look Up Tables
As we grow in our engineering careers, we must continually add new tools to our collective tool kits. One favorite tool in my toolkit will be obvious to many experienced embedded software engineers. I still remember learning this approach early in my career via code written by colleague David Starling. The tool in question:
Look up tablesLook up tables simplify code and improve firmware maintenance. What is a look up table? A look up table is often nothing more complex than a...
Debugging DSP code.
I am fascinated with neural network processing and have been playing with them since the 80's.
I am a frequent contributor to the Numenta forum. Numenta is the current project of Jeff Hawins, the guy that gave us the Palm Pilot. They are working with the HTM model. This is a system based on studies of the functions of the cortical column and has some very interesting properties: It processes sequential data streams and has very effective one shot learning. The data is arranged in Sparse...
[ C Programming Techniques: integer type optimization ]
I am currently working on a voltage controller running on a ATMEGA328P, ATMEL AVR 8 bits microcontroller. The controller logic is implemented in the main() routine and relies on a periodical timer whose frequency is fixed at application setup. Among other things, the timer ISR handler increments some per tick counters which are then used by the main routine to implement the voltage controller timing logic.By looking at the code, one noticed that I use the uint8_t type for counters instead of...
“Smarter” cars, unintended acceleration – and unintended consequences
In this article, I consider some recent press reports relating to embedded software in the automotive sector.
In The Times newspaper (London, 2015-10-16) the imminent arrival of Tesla cars that “use autopilot technology to park themselves and change lane without intervention from the driver” was noted.
By most definitions, the Tesla design incorporates what is sometimes called “Artificial Intelligence” (AI).Others might label it a “Smart” (or at least “Smarter”)...
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,
Software is free and can right any wrong
Software changes are so much easier than hardware modifications, so the temptation is always to take this approach to fixing bugs. This may not always be a good idea.
Short Circuit Execution vs. Unit Testing
The key to effective communication is to say what you mean and avoid ambiguity. Words and phrases with multiple meanings can confuse your audience and hinder communication. That’s why so many programmers prefer writing code to writing specifications: written human language introduces ambiguity and subsequently, confusion. Code only has one interpretation, period. This doesn’t, however, ensure that the right message is getting through. Code can, indeed, only do one thing,...
The Hardest Bug I Never Solved
I agreed to four hours.
Four hours to help hunt down and kill a bug. A terrible malicious bug that was eating away at this project, wreaking havoc upon the foundations of a critical feature, and draining time randomly from every one of eight firmware engineers on this project. Quite honestly, I can’t remember the last time it took more than an hour or two for me to locate, isolate, and fix a firmware bug. Surely I could help find and solve this issue within four...
Remember Y2K?
There was fear that the turn of the century at the end of 1999 would cause problems with many embedded systems. There is evidence that the same issue may occur in 2038.
Building Linux Kernel for Desktops
Linux Development has made an amazing process in last decade. Different Linux Distributions come with specific tools which greatly ease down the build process for Linux Kernel.
Here is a good introduction to these build tools and build procedure for different Linux Distributions:
Assembly language is best - except when it isn’t
A look at why writing in C often produces more efficient code than hand-written assembly language.
Building Linux Kernel for Desktops
Linux Development has made an amazing process in last decade. Different Linux Distributions come with specific tools which greatly ease down the build process for Linux Kernel.
Here is a good introduction to these build tools and build procedure for different Linux Distributions:
Zephyr: West Manifest For Application Development
In this blog post, I show a simpler way to create custom West manifest files. This technique eliminates the need to duplicate the complex West manifest from upstream Zephyr. I also show how we can use the West manifest to include out-of-tree board and SoC definitions, and include our own out-of-tree drivers.
Parlez vous Fortran?
A look at the variety of programming languages that are [or have been] used for embedded and some thoughts on the future possibilities.
Who needs source code?
Many developers feel that the supplying source code is essential for licensed software components. There are other perspectives, including the possibility of it being an actual disadvantage. Even the definition of source code has some vagueness.
Size matters - System success depends on initial design
Too many times during the initial phases of system design, opposing interests start fighting for valuable resources, sometimes without even knowing that they are. Case in point, a development project is starting up with a very simple product. For the user interface, Engineering wants to use a very simple character based LCD display and a couple of membrane switches, while Marketing wants a graphic display with a touch screen. The cost difference between these two items is...
Hello Android
Finally I could get Android Early SDK up and running on my Fedora Core-7 Machine.
The process was quite simple. However I had to struggle for a few days, because Fedora install the gnu version of Java and Android requires Java from Sun.
Here are the steps I had to follow:
(1) Install the eclipse IDE (if you do not have it already) with following command:
$> yum install eclipse-jdt eclipse-jdt-sdk (to be done as super user).
(2) now install the Android SDK and ADT plug-in for Eclipse...
C++ Assertion? Well Yes, But Actually No.
Assertions are a double-edged sword - on one side you enforce program correctness catching bugs close to their origin, on the other your application is subject to run-time error, like any interpreted language. This article explores what C++ can offer to get the advantages of assertions, without risking the crashes by moving contract checking at compile time.
Bringing up Baby - product development thoughts
Things have just started to get exciting. After months of defining, specifying and designing my latest product, I finally have semi-functional prototypes. After a few side steps during the building and bring-up process, power is applied and most of the low level functions have been verified. Soon, software will meet hardware and debugging can begin in earnest.
Before jumping in and really enjoying the fun (besides I'm now waiting for some new parts to arrive), I thought it would be nice to...
In the beginning, there was no code…
…and it was good.
Why is it that code starts out nice and deteriorates over time?
