Thursday, December 20, 2007

Arduino controller board on a Mac

Having played with PIC microprocessors for many years and had good times with the 16f628, it's been hard for me to jettison that knowledge and move to another chip even though it looks much better.

The Atmel AVR chips are low cost but designed for running code generated by "normal" compilers like good old gcc, rather than the PIC chips that need hacked c or basic compilers that know how to use that banked memory.

I use a Mac and always feel like a second class citizen when it comes to software and hardware for embedded systems. Make magazine featured a little board called Arduino that carries an ATMega168 chip.

It's the fastest "greet postie" to "das blinken lights" joy I've ever experienced.

Here's my list of observations so far:
  • The Arduino is open source so you can make your own
  • I bought the Diecimila for AU$37.50 with it's USB connection
  • Chip programmed with a boot loader so it is re-programmed via serial (over USB)
    • The boot loader is freely available so you can burn it into your own chips
  • There is an IDE for Windows, Linux and the Mac that works really well
  • The IDE for Mac comes with the driver you need for the USB interface
  • IDE has gcc-avr built in
    • It links against AVR Libc
    • Language is most of c
    • Syntax colouring
    • Seems actually to use a c++ compiler
    • Has some useful built in functions for doing i/o
    • Comes with libraries for things like printing to serial (and you can do serial comms to the board in the IDE so that's how you debug)
    • There are third party libraries available for stuff like digital servo control
    • Libraries are installed by simply dragging them in to a folder
  • The board can be powered by USB or a separate supply 6-12V
  • When you compile your source the output, including the intel hex file is dropped into a folder with the source so you can even burn it to another chip with your own programmer
What held me back from trying the Atmel AVR chips is the fact that there's so many of them! Where to start? Well, it seems like the ATMega8 is a good start. All the tools are free and if you have a PC with a parallel port you can make a really simple programmer.

Incidentally, I ordered my Arduino from Little Bird Electronics here in NSW on 9-December and it only turned up today 20-December. I think that's a little slow.

No comments: