Saturday, September 3, 2016

Becoming an Embedded Programmer

Some people want to be embedded software engineers. Not everyone is cut out for doing web pages, an making the page a little more blue (it happened to me when I was confused, early 2000's). No, some people like to get data in the raw, and make it something that people will use.

I've been hiring for the company I work for, doing interviews for the last year. It has been tough sledding trying to find young people out of school, and people with years of experience to understand what embedded systems can be. Some think, raw hardware, no operating system. Some others think once you have the OS, why not make it all web based. Others don't want to do Linux, and think the system ought to be Windows based.

The company I work for writes software for a Linux based embedded system. Most of the projects are reading data from some hardware device, quickly transforming it, and maybe jamming it back into another hardware device, or writing he values to a hard disk, or NVRAM. Data synchronization is paramount, it doesn't work to get something a few seconds from now mixed up with data that is happening now. Sometimes we need to keep two input sources in sync (IE audio and video), so two threads need to know when to start and finish.

Getting a Rasberry Pi or something similar (IE Orange Pi) is a great start. For the cost of a couple cups of coffee (or only one, depending on where you buy things) you can get an embedded system. The Pi systems are Linux based, and allow writing code right on the device. The Pi's also allow developing on desktop systems, cross compiling for the hardware.

One thing the Pi's all seem to have is rich AV capabilities. All seem to have HDMI out, along with audio in and out. Many folks use the Pi systems as desktop systems, all on their own. Most of a Linux system is available, including X windows, and desktop type programs (word processors, spreadsheets and browsers).

As a developer, play with one of these Pi systems, and use it as a data collector system. Go ahead, connect something to the GPIO pins. It could be an LM34 chip measure the temperature of the garage or something. Fire up a web server an built some Perl or Python to display he last 36 hours of temperature. Tada, you have become an embedded programmer.

Examples... Well give me a couple days. Do you want to collect the stuff you need? There is a service called Hackerboxes that will send you random projects every month to build. For September 2016, they have an OrangePi kit. I am downloading a desktop image while typing this in. Compressed the desktop is 540MB.

Keeping thing in sync, use mutexes and semaphores. If you don't know what they are, read on the web. They are a great tool to allow multiple threads to stay in sync, and keep the data correct and useful. If you code in Java, read about wait and notify Java.lang.object. If you use C or Perl look at posix threads.

It is cheap, and you can be an embedded programmer in no time.