Imbedded Software Development

A while back I decided to pick a processor and development environment to use for making a number of sensors I want to build. Each sensor requires requires some processing to read or digitize the sensor output and either log the data or ship it off to a database.

I am not ready to layout and build my own processor boards especially ones with fine pitch surface mounted processor chips. There are a number of little boards available with various processor chips and its support hardware. The most famous of these is probably the Arduino  but it is a bit wimpy for some of my projects and I really don’t need the simplified programming language associated with the Arduino. The Arduino uses a AVR processor made by Atmel. The ARM (Advanced RISC Machine)  architecture is one of the most popular today. If you have a smart phone it probably has an ARM processor. There are many chip makers selling chips that use the ARM architecture so there is a lot of tools, sample code and expertise available for it. By the way if you ever want to start a heated discussion among a bunch of engineers just start talking about choosing a processor for a project.  I had already written some code for the NXP (formerly Phillips) LPC2148 ARM7 chip so I chose that for my processor. Olimex ( a company in Bulgaria) makes a nice little development board for the LPC2148. This board has most of the processor pins brought out on two square pin connector. It also has a USB connector and a boundary scan connector.  The USB connector allows to board to be powered from a PC USB connector and communicate with the PC via the USB. The boundary scan (JTAG) connector allows the chip to be programmed and the software debugged. I use an inexpensive USB to JTAG converter (also made by Olimex) to connect the boundary scan port the PC.

There are a number of software development options for the ARM processors.  The GCC (GNU Compiler Collection) has been ported to  the ARM processor. For the first work I did with the LPC2148 I used the GCC from the command line. This works OK for writing the software and loading it in the processor but is a bit lacking when it comes to debugging. There is a command line debugger but when using it you have to keep a lot of information in your head.

An IDE (Integrated Development Environment) really makes software development easier. This brings together in one application, file management, editing files, compiling, loading the software into the target processor and debugging.

Eclipse is a free software framework written in Java that can be use for building a IDE for software development. All the separate tools like compilers, linkers and debuggers are brought together with Eclipse. There is an ARM IDE available using Eclipse. Being free I expected to have some work to do getting it running and I was right. It took quite a few hours of tinkering to get things running and then I got stuck trying to get the debugger part working. In frustration I had a look at the commercial IDEs for the ARM processors. Rowley Associates has a ARM IDE (CrossStudio) the offer with a 30 day free trial and a $150 not for profit license. So I downloaded the free trial. After a small amount of fiddling around I got everything working except again the debugger.  It took awhile but I finally figured out that the default settings for the JTAG port clock were too high and the data was being corrupted. As an afterthought that might also be the problem with the Eclipse debugger but I liked the CrossStudio interface enough better that I purchased the not for profit version.

I want to build up the basic software to support a number of different sensor projects. So far I have gotten the communications with the PC via the USB working and I am now working on getting the real time clock running so that it can be used to time stamp data and provide a 1 second interrupt to set the pace for measurements.

Software Development Platform

Software Development Platform

Above is a picture of the hardware used for developing the sensor control software. The ribbon cable connects the JTAG to USB adapter to the red processor card. The card is plugged into a couple of pieces of anyboard. On the anyboard I have mounted a coin cell to keep the real time clock running and a FGM-3H flux gate magnetometer.  The magnetometer is the first sensor that I am writing software to support. The FGM-3H outputs a square wave whose period varies with the magnetic field. I will use the counter/timers in the processor to measure the period of the signal and compute the strength of the magnetic field.

Advertisements
This entry was posted in Amateur Science, Imbedded Software, Software and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s