Linux AVR environment

This page will guide you through the process of a C compiler installation.

To have a C compiler running, you need the following programs:

  • binutils-2.16.tar.bz2
  • gcc-core-3.4.5.tar.bz2
  • avr-libc-1.4.3.tar.bz2

    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.

    GNU binutils

    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

    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
    

    AVR C-library

    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.

    UISP

    $ tar jxvf uisp-20050207.tar.bz2.tar
    $ cd uisp-20050207
    $ ./configure --prefix=/usr/local/avr
    $ make
    
    # make install
    
    

    Building the 5 minutes programmer

    You need a DB25M connector, and a couple of resistors. Wire them up according to the following table.

    SPI/AVR signalresistorPin on parallel port
    Reset--Init (16)
    MOSI470 OhmD0 (2)
    MISO220 OhmBusy (11)
    SCK470 OhmStrobe (1)
    GND--GND (18)

    The cable should not be longer than 70cm. For pin number of AVR signals, refer to the datasheet of the AVR MCU used.



    Happy soldering!
    by Levente
    E-mail: lekovacs_AT_interware_DOT_hu
    Updated on: 20.07.2006