Wednesday, 31 October 2012

Its a good time to be an embedded systems programmer.

In the words of TV's Harry Hill, "The Arduino revolutionized hobby electronics, but the raspberry Pi has shaken up the world of home computing, so which is best? There is only one way to find out...."
The Arduino has been around for years, it has excellent hard ware support, its easy to use and quite cheap. The PI on the other hand is about the same price and technically offers so much more but the hardware support is limited and programming it as a stand alone unit is quite a bit more fiddly. So which is the best for your next project?

System Specifications

PI (Model B Sep 2012) Arduino Uno Arduino Mega2560
CPU 700MHz ARM11 Atmega 328P ATmega2560
GPU Broadcom HD none none
Flash none 32Kb 256Kb
EEPROM none 1Kb 4Kb
SRAM 256MB 2Kb 8Kb
Digital IO Pins See GPIO 14 54
PWM See GPIO 6 14
Analog pins See GPIO 6 16
GPIO 21 0 0
SPI 1 1 1
USB 2 1 1
Video 1 HDMI none none
Audio 1 HDMI stereo via shield via shield
Onboard storage SD Card slot via shield via shield
Other Ethernet  via shield via shield
Host Not required PC via USB PC via USB
Size 86mmx54mm 67mm x 54mm 102mm x 54mm
Price £25 £20 £35

Raspberry PI (Model B Sep 2012)

At first glance this is the clear winner, its faster, has far more flexible I/O and you don't need external PC which is great, but i practice there are draw backs.
The hardware support is still poor, and still requires you to get the soldering iron out ion most cases, bu I am sure that will change. I even have a PI board in the pipeline myself.
What is more of an issue to me though is the software. This machine was designed to use the Python Interpreter (That's why its called PI) and if that does what you want then you are quids in.
Programming the directly pins, however, is far more complicated, it is doable, but you need to concentrate. If you want to boot the system without Linux then you either have to keep swapping the SD card, which I makes me nervous as I find it a bit too fragile, or fiddle about with partitions and Grub. I don't know how to do that, it looks scary.
There are plenty of forums about to help you with these issues, but so far I have not found one at my level, for me the level is either too high or too low, but again I am sure that will come soon.
The final point is that if you develop the software on the PI itself you will be using a 700MHz machine, when you may well have a faster PC, which is frustrating unless you go for the SD-Card swap between two systems option.
I haven't found it yet, but what I really want is a boot-loader that sits in an SD card and allows me to boot from an image on the network. That really would be the best of both words and I am sure it won't be long.


Its slower, smaller and needs a host, so why would you want one? Because you can develop your project so much faster.
It seemed that a few months ago Arduino hardware shields were coming out faster than Apple could start law suits, and still they are coming. I can't think of a micro controller project that I have been involved in recently that can't be done with a shield or two.
The forum support is some of the best I have seen, somebody out there will have had your problem before and will be able to tell you haw to fix it.
Development could not be easier, plug your hardware together, connect it to a PC via a USB cable and you are away, it really is that simple. Its one of those things that just works, and that is a rare thing nowadays.

So which one?

Today, if you are new to embedded programming and want a project that does not need to be particularly fast or needs to connect to the outside world, then go for an Arduino, it won't let you down.
If on the other hand you need speed go for the PI but be prepared for a longer design cycle.
Next year it will be different, hardware support for the PI will have caught up and you can have the best of both systems. Mind you there is a chance of  a new faster Arduino just round the corner.
Its a good time to be an embedded systems programmer.

No comments:

Post a Comment