This page will guide you through the process of a C compiler installation.
To have a C compiler running, you need the following programs:
All listed programs are available from the CD which comes with the usb500 programmer, or can be downloaded from the Internet.
Fisrt step, is to create a directory where programs are installed. This is essential, since you want to have a separeta place for MCU tools, and other local porgrams.
# mkdir /usr/local/avr
# mkdir /usr/local/avr/bin
# export PATH=/usr/local/avr/bin:${PATH}
If you want to add the PATH variable permanently, you should add the last line to your ~/.bashrc file.
Binutils is a bunch of programs which needed to make objects.
Run the following commands to build and install the binutils:
$ tar -jxvf binutils-2.16.tar.bz2 $ cd binutils-2.16/ $ mkdir obj-avr $ cd obj-avr $ ../configure --target=avr --prefix=/usr/local/avr --disable-nls $ make # make install
Add the line /usr/local/avr/lib to the file /etc/ld.so.conf and run the command /sbin/ldconfig to rebuild the linker cache.
avr-gcc is the C compiler.
Run the following command to build and install it:
$ tar -jxvf gcc-core-3.4.5.tar.bz2 $ cd gcc-3.4.5 $ mkdir obj-avr $ cd obj-avr $ ../configure --target=avr --prefix=/usr/local/avr --disable-nls --enable-language=c $ make # make install
Run the following command to build and install it:
$ tar -jxvf avr-libc-1.4.3.tar.bz2 $ cd avr-libc-1.4.3 $ ./configure --prefix=/usr/local/avr/ --build=`./config.guess` --host=avr $ make # make install
After this last step is compleeted, you have the environment installed! Next step is to have a 5 minutes programmer! First, install uisp, which is a programmer software.
$ tar jxvf uisp-20050207.tar.bz2.tar $ cd uisp-20050207 $ ./configure --prefix=/usr/local/avr $ make # make install
You need a DB25M connector, and a couple of resistors. Wire them up according to the following table.
| SPI/AVR signal | resistor | Pin on parallel port |
|---|---|---|
| Reset | -- | Init (16) |
| MOSI | 470 Ohm | D0 (2) |
| MISO | 220 Ohm | Busy (11) |
| SCK | 470 Ohm | Strobe (1) |
| GND | -- | GND (18) |