Tips and Tricks – 5 Tips for Developing Real-time C++ Applications

Object-oriented programming has become a very popular and critical programming methodology for developing applications. While traditional embedded software development has mostly been developed using the procedural language C, C++ and other object oriented languages are slowly started to gain traction in real-time systems. In order to ensure that a C++ based applications doesn’t bloat code … Continue reading Tips and Tricks – 5 Tips for Developing Real-time C++ Applications

Ternary Operator versus the if/else statement …

When I’m teaching “C Programming for Embedded Systems”, I’m often asked whether the ternary operator should be used or an if/else statement. Hidden behind the question is really the need to know whether the ternary operator is more efficient than if/else. One might think that compilers today would generate identical code. Let’s take a quick … Continue reading Ternary Operator versus the if/else statement …

Embedded Basics – 10 Qualities of Portable Firmware

Portable Firmware …. is modular is loosely coupled has high cohesion is ANSI-C compliant has a clean interface has a Hardware Abstraction Layer (HAL) is readable and maintainable is simple uses encapsulation and abstract data types is well documented How well do the characteristics of your software match the qualities of portable firmware?

Tips and Tricks – Learning to write portable code using ANSI-C

Embedded software engineers should be interested in writing production software that is portable and reusable.  Societal demands for refreshing embedded systems every 12 – 18 months are quite demanding and starting from scratch for many systems is just not realistic.  As developers we really should be interested in working on the cutting edge and not … Continue reading Tips and Tricks – Learning to write portable code using ANSI-C

Embedded Basics – The difference of ‘ ‘ and ” “

Embedded software developers commonly interface with low level sensors and have a good understanding of how to work with signed and unsigned types but when it comes to strings and character types, many developers are easily confused.  Take for example using ‘v’ and “v” in a definition or as a function parameter.  Many developers would … Continue reading Embedded Basics – The difference of ‘ ‘ and ” “

Tools – Open Source Circular Buffers

Circular buffers are a critical component to have in the embedded software engineers’ toolbox. Over the years there have been many different implementations and examples of circular buffers that have littered the internet.  I’ve grown particularly fond of the open source CBUF.h module that can be found at https://github.com/barraq/BRBrain/blob/master/firmware/CBUF.h The CBUF.h module implements a circular buffer using … Continue reading Tools – Open Source Circular Buffers