Bricked mega1284 - help requested [solved]

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My first use of a mega1284p

DIP 40 pin, plugs into socket.

Worked fine on first use - programming it with an Atmel MK-II ISCP.

Then I did the deed. Apparently chose the wrong oscillator mode and made the fuse change.  Dead now... no read signature response.

 

What I've tried

The board (old PRLLC board) has an oscillator module. Not a crystal or resonator.

Per my 'scope, it's placing a 6MHz square wave on mega1284's pin 13. I also have a 16MHz one. Neither worked.

Unplugged the oscillator.

Connected a 1MHz square wave so it gets to pin13 of the chip.

No help.

I jumpered pin 12 and 13 together. Nothing.

 

Resets, power cycles, reset ISCB (USB). OK.

Replaced mega1284 with mega32 - same pinout - ISCP sees it fine.

Replaced mega1284 #1 with a new factory fresh mega1284 #2. Reads fine. Graphic enclosed show factory default fuses for #2.

 

 

How can I rescue 1284 #1?

I read the mega32's fuse settings and have them, and they are

SUT_CKSEL: EXTHIFXTALRES_1KCK_0MS    which is not what I had chosen, but would it work for the mega1284?

 

Mega1284 #2 factory default includes CKDIV8 checked. I have to look up what that means and should be for changing the fuses to use the 16MHz oscillator module.

 

Thanks in advance.

I dare not program fuses in #2, as it's the only other one I have now.

 

steve

 

Attachment(s): 

Last Edited: Fri. Oct 3, 2014 - 06:12 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Connected a 1MHz square wave so it gets to pin13 of the chip.

Did you LOWER the ISP clock to match? 1MHz/8=125KHz/4=31KHz or near. This should allow you to change the fuses at least.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

All these years with AVRs and I've never bricked one.

 

Yes, I reduced it in steps, to as low as it goes... 2KHz.

I also tried the CPU clock on pin13 at 1MHz down to 10KHz.

 

I wonder if somehow it's in a crystal osc. mode. I tried hooking up a 3.57945MHz crystal and a pair of capacitors (not sure what pf). And I tried a couple of other crystals.

If it were in the crystal osc. mode, would a clock applied to pin 13, and pin 12 floating, work?

 

I'm happy to put the bricked 1284 in the bin, but I don't want to brick the other. I think I should have chosen oscillator mode bits 00 for external.

 

I have an Atmel JTAGICE3 coming any day - maybe it'll rescue via JTAG or high voltage programming. I've never used JTAG to set fuses.

 

steve

Last Edited: Thu. Oct 2, 2014 - 05:08 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Well, more reading... Appears I must use HVPP to restore the fuse settings. I have no STK500 or STK600. JTAGICE3 doesn't appear to do HVPP.

Well. Better buy some more chips.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What happens to me every now and then is that when you connect a new micro to the programmer you have to lower the progamming speed to be below 1/32 (=1/8 x 1/4) x 8MHz being below 125KHz..

Most of the time I program at 1 or 2 MHz and then it does not do a thing. I nicely get a signature error. I have had problems when the programmer runs at 250KHz with a new device. It seemed to almost always give back the correct signature, but would fail during programming. This might also have happened to you.

 

As a fuse reference I would take the second M1284 board and not a mega32. as they are different family the fuses might also be slightly different (did not check) with as a result....

 

so before doing anything else with the chip make sure that you can read back the signature and that it gives the correct one (ofcoarse)

 

If JTAG is not disabled by programming a wrong fuse, it should be possible to use that to recover the chip. If JTAG has been disabled by the faulty fuse programming, the only option left is to use High Voltage programming. As you have DIP parts the advantage is that you can isolate them, or put them in a STK500 to do the high voltage programming.

 

you have attached an external oscillator already, so that should have worked. I assume as said that with that oscillator connected to pin13 (xtal1) you have reduced the programming speed to below 1/32 of the given clock source.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks. I borked it. As a virgin factory-default, it worked fine, flashed my code, but was running on slow internal oscillator as default. My attempt to switch to the 16MHz oscillator module (ECS-100) did it in. I was to sloppy.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

to as low as it goes... 2KHz.

That may be too low for programming.  I have rescued chips with a 4KHz clock from my multimeter but that was just to change the fuses then back to 125KHz ISP clock.

 

Does you 16MHz external oscillator actually work? I guess you would have tried it with a new chip.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AFAIK there is no SUT/CKSEL combination which will 'brick' a 1284 in such a way as to require HVPP.  The device has no debugWire, and no RSTDISBL fuse.  It should be impossible to disabled ISP using ISP.  There is the SPIEN fuse, but that cannot be unprogrammed over ISP.

 

If you have clocked for the 128 kHz internal oscillator, and CKDIV8 is programmed, the device will require an ISP clock of < 4 kHz.  Since you've tried 2 kHz without success, it would seem as though this isn't the problem.

 

Any non-internal clock settings (all of the crystal options, plus the external clock option) should permit the injection of a system clock into XTAL1.  However if CKDIV8 is programmed, then you need to ensure that the ISP clock is less than systme_clock/32.  I.E. an injected 1 MHz clock requires an ISP clock of < 32.25 kHz, but it sounds like you've tried this.

 

Stumped.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:

AFAIK there is no SUT/CKSEL combination which will 'brick' a 1284 in such a way as to require HVPP.  The device has no debugWire, and no RSTDISBL fuse.  It should be impossible to disabled ISP using ISP.  There is the SPIEN fuse, but that cannot be unprogrammed over ISP.

 

If you have clocked for the 128 kHz internal oscillator, and CKDIV8 is programmed, the device will require an ISP clock of < 4 kHz.  Since you've tried 2 kHz without success, it would seem as though this isn't the problem.

 

Any non-internal clock settings (all of the crystal options, plus the external clock option) should permit the injection of a system clock into XTAL1.  However if CKDIV8 is programmed, then you need to ensure that the ISP clock is less than systme_clock/32.  I.E. an injected 1 MHz clock requires an ISP clock of < 32.25 kHz, but it sounds like you've tried this.

 

Stumped.

Thank you!

 

Is it possible that I accidentally changed the SPIEN fuse? That would disable use of ISCP?

 

Will the chip work with a clock applied to XTAL1 even if it is in the crystal oscillator mode?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes,   an external clock to XTAL1 pin will always 'win' in HF_XTAL, Ext_RC, Ext_Clock modes.   This is what happens on your STK500.

There is no need to disconnect any crystal.

 

I am not so sure about LF_XTAL fuse.    It is a bit more fussy.  i.e. just attach a 32kHz crystal.

 

No,   you can not  alter the SPIEN fuse via SPI.    

Yes,   you can remove SPIEN by JTAG or HVPP.

 

I am guessing that you don't have JTAG,   or else you could use JTAG (even without a clock).

Obviously,  JTAGEN must be available.

 

All this is explained in your data sheet.    Just do ctl-F "SPIEN"

 

David.

Last Edited: Thu. Oct 2, 2014 - 04:09 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Thank you so much.

I've pored over the data sheet for a couple of hours before first post.

Where you say

you can not  alter the SPIEN fuse via SPI.

Makes common sense. I didn't find that in the data sheet. Since I changed fuses with the MK-II SPI, by definition then it's still enabled. But after I changed fuse settings with the MK-II, it's not responded on that interface.

I will try with a newly received JTAGICE3 - hopefully today. (My ancient NKC JTAG v1 won't connect, even under Studio 4).

 

A mega32 I have, in the same socket as I've been using the m1284p, has its clock select bits programmed b1110 which is an oscillator mode. None the less, an oscillator module driving XTAL1 (XTAL2 is n/c) works. So as you say, it prevails.

The datasheet says program CKSEL to b0000 for an ext. clock.

 

Thanks again. 

I must be the millionth person that wishes Atmel had some way to ground some pins to cause fuses to reset and flash/eeprom to erase.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Surely a JTAGICE-1 clone should read and write fuses ok on any JTAG AVR.

You can't read or write the memory(s) of the modern AVRs.

 

If your JTAGICE-3 is arriving today,   you might just as well use that.

Of course,   anyone who chooses to write 0x00 to LFUSE,   probably chooses to write something inappropriate to HFUSE too !

So you may have lost JTAGEN.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JTAG v1 won't connect, even under Studio 4

It SHOULD work however it may not be able to program the M1284.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, Got JTAGICE3 now. Studio 6.2 upgrade just done. And VisualMicro.

JTAGICE3 as ICSP works.

JTAGICE3 as JTAG... the "squid" adapter board's JTAG connector (10 pin, 100mil spacing) - isn't keyed and I do NOT want to reverse it.

User manual is silent on this.

I'll google before plugging.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

De-bricked! laugh

 

JTAGICE3 read fuses for bricked mega1284 and displayed as enclosed

I changed just one: the clock select, to use external clock, 65mSec (oscillator I have is 20mSec)

Save. Read. Works!

Then I un-ticked the clock divide by 8.

Working.

 

I don't know why all the things I tried didn't work.. 2KHz SPI clock, 1MHz CPU clock, and lower, etc.

 

Morale: gotta have JTAG if you're fiddling with fuses and might make an error.

 

Thanks very much to all.

Steve

 

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You had selected the low frequency crystal oscillator mode.  This supports David's notion that it is 'fussy' and requires an actual crystal.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I had tried a 3.xMHz crystal, but probably didn't have right capacitors or some such.

 

Thanks again.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

stevech wrote:
I had tried a 3.xMHz crystal, but probably didn't have right capacitors or some such.
Low frequency in this context generally means a 32.768 kHz watch crystal.  3.x MHz probably wouldn't sing at all, regardless of the caps.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]