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,...
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...
How to make a heap profiler
We'll see how to make a heap profiler. Example code for this post makes up heapprof, a working 250-line heap profiler for programs using malloc/free.
It works out of the box on Linux (tested on "real" programs like gdb and python). The main point though is being easy to port and modify to suit your needs. The code, build and test scripts are at github.
Why roll your own heap profiler?
- It's easy! And fun, if you're that sort of person. What, not reasons enough? OK, how...
How to Include MathJax Equations in SVG With Less Than 100 Lines of JavaScript!
Today’s short and tangential note is an account of how I dug myself out of Documentation Despair. I’ve been working on some block diagrams. You know, this sort of thing, to describe feedback control systems:
And I had a problem. How do I draw diagrams like this?
I don’t have Visio and I don’t like Visio. I used to like Visio. But then it got Microsofted.
I can use MATLAB and Simulink, which are great for drawing block diagrams. Normally you use them to create a...
Using a RTLSDR dongle to validate NRF905 configuration
I am currently working on a system to monitor the garage door status from my flat. Both places are 7 floors apart, and I need to send the data wirelessly. I chose to operate on the 433MHz carrier, and I ordered 2 PTR8000 modules: http://www.electrodragon.com/w/NRF905_Transceiver_433MHz-Wireless_ModuleThe PTR8000 is based on the dual band sub 1GHz NRF905 chipset from NORDICSEMI: http://www.nordicsemi.com/eng/Products/Sub-1-GHz-RF/nRF905I...Energia - program a TI MSP430 using Arduino sketches
TI MSP430 LaunchpadI started tinkering with microcontroller a couple of years ago with an Arduino Uno. I had a little experience with C, so programming in the Arduino environment has been relatively easy and straightforward for me. My code is not necessarily elegant or efficient, but I can usually figure out how to make an Arduino do what I want it to do eventually. A lot of credit to the Arduino userbase, as it is very easy to figure most things out with a quick Google...
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...
Code Metrics - SLOC Count
Many programmers will start having flashbacks at the title of this article because it contains the words 'metrics' and 'SLOC'. Newer programmers are probably wondering what all of the fuss is about - most probably have no negative connotations with the term 'code metrics' and some may not even know what SLOC is. While there is much baggage associated with metrics and SLOC you shouldn't be afraid to gather fundamentally useful data such as SLOC count from your programming projects...
Adventures in Signal Processing with Python
Author’s note: This article was originally called Adventures in Signal Processing with Python (MATLAB? We don’t need no stinkin' MATLAB!) — the allusion to The Treasure of the Sierra Madre has been removed, in deference to being a good neighbor to The MathWorks. While I don’t make it a secret of my dislike of many aspects of MATLAB — which I mention later in this article — I do hope they can improve their software and reduce the price. Please note this...
10 Software Tools You Should Know
Unless you're designing small analog electronic circuits, it's pretty hard these days to get things done in embedded systems design without the help of computers. I thought I'd share a list of software tools that help me get my job done. Most of these are free or inexpensive. Most of them are also for working with software. If you never have to design, read, or edit any software, then you're one of a few people that won't benefit from reading this.
Disclaimer: the "best" software...
Embedded Toolbox: Windows GUI Prototyping Toolkit
In this installment of my "Embedded Toolbox" series, I would like to interest you in the free Windows GUI Toolkit called QWin for prototyping, developing and debugging embedded C or C++ code on Windows.
If you work on devices with non-trivial user interfaces consisting of LCDs (segmented or graphic), buttons, LEDs, etc., QWin could be just the tool for you. It has improved my productivity in such projects dramatically. I personally consider it a gem in my "Embedded...
Coding - Step 0: Setting Up a Development Environment
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
You can easily find a million articles out there discussing compiler nuances, weighing the pros and cons of various data structures or discussing the optimization of databases. Those sorts of articles are fascinating reads for advanced programmers but...
Embedded Toolbox: Source Code Whitespace Cleanup
In this installment of my "Embedded Toolbox" series, I would like to share with you the free source code cleanup utility called QClean for cleaning whitespace in your source files, header files, makefiles, linker scripts, etc.
You probably wonder why you might need such a utility? In fact, the common thinking is that compilers (C, C++, etc.) ignore whitespace anyway, so why bother? But, as a professional software developer you should not ignore whitespace, because it can cause all sorts...
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...
Continuous Integration for Embedded Systems
It is no secret that anyone who wants to streamline project management, reduce risk and improve the quality needs some form of "automation" in SW development processes. What is commonly used in most companies as a tool for such automation is called Continuous Integration (CI). It is a good practice for embedded systems as well even though it is much harder to use CI for embedded systems compared to pure software development because embedded systems mostly depend on...
A Wish for Things That Work
As the end of the year approaches, I become introspective. This year I am frustrated by bad user interfaces in software.
Actually, every year, throughout the year, I am frustrated by bad user interfaces in software. And yet here it is, the end of 2017, and things aren’t getting much better! Argh!
I wrote about this sort of thing a bit back in 2011 (“Complexity in Consumer Electronics Considered Harmful”) but I think it’s time to revisit the topic. So I’m...
Making a connection 1
In order for your system to control devices, you must be able to connect it to those devices.
Besides different sizes based on wire size, there are a few different styles of connectors that can be used. There are also weather-resistant terminals that can be used if needed.
Ring
(Parks, 16)
- used for circuits that you don’t want to become easily disconnected
- ground wire attached to a stud
Push-On
- can be used on relay terminals
(Parks, 18)
- could be...
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...
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,...
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...
Embedded Toolbox: Windows GUI Prototyping Toolkit
In this installment of my "Embedded Toolbox" series, I would like to interest you in the free Windows GUI Toolkit called QWin for prototyping, developing and debugging embedded C or C++ code on Windows.
If you work on devices with non-trivial user interfaces consisting of LCDs (segmented or graphic), buttons, LEDs, etc., QWin could be just the tool for you. It has improved my productivity in such projects dramatically. I personally consider it a gem in my "Embedded...
A Wish for Things That Work
As the end of the year approaches, I become introspective. This year I am frustrated by bad user interfaces in software.
Actually, every year, throughout the year, I am frustrated by bad user interfaces in software. And yet here it is, the end of 2017, and things aren’t getting much better! Argh!
I wrote about this sort of thing a bit back in 2011 (“Complexity in Consumer Electronics Considered Harmful”) but I think it’s time to revisit the topic. So I’m...
Vala applications on Embedded Linux: maybe a clever choice [part 1]
Vala is a sexy, open source, high level programming language that appeared in 2006, it counts with a modern typing system, is object oriented, compiled and statically typed, it has a almost identical syntax to C# and is maintained by GNOME. The language was created as a power abstraction of the GLib and GTK libraries, two considerably lightweight and powerful libraries written in C, and it is used in projects such as GNOME Clocks, Shotwell, GXml and Elementary OS.
namespace...Review: Modern Software Engineering
This is actually a review of 3 books by Dave Farley, because they really form a set:
- Modern Software Engineering: Doing What Works to Build Better Software Faster (just released for 2022, 224 pages)
- Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (co-authored with Jez Humble, 2011, 463 pages)
- Continuous Delivery Pipelines: How To Build Better Software Faster (2021,...
STM32 VS Code Extension Under The Hood
VS Code is becoming the "go to" environment for many developers. Increasingly, toolchain providers are publishing VS Code extensions and ST has recently followed suit. Additionally, CMake is significantly growing in popularity, with many projects adopting it for its ease of use and flexibility. This video shows how the STM32 VS Code extension works under the hood and how to get more out of it.
Specifically, we'll review the CMake files generated by the VS Code extension and how to modify...
Making a connection 1
In order for your system to control devices, you must be able to connect it to those devices.
Besides different sizes based on wire size, there are a few different styles of connectors that can be used. There are also weather-resistant terminals that can be used if needed.
Ring
(Parks, 16)
- used for circuits that you don’t want to become easily disconnected
- ground wire attached to a stud
Push-On
- can be used on relay terminals
(Parks, 18)
- could be...
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,...
Will work for tools!
I have always believed that tools are necessary to the creative process. This is something I learned early in life and it's a lesson that has stuck with me to this day.
When I was 7 years old, I made my first trip to see my Grandparents on my father's side of the family. What I remember most about the trip, besides the great food and the company of my Grandparents, was my Grandfather's shop. My Grandfather had built one of the most amazing shops that I have seen to this day in the...
Embedded Toolbox: Source Code Whitespace Cleanup
In this installment of my "Embedded Toolbox" series, I would like to share with you the free source code cleanup utility called QClean for cleaning whitespace in your source files, header files, makefiles, linker scripts, etc.
You probably wonder why you might need such a utility? In fact, the common thinking is that compilers (C, C++, etc.) ignore whitespace anyway, so why bother? But, as a professional software developer you should not ignore whitespace, because it can cause all sorts...
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...