Programming the ATTiny45 with AVR Dragon

I have an old AVR Dragon and some ATTiny45 chips. This is a short note on how to program these chips on Linux using an AVR Dragon, mostly a rewrite of this tutorial

Using the AVR Dragon ISP Programming pins, connect the ISP pins to the matching pins on the ATTiny. On the AVR Dragon, the pin numbers for 1 and 5 are printed next to the pins. Use the chart below to see the corresponding pin values.

One catch is that VTG needs to be connected to a VCC pin on the AVR Dragon. Connect the VTG, VCC on the ATTiny and another VCC on the AVR Dragon together. Just connecting the VTG to the VCC on the ATTiny will lead to a RSP_NO_TARGET_POWER error.

AVR Dragon ISP

Download avr-gcc and avrdude from your distro’s repo. Use the commands below to create an object file.

avr-gcc -c test.c -mmcu=attiny45
avr-gcc -mmcu=attiny45 -o test.elf test.o
avr-objcopy -j .text -j .data -O ihex test.elf test.hex

Finally upload the file to the AVR Dragon with:

avrdude -p t45 -c dragon_isp -P usb -e -U flash:w:test.hex