Matt Wright, July 4, 2005
This document explains how to install Mac OS/X versions of avr-gcc, avr-libc, avrdude, Pascal Stang's avrlib, and the other tools necessary to write programs and load (aka "flash") them onto AVR microprocessors. This is intended for people who have used these tools on the Planet CCRMA Linux environment (e.g., in the context of CCRMA's 250a class or Physical Interaction Design for Music summer workshop), but it may also be useful to others.
At the end of the day you need to have about 58 Mb of compiler tools, libraries, and documentation in /usr/local/avr, and about another 2.4 Mb of Pascal Stang's avrlib ("AVR Library") in ~/avrlib. If you're lucky you can just download my versions, unpack them, put them in the right places, and be done with it.
sudo mv gnumake /usr/bin
sudo ln -s /usr/bin/gnumake /usr/bin/make
sudo mv avr /usr/local
set path=($path /usr/local/avr/bin)
setenv AVR /usr/local/avr
setenv AVRLIB ~/avrlib
setenv UISP_PORT /dev/tty.your-serial-device-here
If you use the bash shell, add these six lines to the .bashrc file in your home directory:
PATH=$PATH:/usr/local/avr/bin
export PATH
AVR=/usr/local/avr
export AVR
AVRLIB=~/avrlib
export AVRLIB
It's a good idea to put the AVR tools in /usr/local/avr because they're updated frequently, so it's nice to have them all in a single location. Plus, that makes it easier to install my versions from the Stuffit archives above.
It's a convention at CCRMA that avrlib lives in each user's home directory, so if you put avrlib in your OSX home directory, you have less to change when you copy over AVR projects from your CCRMA Linux account.
If you're even more brave, you can go to
http://www.nongnu.org/avr-libc/user-manual/install_tools.html and
follow the links to the latest versions of binutils, gcc,
avr-libc, and uisp. The versions listed above (namely, binutils-2.17,
gcc-4.1.1, avr-libc-1.4.4, and avrdude 5.1) were the most recent as of
Sept. 2006 when I downloaded and compiled everything, and they seem to
be mutually-compatible as far as I can tell. But by all means, if you
like to be on the bleeding edge and enjoy running configure scripts and
building software, go got it. Please let us know [matt at CCRMA;
gurevich at CCRMA] of your experiences with this.
Once you install the driver and plug in the AVRmini, a new Unix tty device will appear. On my computer it shows up as /dev/tty.something
It's easy to look for these files with ls from a Terminal window:
ls /dev/tty.*
You'll need to add the name of this ersatz serial port to the makefiles in your projects, for example, like this:
AVRDUDE_PORT=/dev/tty.something
or, add this line to your .cshrc file along with the other setenv lines above.
CCRMA's example AVR programs rely on the following to compile and load:
To get the AVRmini to talk to Pd on your OSX machine via OSC over Serial over USB (!), see Jesse Fox's excellent instructions:
http://ccrma.stanford.edu/~jrobfox/OSC_PD_OSX.html
Somebody should replicate the functionality of the dumpOSCSerial object for Max/MSP.