Moving from PonyProg to AvrDude AVR programmer without pain

Probably PonyProg is one of the most popular programming software among AVR microcontroller developers. And this is OK as it is good software with a very intuitive interface and supports many chips like Atmel AVR, Microchip PIC micro, I2C, Microwire, SPI EEPROM. It works well with an AVR ISP adapter, which is easy to build. This is an ideal tool for low budget projects.

The only thing that I don like with it, that I need to do additional steps to program the AVR chip:

  • Compile project with WinAVR;
  • Open hex file with PonyProg;
  • Programm the chip;

Then I thought- what if I could build and program the AVR chip with a single button press. This is where AVRDUDE comes in.

AVRDUDE is a FreeBSD Unix program for programming Atmel’s AVR CPUs. It can program the Flash and EEPROM and were supported by the serial programming protocol; it can program fuse and lock bits. AVRDUDE also supplies a direct instruction mode allowing one to issue any programming instruction to the AVR chip regardless of whether AVRDUDE implements that specific chip’s specific feature. AVRDUDE can be used as a command-line tool (convenient to use with makefiles) or interactively via terminal. It can program the microcontroller’s flash, EEPROM, fuse bits, modify individual bits, explore memory contents, etc. For additional information, refer to the AVRDUDE manual.

Let’s try to set up AVRDUDE to work in a Windows environment. As I am using Windows XP, I need to set up port drivers to enable AVRDUDE direct access to ports. For this, an AVRDUDE package is a handy tool included: install_giveio.bat, which copies needed driver files to the windows directory. For this, just run:

C:\WinAVR\bin>install_giveio.bat
Copying the driver to the windows directory
target file: C:\WINDOWS\giveio.sys
1 file(s) copied.
Remove a running service if needed...
Installing Windows NT/2k/XP driver: giveio
installing giveio from C:\WINDOWS\giveio.sys... ok.
starting giveio... ok.
set start type of giveio to auto... ok.
Success

After this installation you can check driver status by writing command:

C:\WinAVR\bin>status_giveio.bat
status of giveio:
Type: [0x01] Kernel driver.
Start Type: [0x02] Automatic
Error Control: [0x01] NORMAL: Display a message box.
Binary path: \??\C:\WINDOWS\giveio.sys
Load order grp:
Dependencies:
Start Name:
ok.

When port drivers are set up, we can do a couple of fun tests with your AVR microcontroller via the same AVR ISP cable that we use with PonyProg. No, any changes are needed as AVRDUDE supports this programmer.

Just open a console window and write command line:

C:\WinAVR\bi>avrdude -p m8 -c pony-stk200 -e -U flash:w:demo.hex

….

This command-line programs your Atmega8 flash memory with demo.hex contents using simple AVR ISP adapter.

Well, let’s make this happen when building the WinAVR project in Programmers Notepad editor. For this, we need to prepare a Makefile. The easiest way to do this is to use the Mfile utility, where you can select programmer type and port:

You should have the following results in the makefile:

That’s it. Now is a fun part. If you have your project ready to run, select the Program command from the Tools menu in PN:

This command builds your project and automatically sends a hex file to the AVR microcontroller. In the future, there will be more real-world examples of how this is working. Don’t afraid to read the documentation – all is written there 😉

Good luck.

3 Comments:

  1. Hi,
    Would you please email the AVRDude(compiled version) program for me?

    Best regards

  2. @Aban: you have to download winavr. AVRdude is supplied with it. (it’s in the bin folder)

Leave a Reply