AVRISP

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.

Reply to
Hopkins
Loading thread data ...

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.

formatting link

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

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:
formatting link
e-mail:
formatting link
++++++++++++++++++++++++++++++++++++++++++
Reply to
Alan

Thanks Alan - that makes sense,

What frequency do I need 1 mhz?

Reply to
Hopkins

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:
formatting link
e-mail:
formatting link
++++++++++++++++++++++++++++++++++++++++++
Reply to
Alan

Thanks for the advice Alan.

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

Reply to
Hopkins

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:
formatting link
e-mail:
formatting link
++++++++++++++++++++++++++++++++++++++++++
Reply to
Alan

Thanks again Alan,

Who are your prefered suppliers of Atmel / AVR chips?

Reply to
Hopkins

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

Reply to
Hopkins

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

Reply to
Anton Erasmus

Thanks Anton.

So what does a parrallel programer do that allows it to recover the situation, ie can I not rig up somthing to over come the problem?

Reply to
Hopkins

Try reading the data sheet ? In there, you will see +12V is applied to /RST.

-jg

Reply to
Jim Granville

Well I am using SMD parts (AtMega16, AtMega32) so I buy them through distributors in quantities as I need them.

I use a couple of DIP chips of each type for prototyping and just keep reprogramming them as required.

Dontronics have a range of Atmel parts at reasonable prices, have a look at :

formatting link

With the oscillator you also have to remember that the fusebits have to be set correctly for whatever crystal you are using otherwise the internal oscillator will not work right or not at all. If you somehow select "external oscillator" then you will have to supply an external clock to recover.

I built a separate oscillator/divider box as it was more convenient for me (I build different proto boards as I require as well as having my "standard" board). If you build your oscillator on your development board just make sure you put some means on there for extracting the closk for another board when you need it.

ICs are normally shipped with the internal RC oscillator selected (1MHz).

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:
formatting link
e-mail:
formatting link
++++++++++++++++++++++++++++++++++++++++++
Reply to
Alan

Just make a parallel programmer or buy one.

formatting link
formatting link

Also have a browse at

formatting link
free to join, look under academy

schematics (just make sure you get the right circuits)

formatting link

formatting link

avrdude

formatting link
formatting link

lots of others

formatting link

formatting link

Reply to
Alex Gibson

There seems to be confusion about what an AVR parallel programmer is. Many programmers refered to as a parallel programmer, is a programmer driven from a PC's parallel port. From the point of view of the AVR it is a serial programmer. I cannot recall having seen any programmers available that is a parallel programmer from the AVR's point of view.

Regards Anton Erasmus

Reply to
Anton Erasmus

STK500 is the only one that I know of.

--
Mikael Ejberg Pedersen
Reply to
Mikael Ejberg Pedersen

Looking at the datasheet on the ATmega16, for example, you will see pages 261..288 cover THREE FLASH/EE programming modes

Parallel Programming : This applies 12V to RESET, and that over-rules any LOCK or Fuse bits, and allows programming. Appx 18 singal pins need to be connected for parallel Program Mode.

Serial SPI Programming : This does not use high voltage, but can be excluded via security options. This mode needs appx 5 signal pins connected. "Depending on CKSEL Fuses, a valid clock must be present."

JTAG serial Programming: It says " Programming through the JTAG interface requires control of the four JTAG specific pins: TCK, TMS, TDI and TDO. Control of the reset and clock pins is not required. To be able to use the JTAG interface, the JTAGEN Fuse must be programmed. "

Commercial Universal programmers tend to be Parallel, because that is fastest, and also has no 'blind spots', or one-way-streets :)

Some other uC use OTP fuses for ISP - that is a real one way path. Blow that, and the chip becomes OTP. Usefull for security features, but not so nice to 'oops' in the development LAB :)

-jg

Reply to
Jim Granville

Hi - I had exactly this problem with a Mega8.

The suggestion that you accidentally ticked the external oscillator fuse was, in fact, what the problem was (for me). I was able to take a 2 mhz TTL oscillator "can" and wire it to XTAL1 and reprogram the fuses. I have not had any problems since - but now I set the fuses only once to my desired settings *and never program them again*. Now I only update Flash in the programming window.

This is a very common accident - I found help very quickly over the weekend at the AVR Freaks forums. Take a look at

formatting link

Cheers, Chris

Reply to
Chris Alexander

Is the STK500 not a JTAG programmer ?

Reply to
Anton Erasmus

No. STK500 is a development kit capable of serial AND parallel programming nearly every AVR type. But it doesn't do JTAG.

--
Mikael Ejberg Pedersen
Reply to
Mikael Ejberg Pedersen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.