Go Down

Topic: HELP: AtMega8-16pu with optiboot bootloader... (Read 1 time) previous topic - next topic

mcnobby

Hi, I have made a nice little board which I can burn optiboot onto AtMega8 chips..
this works great and I get flashing lights and everything and all is good !!!

But when I try and upload to the Atmega8, I get the dreaded "stk500_getsync(): not in sync: resp=0x00" response...

I have googled and read about what to use and how to set this and that...
I have fiddled and faddled, and am at the end of my tether !

Does anyone have a definative answer on this ?

Thanks in advance
while (z--) { snoreEvenLouder(); }
www.smartshow.lighting - www.dmx512.lighting

tack

What is the bords.txt definition for your MCU?
What Fuse settings have you burnt?

This could be as simple as trying to upload at the wrong baud rate, or it could be more involved.

mcnobby

I was using two, but I think its the second of the two that has been running...

opti8.name=Arduino Optiboot-Atmega8-16
opti8.upload.protocol=arduino
opti8.upload.maximum_size=7680
opti8.upload.speed=115200
opti8.bootloader.low_fuses=0xbf
opti8.bootloader.high_fuses=0xcc
opti8.bootloader.path=optiboot
opti8.bootloader.file=optiboot_atmega8-16.hex
opti8.bootloader.unlock_bits=0x3F
opti8.bootloader.lock_bits=0x0F
opti8.build.mcu=atmega8
opti8.build.f_cpu=16000000L
opti8.build.core=arduino
opti8.build.variant=standard
##############################################################
opti8.name=Arduino Optiboot8
opti8.upload.protocol=stk500
opti8.upload.maximum_size=7680
opti8.upload.speed=115200
opti8.bootloader.low_fuses=0xbf
opti8.bootloader.high_fuses=0xdc
opti8.bootloader.path=optiboot
opti8.bootloader.file=optiboot_mega8.hex
opti8.bootloader.unlock_bits=0x3F
opti8.bootloader.lock_bits=0x0F
opti8.build.mcu=atmega8
opti8.build.f_cpu=16000000L
opti8.build.core=arduino
opti8.build.variant=standard
while (z--) { snoreEvenLouder(); }
www.smartshow.lighting - www.dmx512.lighting

mcnobby

These are the items I have bought...

http://www.ebay.co.uk/itm/3pcs-Arduino-MCU-ATMEGA8-16PU-w-Arduino-UNO-bootloader-Atmega328-replacement-/120994422530?pt=LH_DefaultDomain_0&hash=item1c2bd45f02

The ebay page shows the new entry for boards.txt...

##############################################################
opti8.name=Arduino Optiboot-Atmega8-16
opti8.upload.protocol=arduino
opti8.upload.maximum_size=7680
opti8.upload.speed=115200
opti8.bootloader.low_fuses=0xbf
opti8.bootloader.high_fuses=0xcc
opti8.bootloader.path=optiboot
opti8.bootloader.file=optiboot_atmega8-16.hex
opti8.bootloader.unlock_bits=0x3F
opti8.bootloader.lock_bits=0x0F
opti8.build.mcu=atmega8
opti8.build.f_cpu=16000000L
opti8.build.core=arduino
opti8.build.variant=standard
##############################################################

The file shown as optiboot_atmega8-16.hex DOES NOT EXIST on my Arduino IDE, on infact any other IDE I have seen
I have tried renaming the filename so that I dont get an error, but I still have no joy

Emailed the seller and he just says I have to add this section into boards.txt and it will work - how the hell can it ??

Really frustrated with this now :@( Any help would be greatly appreciated !
while (z--) { snoreEvenLouder(); }
www.smartshow.lighting - www.dmx512.lighting

afremont

You only need that bootloader file if you plan to burn a new one to the chip.  Since the chips you bought already contain the bootloader, you shouldn't have to do anything other than upload thru the existing bootloader by connecting a comm port adapter to pins 2 and 3 on the chip, connect the crystal AND the 22pf caps that you need with them. 

Closing the IDE, adding that entry to the boards.txt file and then starting the IDE should provide the entry you need to select to upload.  You will also need to select the correct serial port to go with it.

I think you have all you need to make it work unless you wipe out the bootloader on the chip.  You will then need to modify the Makefile in the optiboot folder to build a bootloader with the appropriate options and burn it using ArduinoISP or something like that.

You should be able to breadboard up one of your new chips and then push the reset button.  You should see an LED connected to DP13 blink three times.  This means the chip and bootloader is running.
Experience, it's what you get when you were expecting something else.

mcnobby

Excellent information, thank you, I have done most of this and plan on doing some good burning soon as I have made a board to do this.

I have 3 chips, one has started allowing me to down load now, I have no idea why it played up for so long, my hardware is fine when I use a 328 in it !

Thanks again :@)
while (z--) { snoreEvenLouder(); }
www.smartshow.lighting - www.dmx512.lighting

afremont

If you use another board running ArduinoISP to flash one of your pre-bootloaded chips, the flash process will erase the chip, including the bootloader.  You will then be forced into using the "burn bootloader" feature of the IDE.  You would have to use a working board running ArduinoISP to do so.  You will also need a bootloader out there that matches the name used in the boards.txt file.  I assume these chips came configured to use a 16MHz crystal, is that correct?

That's one of the weird things about all this that you have to understand.  New, blank chips (no bootloader, nothing) need to have the fuses set.  This happens when you install a bootloader.  Seems like ArduinoISP should be able to do this, but apparently it can't.  I don't know if a "regular" external programmer can do it or not?  I don't see what is so special about the "burn bootloader" process that sets the fuse and lock bits, that can't be done ordinarily when you upload.
Experience, it's what you get when you were expecting something else.

Go Up