User`s guide

5.d. Programming in Linux or Windows using AVRDUDE
AVRDUDE [http://savannah.nongnu.org/projects/avrdude/] is a free program for Windows and Linux that allows
you to program your Orangutan SVP’s on-board ATmega324PA or ATmega1284P microcontroller. You can
compile an Intel Hex (.hex) file using avr-gcc, and then program the hex file on to your Orangutan SVP using
AVRDUDE. AVRDUDE accomplishes this by sending serial commands to the Orangutan SVP’s built-in AVR
ISP programmer.
Linux users can get AVRDUDE by installing the avrdude package. You will also need to install these packages:
gcc-avr: the GNU C compiler, ported to the AVR architecture
avr-libc: a library giving access to special functions of the AVR
binutils-avr: tools for converting object code into hex files
These packages can be downloaded from their respective websites. Under Ubuntu Linux, these packages are
provided in the “Universe” repository and can be installed with apt-get.
Windows users can get AVRDUDE as part of the WinAVR [http://winavr.sourceforge.net/] package (which also
includes avr-gcc and other utilities you will need for programming AVRs). Note that most Windows users do not
use AVRDUDE because AVR Studio has its own built-in AVR ISP programming software which can be more
convenient.
AVRDUDE does not yet support the ATmega324PA. If you have an SVP-324, you should use the -p m324p
option to specify the ATmega324P and the -F to override the device signature check.
AVRDUDE has incorrect chip erase delay settings for the ATmega324P and ATmega1284P. This means that
when you try to erase the flash on your AVR (which is the first step whenever you are loading a new program), the
erase operation will take longer than AVRDUDE expects and AVRDUDE will interpret this as an error. This error
causes problems in the latest version of AVRDUDE (version 5.10 which is included with WinAVR-20100110)
because that version will not attempt to program flash if the erase step has failed.
There are three alternative workarounds to this problem:
Option 1 (recommended): In the AVRDUDE configuration file, avrdude.conf, change the chip erase delay for
the m1284p and m324p both to 55000. The file is located in C:\WinAVR-20100110\bin\ in Windows or /etc/ in
Linux.
Option 2: Use AVRDUDE version 5.6 (which is included in WinAVR-20090313). This version works fine for
the ATmega324p and ATmega1284p despite the incorrect chip erase delay in avrdude.conf, because it was
programmed to continue with the flash programming even if the chip erase operation timed out. (AVRDUDE
versions 5.7, 5.8, and 5.9 might work also but we have not tested them.)
Option 3: Whenever you want to program flash with AVRDUDE, first issue a command with the -e option to
erase the chip, and then issue a command to program the flash which uses the -D option so AVRDUDE does not
try to erase the chip again. The first command will time out and print an error message but nevertheless succeed
in erasing the chip.
We have several example projects that will let you get started compiling programs using avr-gcc and load them
on to the SVP using AVRDUDE. As a first step, we recommend you try to program your Orangutan with a simple
program that blinks the red user LED on pin PD1. Download the file below that corresponds to your particular
Orangutan SVP model:
Pololu Orangutan SVP User's Guide © 2001–2010 Pololu Corporation
5. Getting Started Page 22 of 41