COVID-19 impact: We are still operating and shipping all orders! We are operating with a reduced staff, so for critical requirements, including fighting COVID-19, please contact us so we can identify priorities. Click here for more info.

3.4. Programming with AVRDUDE

After you have compiled a HEX file, you can load it onto your AVR using Atmel Studio as described in Section 3.3 or by using a separate command-line utility named AVRDUDE. This utility is free and included in the WinAVR package.

First you need to locate the HEX file. If you compiled it using Atmel Studio, it should have the extension “.hex” and be in your Atmel Studio project folder, in a subfolder named Debug or Release. Open a Command Prompt and navigate to that folder. Then to program your AVR, you would type something similar to this:

avrdude -p m328p -P COM6 -c avrispv2 -U flash:w:test.hex 
  • The argument following the -p is the part number of the AVR. For an Orangutan or 3pi Robot, the part number should be m328p, m1284p, m324p, m644p, m168, or m48.
  • The argument following the -P is the port name. You can determine your device’s programming port name by looking in the “Ports (COM & LPT)” list of the Device Manager.
  • The argument following the -c is the programmer protocol and should be avrispv2.
  • The -U option is used for writing, reading, or verifying flash, EEPROM, fuses, or lock bits. In this example we are using -U to write test.hex to flash.

Please see the AVRDUDE documentation for more detailed information.

Note for Orangutan SVP and X2 users: AVRDUDE has incorrect chip erase delay settings for the ATmega324P, ATmega644P, ATmega1284P. This means that when you try to program, the erase operation will take longer than AVRDUDE expects and AVRDUDE will interpret this as an error. The workaround is to find the AVRDUDE configuration file, avrdude.conf, and increase the chip erase delay for the m324p/m644p/m1284p to 55000. The file is located in C:\WinAVR-20100110\bin by default in Windows.

Related Products

Orangutan LV-168 Robot Controller
Pololu USB AVR Programmer v2
Baby Orangutan B-328 Robot Controller
Orangutan SVP-324 Robot Controller (partial kit)
Orangutan SV-328 + USB Programmer Combo
Orangutan LV-168 + USB Programmer Combo
Baby Orangutan B-328 + USB AVR Programmer Combo
Baby Orangutan B-48 + USB Programmer Combo
Pololu USB AVR Programmer
Orangutan SV-328 Robot Controller
Baby Orangutan B-48 Robot Controller
Pololu 3pi Robot
Pololu USB AVR Programmer v2.1
Orangutan SVP-324 Robot Controller (assembled)
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors