EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

AVRISP

Started by Hopkins October 8, 2004
I have the AVRISP and when programming the ATMega 8  chip I have 2 chips out
of four that have locked up when been reprogrammed to the point the AVRISP
programmer complains it can not enter programming mode.

I asked ATMEL about the problem and they just said that I must have the
wrong fuse bits set!

IMHO why the hell should a product produced by a comercial company have a
bug that allows you to corrupt the chip you are programming to the point
that you can not even reset the fuse bits anymore.

Have read that this situation can be rescued with a parrallel programmaer,
is there a way I can rig somthing up to reset the fuse bits other than
buying another programmer?

Thanks in advance Roy.


On Sat, 9 Oct 2004 07:51:19 +1300, "Hopkins" <rdhopkins@ihug.co.nz>
wrote:

>I have the AVRISP and when programming the ATMega 8 chip I have 2 chips out >of four that have locked up when been reprogrammed to the point the AVRISP >programmer complains it can not enter programming mode. > >I asked ATMEL about the problem and they just said that I must have the >wrong fuse bits set! > >IMHO why the hell should a product produced by a comercial company have a >bug that allows you to corrupt the chip you are programming to the point >that you can not even reset the fuse bits anymore. > >Have read that this situation can be rescued with a parrallel programmaer, >is there a way I can rig somthing up to reset the fuse bits other than >buying another programmer?
To paraphrase an old saying from the 'net: "Programming in BASIC is like using the kind of scissors a child gets in school: difficult for the child get hurt using them and they will cut paper as intended. "Programming in C is like using a surgeon's scalpel: a precise instrument that can perform miracles in trained hands but careless use can lead to spilling your own blood (and losing a few fingers). "Programming a microcontroller's fuse bits is like juggling scalpels..." Developers need to be able to do things deliberately that could be catastrophic if done incorrectly or in the wrong circumstances. Just one incorrect bit can do a lot of damage; it's the nature of the business. IIRC, the parallel programming algorithms for Atmel chips are documented on their web site but it seems not to be accessible at the moment? But here's one bloke from your neighborhood who may have had a similar problem in the past and came up with a clever solution. I haven't tried it, so caveat emptor. http://www.uq.net.au/~zzdkeena/AVR/ -- Rich Webb Norfolk, VA
On Sat, 9 Oct 2004 07:51:19 +1300, "Hopkins" <rdhopkins@ihug.co.nz>
wrote:

>I have the AVRISP and when programming the ATMega 8 chip I have 2 chips out >of four that have locked up when been reprogrammed to the point the AVRISP >programmer complains it can not enter programming mode. > >I asked ATMEL about the problem and they just said that I must have the >wrong fuse bits set! > >IMHO why the hell should a product produced by a comercial company have a >bug that allows you to corrupt the chip you are programming to the point >that you can not even reset the fuse bits anymore. > >Have read that this situation can be rescued with a parrallel programmaer, >is there a way I can rig somthing up to reset the fuse bits other than >buying another programmer? > >Thanks in advance Roy. >
You may have inadvertently selected an external oscillator option when you don't have one. The answer to this is to use an external oscillator, to inject into the XTAL1 pin of the device, then reselect your required oscillator option in the fuses section. Once you've seleceted the right option then just disconnect the external oscillator - you don't have to remove any crystal in your cicruit to do this. HTH Alan ++++++++++++++++++++++++++++++++++++++++++ Jenal Communications Manufacturers and Suppliers of HF Selcall P O Box 1108, Morley, WA, 6943 Tel: +61 8 9370 5533 Fax +61 8 9467 6146 Web Site: http://www.jenal.com e-mail: http://www.jenal.com/?p=1 ++++++++++++++++++++++++++++++++++++++++++
Thanks Alan - that makes sense,

What frequency do I need  1 mhz?

"Alan" <me@somewhere.com.au> wrote in message
news:sevem01667lc35mmufgk6pgar6u6g0r504@4ax.com...
> On Sat, 9 Oct 2004 07:51:19 +1300, "Hopkins" <rdhopkins@ihug.co.nz> > wrote: > > You may have inadvertently selected an external oscillator option when > you don't have one. The answer to this is to use an external > oscillator, to inject into the XTAL1 pin of the device, then reselect > your required oscillator option in the fuses section. Once you've > seleceted the right option then just disconnect the external > oscillator - you don't have to remove any crystal in your cicruit to > do this. > > HTH > Alan
On Sat, 9 Oct 2004 20:16:21 +1300, "Hopkins" <rdhopkins@ihug.co.nz>
wrote:

>Thanks Alan - that makes sense, > >What frequency do I need 1 mhz? > >"Alan" <me@somewhere.com.au> wrote in message >news:sevem01667lc35mmufgk6pgar6u6g0r504@4ax.com... >> On Sat, 9 Oct 2004 07:51:19 +1300, "Hopkins" <rdhopkins@ihug.co.nz> >> wrote: >> >> You may have inadvertently selected an external oscillator option when >> you don't have one. The answer to this is to use an external >> oscillator, to inject into the XTAL1 pin of the device, then reselect >> your required oscillator option in the fuses section. Once you've >> seleceted the right option then just disconnect the external >> oscillator - you don't have to remove any crystal in your cicruit to >> do this. >> >> HTH >> Alan >
Almost any frequency will do - I use 1MHz or 8MHz normally. I actually built an oscillator box with a 16MHz xtal osc and a binary divider chain with a switch to select 16, 8, 4, 2, 1 0.5 or 0.25MHz. I have managed to "kill" a few AVRs by accidently reprogramming the fuse bits to external - but it seems to happen when you try and programme the device with no power applied to it (apart from leakage from the programming pins). It's a real pain when it first happens but now I just shrug my shoulder and accept I goofed again :-) Alan ++++++++++++++++++++++++++++++++++++++++++ Jenal Communications Manufacturers and Suppliers of HF Selcall P O Box 1108, Morley, WA, 6943 Tel: +61 8 9370 5533 Fax +61 8 9467 6146 Web Site: http://www.jenal.com e-mail: http://www.jenal.com/?p=1 ++++++++++++++++++++++++++++++++++++++++++
Thanks for the advice Alan.

Any chance of showing the schemaic of your 16Mhz divider circuit?

> Almost any frequency will do - I use 1MHz or 8MHz normally. > > I actually built an oscillator box with a 16MHz xtal osc and a binary > divider chain with a switch to select 16, 8, 4, 2, 1 0.5 or 0.25MHz. > > I have managed to "kill" a few AVRs by accidently reprogramming the > fuse bits to external - but it seems to happen when you try and > programme the device with no power applied to it (apart from leakage > from the programming pins). It's a real pain when it first happens > but now I just shrug my shoulder and accept I goofed again :-) >
On Sat, 9 Oct 2004 21:02:38 +1300, "Hopkins" <rdhopkins@ihug.co.nz>
wrote:

>Thanks for the advice Alan. > >Any chance of showing the schemaic of your 16Mhz divider circuit? > >> Almost any frequency will do - I use 1MHz or 8MHz normally. >> >> I actually built an oscillator box with a 16MHz xtal osc and a binary >> divider chain with a switch to select 16, 8, 4, 2, 1 0.5 or 0.25MHz. >> >> I have managed to "kill" a few AVRs by accidently reprogramming the >> fuse bits to external - but it seems to happen when you try and >> programme the device with no power applied to it (apart from leakage >> from the programming pins). It's a real pain when it first happens >> but now I just shrug my shoulder and accept I goofed again :-) >> >
Don't think I've got a diagram!! It's just a 74LS04 running as a 16MHz XTAL oscillator and buffer then a 74LS393 dual 4 bit binary counter wired up as a divider with the input and the outputs connected to a rotary switch. The switch output is then fed through a couple of spare inverter ('04) gates before going to the outside world via an RCA socket. I then use a bit of shielded cable to a ground croc cilp and a "injection" (ie. voltmeter type) probe. All in a small jiffy box with a 5v reg and a power lead to connect to the 12v bench PSU. Probably be even easier if you could pick up a cheap/free 16MHz osc module from somewhere. Don't know whats on a PC Motherboard haven't looked for a while. HTH Alan ++++++++++++++++++++++++++++++++++++++++++ Jenal Communications Manufacturers and Suppliers of HF Selcall P O Box 1108, Morley, WA, 6943 Tel: +61 8 9370 5533 Fax +61 8 9467 6146 Web Site: http://www.jenal.com e-mail: http://www.jenal.com/?p=1 ++++++++++++++++++++++++++++++++++++++++++
Thanks again Alan,

Who are your prefered suppliers of Atmel / AVR chips?


Just thinking I may experiment with a simple 1 Mhz oscillator & buffer as
part of my seperat programmer board so that it is available for the next
time.

May even program a ATtiny 12 to give different frequency's as required and
use this is a clock source with some predefined frequency ranges ie 1Mhz,
500Khz,100Khz etc.

cya Roy


On Sat, 09 Oct 2004 14:01:39 +0800, Alan <me@somewhere.com.au> wrote:

>On Sat, 9 Oct 2004 07:51:19 +1300, "Hopkins" <rdhopkins@ihug.co.nz> >wrote: > >>I have the AVRISP and when programming the ATMega 8 chip I have 2 chips out >>of four that have locked up when been reprogrammed to the point the AVRISP >>programmer complains it can not enter programming mode. >> >>I asked ATMEL about the problem and they just said that I must have the >>wrong fuse bits set! >> >>IMHO why the hell should a product produced by a comercial company have a >>bug that allows you to corrupt the chip you are programming to the point >>that you can not even reset the fuse bits anymore. >> >>Have read that this situation can be rescued with a parrallel programmaer, >>is there a way I can rig somthing up to reset the fuse bits other than >>buying another programmer? >> >>Thanks in advance Roy. >> > >You may have inadvertently selected an external oscillator option when >you don't have one. The answer to this is to use an external >oscillator, to inject into the XTAL1 pin of the device, then reselect >your required oscillator option in the fuses section. Once you've >seleceted the right option then just disconnect the external >oscillator - you don't have to remove any crystal in your cicruit to >do this.
You might also have programmed the ATMega8's reset pin to be a GPIO pin. Once you have done this, then you have to use a parallel programmer to program the chip again. Regards Anton Erasmus

The 2024 Embedded Online Conference