Thursday, 9 February 2012

PIC vs Arduino

Well, there's a contentious title!

After many years programming microprocessors like the Z80, the 6502 and the 68K back in the 80's, I first met the microcontroller in the form of the PIC16C84 in the mid 90's. I built a homemade parallel port programmer and away I went. Since then I've used various PIC's in personal and commercial projects, initially in assembler, and later in C. It's the usual story of 'which microcontroller should I use?', and well, there's a bunch of PIC's in the box, the official programmer, home made prototyping boards, the IDE is setup and working and I know my way around them. So, as long as there is a PIC variant that has the requisite features, it's the easy (read 'lazy') choice. However, a couple of years ago, I had a couple of ideas for projects using USB, so I got some PIC's with USB support and built some prototypes. These never went anywhere, there seemed to be loads of problems, the USB framework seemed to be in a state of flux, so the examples were based on a different version to the current one, the latest version didn't work with the IDE, there were incompatibilities with the core framework, and when it did compile, it didn't work! I spent ages with various libraries and versions of MPLAB and a couple of different types of PIC and got nowhere, so they were put on the shelf.
Recently, I've been evaluating the Arduino as a way for beginners to get into hardware and software, and it seems to be really well thought out. Someone who doesn't know electronics or programming can pick one of these up for £20-£30 and have an LED flashing in a few minutes. It's then quite easy to follow some simple examples and add more complex hardware and software, and they seem to have the libraries sorted out so thinks like driving an LCD or even a LAN connection are taken care of with a simple code interface.
After only a couple of minutes of plugging at the breadboard, an HD44780 based LCD display is up and running, not a bad start. I can see a couple of failed PIC projects being resurrected on the Arduino - watch this space!