Setting up Xcode to Compile & Upload to an Arduino ATMega328 (Duemilanove)

This morning Joshua Noble tweeted a link to this excellent post that details how to setup your Xcode environment to compile & upload to an older Arduino168 like a Diecimila. This is awesome for anyone who would rather code in a more feature rich environment than the Processing / Arduino IDE such as myself. However, while trying to get this working with my Duemilanove, I ran into a few problems compiling and uploading code to the board.

After sifting through the comments and making some tweaks to the Makefile I finally got this working and so without further ado, here are the steps to get Xcode talking to your ATMega328 (Duemilanove).

1. Install Xcode obviously if you haven’t already.
2. Download & Install the Arduino IDE as you still need the core Arduino libraries to compile against.
3. Download & Install the AVR Programming Tools. The most recent version worked fine for me.

CrossPack-AVR-20100115.dmg