AtMega8A bootloader with Uno ( without crystal)

Hi,

I didn't spot a definite answer anywhere about this. So, is it possible to burn bootloader for AtMega8A(or 168 and 328) without external crystal ? (like it can be done with AtTiny 2313,... )

Even if i want it to run on 8MHz, does it require a crystal for bootloader ?

You don't need an external crystal. You can run it on internal oscillator at 8 MHz if you set the fuse bits correctly.

Well, yes, I constantly get this error "Yikes invalid device signature" and it reports signature as 0x00000000 when it shouldn't.

Fuse bits are:

atmega8noxtal.bootloader.low_fuses=0xe4 
atmega8noxtal.bootloader.high_fuses=0xc4 
atmega8noxtal.bootloader.path=atmega8_noxtal 
atmega8noxtal.bootloader.file=ATmegaBOOT.hex 
atmega8noxtal.bootloader.unlock_bits=0x3F 
atmega8noxtal.bootloader.lock_bits=0x0F

Sounds like the chips isn't responding correctly.
Is it a new chip or has it been used previously with other clock settings?
If you have been running it with a 16MHz crystal before you need to have that crystal attached when you reprogram the chip for 8MHz use.

I'm not sure about your fuse bits either because when I've used an 8MHz version of the ATmegaBOOT.hex bootloader I've used C4, CA and not E4, C4. Apart from a minor difference in the xtal settings you're also using a different boot flash section size.
Are you using a bootloader for 8MHz or the regular 16MHz version?

Did you find this thread?

I'm not sure about AtMega8 if it was programed for 16MHz before( it was inteded to be used on Severino long ago and I can't remember if I programed it before), but that's why I tried it on the brand new AtMega 168 and it was the same story.

I tried to use several different bootloaders. I'm not sure about fuse bits on other ones(I'm writing from different computer), but I'll give it a try later today.

Hovever I did try fuse bits, mentioned on this site: http://arduino.cc/en/Hacking/Bootloader

I've tried like this:

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

atmega8noxtal.name=ATmega8-noxtal @8MHz

atmega8noxtal.upload.protocol=stk500
atmega8noxtal.upload.maximum_size=7168
atmega8noxtal.upload.speed=38400

atmega8noxtal.bootloader.low_fuses=0xe4
atmega8noxtal.bootloader.high_fuses=0xc4
atmega8noxtal.bootloader.path=atmega8_noxtal
atmega8noxtal.bootloader.file=ATmegaBOOT.hex
atmega8noxtal.bootloader.unlock_bits=0x3F
atmega8noxtal.bootloader.lock_bits=0x0F

atmega8noxtal.build.mcu=atmega8
atmega8noxtal.build.f_cpu=8000000L
atmega8noxtal.build.core=arduino

and I used the bootloader available here:Minimal Arduino with ATmega8 – todbot blog

And still no success.

What does your circuit look like?
Are you running the chip on your Uno board as your topic might suggest or are you using a standalone setup like the one in the article you linked to?

When I'm using studio I find you have to connect at a ridiculously slow speed when setting the fuses on a new device. Once setup you can adjust to whatever speed you like. Not sure if this will be the same without studio but it seems reasonable. I can't remember what I did when boot loading the last mega8a

bluebird92:
I didn't spot a definite answer anywhere about this. So, is it possible to burn bootloader for AtMega8A(or 168 and 328) without external crystal ? (like it can be done with AtTiny 2313,... )

Yes.

The only problem is if the fuses have previously been set to "external crystal". In that case you need a crystal connected while you reset them (you can remove it after they're set to "internal oscillator").

bluebird92:
Even if i want it to run on 8MHz, does it require a crystal for bootloader ?

No.

you may also find it necessary to fine tune the clock using osccal register. 30% of my last batch of m8 from digikey failed w/o this.

john1993:
you may also find it necessary to fine tune the clock using osccal register. 30% of my last batch of m8 from digikey failed w/o this.

A bit hard to do before the chip is running isn’t it?

Now I've tried this Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board to recognize the chip but it always says only: "Atmega chip detector." No matter if I use AtMega8A or 168, but it works with all AtTiny's. I don't get it, I've done this few times with AtMega8A with no problems.

Even if I use external crystal, problem is still here.

perhof:

john1993:
you may also find it necessary to fine tune the clock using osccal register. 30% of my last batch of m8 from digikey failed w/o this.

A bit hard to do before the chip is running isn't it?

i was referring to operation with bootloader using internal clock. regarding isp if attaching xtl dont work then try putting signal into x1. if chip is still no longer responding then rstdsbl is the issue and theres nothing to be done w/o 12v programmer.

atmega8noxtal.upload.protocol=stk500

Try changing this to "atmega8noxtal.upload.protocol=arduino"
It seems that newer versions of avrdude started behaving differently with -cstk500, using a protocol option that is not supported by optiboot, and only partially supported by ATmegaboot.

See also Google Code Archive - Long-term storage for Google Code Project Hosting.

I

perhof:
What does your circuit look like?
Are you running the chip on your Uno board as your topic might suggest or are you using a standalone setup like the one in the article you linked to?

I'm running chip on breadboard.

I've tried arduino, stk500 and stk500v1.

However I did manage to get something from Atmega 168 with that sketch to recognize chip. It did say signature
not recognized, but I think it's not set correctly in sketch. I only got that If I used Pin 9 on Uno as clock.

Then I've set up AtMega8A with 16MHz crystal and got nothing.
Trying to program bootloader the regular way still reports "Yikes....." even on AtMega168.

bluebird92:
I

perhof:
What does your circuit look like?
Are you running the chip on your Uno board as your topic might suggest or are you using a standalone setup like the one in the article you linked to?

I'm running chip on breadboard.

Show us your circuit

Show us your circuit

Will do as soon as posible.

Well today, in the morning I plug in usb in PC and something works. AtMega8A works only on 8MHz. One of the problems is now that it requires pins_arduino.h file in Cores folder if I use this bootloader:

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

atmega8noxtal.name=ATmega8-noxtal @8MHz 

atmega8noxtal.upload.protocol=stk500 
atmega8noxtal.upload.maximum_size=7168 
atmega8noxtal.upload.speed=9600 

atmega8noxtal.bootloader.low_fuses=0xe4 
atmega8noxtal.bootloader.high_fuses=0xca
atmega8noxtal.bootloader.path=atmega8_noxtal 
atmega8noxtal.bootloader.file=ATmegaBOOT.hex 
atmega8noxtal.bootloader.unlock_bits=0x3F 
atmega8noxtal.bootloader.lock_bits=0x0F 

atmega8noxtal.build.mcu=atmega8 
atmega8noxtal.build.f_cpu=8000000L 
atmega8noxtal.build.core=arduino

If I use this one, it works.(note. atmega8_8mhz.hex is not even installed!!!)

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

atmega8_8mhz_int.name=ATmega8 (8MHz internal OSC)

atmega8_8mhz_int.upload.protocol=arduino
atmega8_8mhz_int.upload.maximum_size=7168
atmega8_8mhz_int.upload.speed=9600

atmega8_8mhz_int.bootloader.low_fuses=0xc4
atmega8_8mhz_int.bootloader.high_fuses=0xca
atmega8_8mhz_int.bootloader.path=atmega8_8mhz
atmega8_8mhz_int.bootloader.file=atmega8_8mhz.hex
atmega8_8mhz_int.bootloader.unlock_bits=0x3f
atmega8_8mhz_int.bootloader.lock_bits=0x0F

atmega8_8mhz_int.build.mcu=atmega8
atmega8_8mhz_int.build.f_cpu=8000000L
atmega8_8mhz_int.build.core=arduino
atmega8_8mhz_int.build.variant=standard

I programed bootloader with AtMega Board programer sketch: Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board
And then used the second bootloader pasted up, to upload sketch.

Situation so far:

I can only burn bootloader for Atmega8A with 8Mhz internal.
As soon as I try to burn a bootloader for Severino with 16MhZ crystal, errror appears

avrdude: Device signature = 0x000000

But I did try to put the same AtMega8A chip into Severino, and 'woila' bootloader with 16MHz external crystal installed normaly.
The circuit is correct on breadboard(I would bet...) so, the only thing that could cause problems for using external crystal are those two 22pF capacitors.(I suppose those two have to be that small and not bigger ?)

Now this is solved, but I had to use that sketch for programming bootloaders, which fixed fuses and signature, so I could upload bootloader the "normal way" too.

However new problem appeared. As long as I use Arduino 022 everything works. in new versions 1.0 and above it requires pins_arduino.h file in Cores folder to upload sketch on AtMega8A. Can anyone tell me how to fix that ? If I copy paste it from 022 version, then Uno is the one that won't work.