Upload with AVRISP mkII from Arduino IDE

I added the following to the Arduino configuration files to allow direct uploading with my AVRISP mkII instead of the Arduino bootloader:

in boards.txt:

##############################################################

avrispmkii.name=AVRISP mkII w/ ATmega168

avrispmkii.upload.protocol=avrispmkii
avrispmkii.upload.maximum_size=14336
avrispmkii.upload.speed=19200
avrispmkii.upload.using=avrispmkii

avrispmkii.bootloader.low_fuses=0xff
avrispmkii.bootloader.high_fuses=0xdd
avrispmkii.bootloader.extended_fuses=0x00
avrispmkii.bootloader.path=atmega
avrispmkii.bootloader.file=ATmegaBOOT_168_diecimila.hex
avrispmkii.bootloader.unlock_bits=0x3F
avrispmkii.bootloader.lock_bits=0x0F

avrispmkii.build.mcu=atmega168
avrispmkii.build.f_cpu=16000000L
avrispmkii.build.core=arduino


##############################################################

This allows you to program arbitrary AVR chips using the AVRISP mkII without needing a serial port or Arduino. Just make a copy of this entry for the chip and adjust the parameters.

Hi, I tried adding your code to the boards.txt file and, but I get this error:

avrdude: usbdev_open(): did not find any USB device "usb"

would you know how i could fix this?

Thanks.

I only get that error when my AVRISP mkII isn't connected. If it's plugged in via USB it should find it automatically.

Two ideas:

  • Does Tools->Burn Bootloader->w/ AVRISP mkII work for you? My board entry just references the programmer entry used for this (in programmers.txt), so if it doesn't work, there might be something wrong with your programmer.

  • Maybe it's a driver issue: see http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1228502992. Apparently there's an issue with having different drivers installed.

There might be a way to reference your programmer by serial number, but I don't know how to do it in programmers.txt, since it's not really obvious how the parameters are used with avrdude.

"Tools->Burn Bootloader->w/ AVRISP mkII" actually doesn't work for me. As a matter of fact, I just checked that today while troubleshooting an old roboduino. Although I also did just upgrade the AVRISPmkII's firmware today. maybe i need to downgrade?

Relating back to the Roboduino (robotics oriented arduino-compatible board), I was able to burn the arduino bootloader onto an atmega168 with avr studio 4 just about 2 hours ago... I had to go to avr studio because the arduino IDE wouldnt do it for me...i just assumed that the arduino IDE was trying to burn the bootloader for the 328, and subsequently failing.

Read the thread I posted - according to mellis, you can only have one driver installed for it a a time, and the AVR Studio one doesn't work with Arduino.

So unless things have changed since then, you'll have to uninstall AVR Studio, or just its USB driver if possible.