http://tuxgraphics.org/electronics
Building your own avr-gcc environment with atmega328p capabilities, LinuxAbstract:
Atmel announced the atmega328p chip a while ago but it is only
now that one can really order such chips. The atmega328p is the
big brother of atmega88 and atmega168. It is fully pin
compatible and provides 2Kb ram and 32Kb flash. Especially the
larger amount of ram makes it very attractive. |
binutils-2.19 gcc-4.3.2 avr-libc-1.6.4 avrdude-5.5I have verified that those packages are working together. The final installation will give you a compiler that supports the atmega328p chip. Everything will be installed under /usr/local/avr You should add the directory /usr/local/avr/bin to your Unix search PATH environment variable after completion of the installation.
You should switch now to bash unless you use bash already as your default shell. Type: bash
Download: ftp://ftp.gnu.org/gnu/binutils tar jxvf binutils-2.19.tar.bz2 cd binutils-2.19 mkdir obj-avr cd obj-avr CC=gcc export CC ../configure --target=avr --prefix=/usr/local/avr --disable-nls --enable-install-libbfd make make install cd ../..
Download: ftp://ftp.gnu.org/gnu/gcc/gcc-4.3.2 tar jxvf gcc-core-4.2.3.tar.bz2 cd gcc-4.3.2 mkdir obj-avr cd obj-avr ../configure --target=avr --prefix=/usr/local/avr --disable-nls --enable-languages=c --disable-libssp make make install Note: The above step requires a recent version of MPFR (http://www.mpfr.org/) and gmp (ftp://ftp.gnu.org/gnu/gmp): GMP 4.1+ and MPFR 2.3.0+. Use the packages from your distribution if possible. Under Ubuntu those packages are called libgmp3-dev and libmpfr-dev. Gentoo calls them dev-libs/gmp and dev-libs/mpfr. cd ../..
Download: http://savannah.nongnu.org/projects/avr-libc/ tar jxvf avr-libc-1.6.4.tar.bz2 cd avr-libc-1.6.4 PREFIX=/usr/local/avr export PREFIX CC=avr-gcc export CC PATH=/usr/local/avr/bin:${PATH} export PATH ./configure --build=`./config.guess` --host=avr --prefix=/usr/local/avr now check if configure printed the line: checking if avr-gcc has support for atmega328p... yes just to be sure that you will get atmega328p support make make install cd ..
Download: http://savannah.nongnu.org/projects/avrdude tar zxvf avrdude-5.5.tar.gz cd avrdude-5.5/ CC=gcc export CC ./configure --prefix=/usr/local/avr make make installNow the installation is complete. It's a good idea to add some version information file so you know later on what you installed. Go back one level such that you can see the downloaded packages and their unpacked directories and then type ls:
cd .. ls > /usr/local/avr/version-info.txt
default_serial = "/dev/ttyUSB0"; programmer id = "avrusb500"; desc = "tuxgraphics avrusb500"; type = stk500v2; ;
change PB1 to PORTB1 change PB3 to PORTB3 change PB5 to PORTB5 change PD7 to PORTD7We will update the code on our website over time too but it might take a while.
#!/bin/sh -x avrdude -p m168 -P /dev/tty.usbserial* -c stk500v2 -v -qPlease edit this script as needed and insert the correct usbserial name. Avrdude compiles without any problems on the Mac.
REM *** you need to edit this file and adapt it to your WinAVR REM *** installation. E.g replace c:\avrgcc by c:\WinAVR-20090313 @echo -------- batch file for windows to call make -------- set AVR=c:\avrgcc set CC=avr-gcc set PATH=c:\avrgcc\bin;c:\avrgcc\utils\bin make -f Makefile @echo -------- end -------- pause
2012-03-08, generated by tuxgrparser version 2.57