Embedded Systems: ARM or Arduino?



As the ranks of embedded system developers swell with the hobbyists and amateurs, the question of simplicity versus precision is coming up more regularly. Should we learn to use Arduino? Should we learn to use ARM? My simple answer would be learn both but as with most technological dilemmas the answer is never that simple.

In my education I have been forced to use an ARM based micro-controller. Being tossed into a complex development environment was really great for me as a developer. I have always been enchanted by embedded systems and this experience allowed me to sink my teeth into a design problem. Designing a hardware and software solution in one clean package is satisfying.

Before beginning this comparison I would like to say that I am not looking at advanced tools for ARM like NXP's Processor Expert or other tools that simplify the design process. We will be comparing unassisted development of Arduino vs ARM.


Simplicity


Arduino UNO, one of the more commonly available boards.

Arduino definitely wins this category in my mind. Being able to pick up a micro-controller and have a simple system working in a matter of minutes is rather appealing. Users don't require such a large overhead of knowledge to understand what is happening at the lower levels. Coding for the Arduino is so simple that even children, young adults and new programmers can learn it in a matter or minutes. 

If a user had spent more time using ARM based systems or had very good libraries then it would be likely that they could instantiate a similar system just as fast but the user has to know how to set that up while Arduino does it for you. 

The Arduino IDE is a pretty lame IDE and lacks many features that I feel it should have but sometimes having a point and shoot development process is what is really needed. 


Precision/Control

FRDM-K64F: First ARM board I used.

As the complexity of the system increases being able to control every aspect of the system become paramount. I would consider ARM and Arduino very reliable. This then becomes a question of what allows for the lowest level control. 

Arduino lacks low level control that ARM allows users without much searching. Being able to configure the registers for the ADCs and DACs yourself allows you to only get what you need. Being able to adjust the read time of ADCs, the impedance of the ADC pins, built in averaging and many other features allows developers to get exactly what they need. I have found Arduino lacks this low level control. I often find myself trying to compensate in software for things like ADC averaging which eats up space. All that the controller needed was a control register getting another bit written high but instead it is now a new block of code. 

Understanding what is happening at a low level also allows users to debug more accurately which leads us to our next section. 


Debugging

(Arduino Mega /w Custom Shield) Writing today to avoid debugging this monstrosity. 

Nobody likes debugging. You've spent days, weeks, months writing code. The smallest tweak causes everything to fail horrendously. What do you do? Beat your head against a wall? Quit? No, we have to mop up our tears and debug the monstrosity that lies before you.

In my experience with debugging Arduino I have wanted to tear my hair out. As mentioned early, Arduino fails to allow low level access into the system. This is frustrating when trying to debug. Arduino IDE lacks the feature of being able to advance step by step through your code and look at variable values. I find myself adding in never ending "Serial.println(variable_name);" to try and see where things have gone awry. This is tedious and takes so long to try and figure out what is causing the problem.

I am not a fan of Eclipse IDE. To be honest I hated it until using the NXP modified version for their micro-controllers. Debugging was almost as easy as writing the code. Sure you still have to figure out EXACTLY what is happening but it allows users to ease the pain of debugging. 

One of my favourite features of the ARM based systems I have used so far is the ability to step through the code line by line and see what is happening on a register level. Many problems seem to arise from a small error in a control register and this can be checked as easily as hovering your mouse over the register name in the code while debugging (at least in Kinetis).

The improved debugging is a feature that definitely has me lean more towards wanting medium to large projects done on ARM boards. 


Overview

It can be difficult to decide which system suits your needs best. For smaller applications I would almost always choose Arduino since it can be rapidly developed and troubleshot for smaller systems. As the complexity of the system increases I tend to lean towards ARM based micro-controllers due to better debugging tools and better control.

From an educational perspective, I definitely think that Arduino is a good place to start. Once developers start to become comfortable with Arduino they should migrate towards ARM based systems so they can have better control. 

What are your preferences?  












Comments

Popular posts from this blog

Ongoing Linux Cheatsheet

Hindsight 20/20: University Productivity Tips and Tricks

Baremetal Drivers: RFM69HCW and FRDM-K22F