4. Compiling avr-libc

Downloading the archive

Get the latest version from the avr-libc website. You should get version 1.6.6 or higher.

Configuring and compiling avr-libc

Run the following command:

tar xjf ~/Desktop/avr-libc-1.6.6.tar.bz2
cd avr-libc-1.6.6

Compiling avr-libc

Make sure that the latest avr-gcc is on your path as the default avr-gcc before you run these commands, or you will not get support for the the mega328. When running configure, you should see a line of output that says (make sure “checking if avr-gcc has support for atmega328p… yes”. If you don’t see this, double-check your avr-gcc installation.

./configure --host=avr --prefix=/usr/local
make
sudo make install

Next steps

You should now have an avr-libc installed that includes support for the mega328, so you will be able to compile programs for this microcontroller. To program a chip, you will probably want AVRDUDE. Section 5 contains instructions for compiling installing and installing the latest version.

New Products

0.100" (2.54 mm) Breakaway Male Header: 1×40-Pin, Straight, Red
150:1 Micro Metal Gearmotor HPCB
1000:1 Micro Metal Gearmotor HPCB
Hakko PN-2002 CHP 5-7/8 in. Needle Nose Pliers
RoboClaw 2x5A Motor Controller (V5)
0.100" (2.54 mm) Breakaway Male Header: 2×40-Pin, Right Angle
12mm Hex Wheel Adapter for 6mm Shaft (2-Pack)
Hakko T18-I Soldering Tip
0.100" (2.54 mm) Breakaway Male Header: 1×40-Pin, Straight, Blue
298:1 Micro Metal Gearmotor HPCB
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors