Problem with burning usbasp-bootloader to ATMEGA8 with Arduino

Hey guys,

I want to build a "Metaboard" with an ATMEGA8 (Metaboard Info: Metaboard – Metalab Wiki ).
Just tried to burn the usbasp-bootloader (http://www.obdev.at/products/vusb/usbasploader.html) with an Arduino UNO as ISP, but got some errors:

avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I used this manual, Atmega on breadboard with an ext. oscillator (16MHz): http://arduino.cc/en/Tutorial/ArduinoISP
...and recognized that UNO seems to be incompatible, but I've read from some people who had success burning bootloaders with UNOs.

In my "boards.txt", I added the following lines:

##############################################################
metaboard.name=Metaboard w/ ATMega8
metaboard.upload.protocol=usbasp
metaboard.upload.maximum_size=7168
metaboard.upload.speed=19200
 
metaboard.build.mcu=atmega8
metaboard.build.f_cpu=16000000L
metaboard.build.core=arduino
 
metaboard.bootloader.low_fuses=0xef
metaboard.bootloader.high_fuses=0xc9
metaboard.bootloader.path=metaboard
metaboard.bootloader.file=mega8_16mhz.hex
metaboard.bootloader.unlock_bits=0x3F
metaboard.bootloader.lock_bits=0x2F
 
metaboard.upload.disable_flushing=true

What went wrong here - can somebody help me?
I don't have an external programmer, so the Arduino must do it! :wink:

Greetings, Julian

PS: The RX/TX-LEDs flashed some times and after ~10s, I got the errors above.

metaboard.upload.protocol=usbasp

change to

metaboard.upload.protocol=avrisp

if your using arduino as a uploader, also if your using 1.0 version of the IDE get the 022 version and use its arduinoisp sketch, there is something screwed up with 1.0 (why I dont know it worked perfectly before)

Done burning bootloader.

Thank you very much, it works fine! :slight_smile:

For others, having the same or a similar problem:
I changed "usbasp" to "avrisp" in boards.txt and uploaded the bootloader with IDE version 0022 with the Arduino-ISP-sketch of 0022.

Got another problem:
I connected the Metaboard to my PC and after pressing the reset-button, I was able to install it as a USBasp-device and upload a sketch. Works fine.
Than I disconnected the USB-plug and wrote another sketch.
After reconnecting the USB, it's only a "unknown device" - pressing the reset switch don't help.
ArduinoIDE says: avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc .
It's like the bootloader isn't enabled anymore!?
After re-burning the bootloader, I can upload exactly one sketch that runs until the Atmega is connected to power, but after uploading the sketch, Arduino couldn't find the device anymore... :frowning:

Have you any clue for me, Osgeld?

not I, I havent even heard of a Metaboard until this post, dont fret though I am sure someone has

I found my mistake! :slight_smile:

The HFuse was a little bit wrong, it should be 0xc8, that change sets BOOTRST=0 (programmed).
After pressing the Reset-Button, the Atmega jumps into bootloadermode and I'm able to upload new programs via USBasp.

hi guys , My problem may be little irrelevant related to post here, for that sorry, but i accidentally got my ic atmega 328 burnt. Now i want to replace this with new atmega 328.Now since i have board with burnt Atmega I can't use arduino as isp to burn bootloader in new Atmega.correct me if I am wrong but I think i can directly burn Bootloader selecting TOOLS>>BOOTLOADER>>>AVR ISP in Arduino IDE. I am using arduino uno board.

if you have an avrisp handy then yes you can

@Osgeld it may sound pretty dumb but as i am very new to arduino... Doesn't arduino board has its own avrisp? can you explain any method to burn bootloader in new Atmega!!

the arduino board uses the avr chip that is then programed to act like an avrisp, since you dont have one either bootloaded or working