Atmega2560 Dead when i accidently disturbed a wire while programming

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

So in one of my project i was using atmega2560 and i was using arduino as ISP to burn the program and everything was working fine. On one such occasion i accidently disturbed the wire, ( When IDE was actually reading the program ) and it stopped reading with some error which i didn't notice. But after that iam not able to program it. I bought a UsbAsp and tried with that too but it throws me an error in IDE that target doesnt answer

 

 

avrdude:error:programm enable : target doesn't answer.1
avrdude:initialisation failed,rc=-1
and yikes!invalid device signature.
 

What is the way out of this ?... do i have to get a new atmega ?, Desoldering this is a hectic job..:-)

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

Welcome to the Forum.

 

Can you post a photo of your set up?

(Use the mountain range icon, two to the left of the smilie face icon)

 

Any idea what you bumped?

It can make a big difference.

 

Shorting a Ground pin to Vcc could easily fry the chip.

 

It is possible to "brick" the chip, by mis-setting the clock source fuses, but that seems a bit unlikely, (but never say never...).

Cliff as a nice tutorial on recovering from a locked out micro, HERE.

You might give it a read through and see if it helps with your micro.

 

JC

 

 

 

 

 

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

...When IDE was actually reading the program ...  

 

  Does this mean that the Mega2560 was already programmed and the ISP was reading it back to verify the new program was loaded correctly?  Or that the Mega2560 was in the process of being programmed?

 

Does the Arduino_as_ISP still work with other AVRs?   Does the USBasp work with other AVR devices?   If you have no other AVR ICs, does the USBasp read the memory of the Arduino_as_ISP?

 

There could be two problems, one, the Arduino is not working because the Arduino_as_ISP program that has been installed on the Arduino has become corrupted.  Can you load a simple blink test program into the Arduino (that is being used as ISP) using the PC USB and the bootloader?  Two, the USBasp device may not be working correctly.  Possibly the driver has not been loaded correctly into Windows.  Microsoft makes it very difficult to upgrade drivers such as libUSB.  Unless the driver signature enforcement is disabled, the new driver won't load and there is no indication that the process has failed.

 

How is your device programmer connected to the Mega2560?  Is it with a 6-pin or 10-pin header?  Or "the wires held onto the pads with my fingers" situation?   Are all of the grounds and Vcc pins on the Mega2560 connected to Gnd and Vcc? 

 

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

I had experienced that with my mega 8 many years ago. My case is the power to target somehow disconnected while programming the chip and the mega 8 dead.
I had tried anything including HVP but failed.
Well... sh*t happens.
.
MG

I don't know why I'm still doing this hobby

Last Edited: Wed. Sep 13, 2017 - 11:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 2560 has no RSTDISBL fuse, so it's not possible to completely 'brick' it in that way.  However, there are some undocumented ISP instructions which can affect the signature row.  That row also contains, apparently, factory-programmed parameters which could potentially render the AVR for all intents and purposes, 'dead'.

 

However, the first thing I would try is either HVPP, or at least try to inject a clock into XTAL1 during ISP.

 

See this:

http://www.avrfreaks.net/forum/tutsoft-recovering-locked-out-avr

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

DocJC wrote:

Welcome to the Forum.

 

Can you post a photo of your set up?

(Use the mountain range icon, two to the left of the smilie face icon)

 

Any idea what you bumped?

It can make a big difference.

 

Shorting a Ground pin to Vcc could easily fry the chip.

 

It is possible to "brick" the chip, by mis-setting the clock source fuses, but that seems a bit unlikely, (but never say never...).

Cliff as a nice tutorial on recovering from a locked out micro, HERE.

You might give it a read through and see if it helps with your micro.

 

JC

 

 

Well i have setup everything in a proper PCB,( No not the home made ones but a professionally fabricated PCB and i have assembled 3 of those and the other 2 are working perfectly fine.

 

 

What i bumped is not Vcc or Gnd anyway. Because ISP arduino and this board share a common power supply, so in addition i was connecting SCK MOSI MISO AND RESET from arduinoisp to this board using jumper wire, So i can say i bumped one of those.

 

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

Yea you are write, it had finished writing the program and it was reading it back to verify, this happend when reading was around 60 % Complete

 

Arduino as ISP works with other AVR'S and i can say it works with other copies of same board.

USBasp also works fine with other board.

I have assembled 3 boards of this kind so i can say the issue is with this particular atmega itself and not with ISP.

 

So in my PCB I Have included a header to connect gnd,MOSI,MISO,SCK and reset. so this goes to ArduinoISP or USBasp using jumper wires.

 

Yea all gnd and vcc pins of mega are connected properly.I verified it.

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

 

 had experienced that with my mega 8 many years ago. My case is the power to target somehow disconnected while programming the chip and the mega 8 dead.
I had tried anything including HVP but failed.
Well... sh*t happens.
.
MG

Well..Yours sounds exactly similiar to mine

Last Edited: Thu. Sep 14, 2017 - 06:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:

The 2560 has no RSTDISBL fuse, so it's not possible to completely 'brick' it in that way.  However, there are some undocumented ISP instructions which can affect the signature row.  That row also contains, apparently, factory-programmed parameters which could potentially render the AVR for all intents and purposes, 'dead'.

 

However, the first thing I would try is either HVPP, or at least try to inject a clock into XTAL1 during ISP.

 

See this:

http://www.avrfreaks.net/forum/tutsoft-recovering-locked-out-avr

 

Too expensive to  buy a HVPP programmer.

i saw a tutorial on how to make a uno shield to perform HVPP on 328P and smaller chips but couldnt find any reference for 2560

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

HVPP would be the last resort.  Have you tried the other techniques?  Injecting a clock into XTAL1?  Make sure your programming clock speed is < 1/32 of the injected clock.  If you inject 1 MHz, programming clock must be less than 31 kHz.  Also, try attaching a 32.768 kHz watch crystal to XTAL1/2, and set programming clock to 1 kHz or less.

 

You can easily adapt any of the tutorials on HVPP to the 2560.  Simply refer to the datasheet, the section on Parallel Programming, part of the section on Memory Programming, and the figure on signal names:

 

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

Yes.. 

 

Okay now stage 2 of the problem..

 

I had one last atmega2560 IC left.. so i removed the other one from the board and placed this unused atmega.

I burned bootloader.. i burned first sketch.. it went well.. and in the second attempt i am again getting target not answering..But i can say this chip is not dead because once in a while programmer is able to get it into programming mode and read the fuses and stuffs. But most of the time i get target not answering and once in a while i even get wrong signature errors.

 

I checked the connections ( did a continuty test between pins and programmer wires ), Checked connection to crystal, Checked power supply to all vcc and gnd.

All these seems fine. So what might be wrong now?

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

As above, post a photo of your PCB.

 

Also post an accurate schematic of exactly how you have your PCB wired.

 

Show EVERY connection you have made to the chip!

 

JC

 

 

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

i burned first sketch.. it went well.. and in the second attempt i am again getting target not answering

I assume you are 'burning' the sketches via the bootloader, and not ISP?

 

Have you correctly set the fuses for bootloader operation?  If not, this explains your symptoms i.e. first sketch bootload works, subsequent attempts don't.

 

 

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

joeymorin wrote:

i burned first sketch.. it went well.. and in the second attempt i am again getting target not answering

I assume you are 'burning' the sketches via the bootloader, and not ISP?

 

Have you correctly set the fuses for bootloader operation?  If not, this explains your symptoms i.e. first sketch bootload works, subsequent attempts don't.

 

 

 

Now iam avoiding bootloader.. I am burning directly via USBasp..

 

And now i got everythign working when i removed 22pf capacitors from crystal. Now UsbAsp is able to write to it and the program runs fine.. 

I added a different 22pf Capacitor, but if i add those caps it stops working..So whats wrong here ?.

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

Are you sure you've got 22 pF caps?  And not 22 nF 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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

I have attached the PCB photo before soldering the Atmega. My Phone Cam is not working thats why iam not able to click the latest pic, but i guess this pic would give you an idea. 

And at the moment in the present board iam trying i have removed all other peripherals and its at bare minimum now, with just crystal connected. the problem starts when  i add loading capacitor. So i guess the 22pf is too much here ?

Attachment(s): 

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

Yea.. and i had 22pF bought from 2 different vendors. so i tried with the other one too and the result is the same.. And strange thing is i am using same cap on other copies of same board and so far i have not faced any issue..

any tiny things like amount of solder lead and stuff will influence this ?..

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

any tiny things like amount of solder lead and stuff will influence this ?..

Of course.  It's called 'parasitic' capacitance.  22 pF could be a bit too high once you consider that parasitic capacitance.  What crystal are you using?  Part number?  Datasheet?

 

You could try 18 pF, at least until you can determine the ideal value.

 

It looks to me like your crystal and caps don't abide by the rule 'as close to the AVR as possible'  The traces appear to be needlessly long.  It also looks like the ground trace for those caps may be shared by some other components.  That's a no-no.

 

Can you post your PCB layout?

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

with just crystal connected.

Where do you connect it? I don't see any crystal or caps for them on the board.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Where do you connect it? I don't see any crystal or caps for them on the board.

I have attached the PCB photo before soldering the Atmega

I'd guess it's just to the right of the C3 label.

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

If you don't post a schematic it will be difficult to provide further suggestions.

 

Are all four Vcc pins tied to Vcc?

 

Are all four Ground pins tied to Ground?

 

Is AVcc tied to Vcc, either directly or through an LC filter?

 

Is the Ground associated with the AVcc pin tied to Ground?

 

Is ARef either left not connected, or connected to a small cap to Ground, and NOT connected to Vcc?

 

Why does your PCB not have any By-Pass caps installed?

 

You need a small cap, typically 0.1 uF, connected across each Vcc and Ground, and AVcc and Ground, pairs of pins.

These caps need to be VERY close to the micro's pins.

 

As mentioned above, the caps for the Xtal should be close to the Xtal, and both the Xtal and its caps as close to the micro as possible.

 

JC