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

Design News CEC – Baremetal C Programming for Embedded Systems

Course Overview: The C programming language is one of the most widely used and successful computer programming languages of all time. When developing firmware for an embedded system without an operating system there are a number of C concepts that can easily trip up a developer. This course will review key concepts for developing an … Continue reading Design News CEC – Baremetal C Programming for Embedded Systems