Go Down

Topic: Problem with burning usbasp-bootloader to ATMEGA8 with Arduino (Read 5 times) previous topic - next topic

HeyYeah

Feb 20, 2012, 06:47 pm Last Edit: Feb 20, 2012, 06:49 pm by HeyYeah Reason: 1
Hey guys,

I want to build a "Metaboard" with an ATMEGA8 (Metaboard Info: https://metalab.at/wiki/Metaboard ).
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:
Code: [Select]
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:

Code: [Select]
##############################################################
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! ;)

Greetings, Julian

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

Osgeld

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)
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

HeyYeah

Code: [Select]
Done burning bootloader.

Thank you very much, it works fine!  :)

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.

HeyYeah

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... :(

Have you any clue for me, Osgeld?

Osgeld

not I, I havent even heard of a Metaboard until this post, dont fret though I am sure someone has
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

HeyYeah

I found my mistake! :)

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.

deepakvnit

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.

Osgeld

http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

deepakvnit

@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!!

Osgeld

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
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

Go Up