Author Topic: Bricked ATMega 328P-PU?  (Read 7055 times)

0 Members and 1 Guest are viewing this topic.

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Bricked ATMega 328P-PU?
« on: February 17, 2020, 02:59:08 pm »
Hi.

I have an ATMega 328P-PU IC which will not program for some reason.

I have it hooked up to the Arduino as ISP programmer, which works fine for another 328P-PU IC, so I know my programmer circuit works just fine.

However, when I try to upload a sketch to this one particular IC I get the following output on the screen.

It is worth noting that the IC was working fine before ans has not been mis-used in any way to me knowledge.

Can anyone please advise?

Thanks

 |O

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/paul/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/paul/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

An error occurred while uploading the sketch
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.
« Last Edit: February 17, 2020, 11:42:43 pm by paul_g_787 »
 

Offline GromBeestje

  • Frequent Contributor
  • **
  • Posts: 310
  • Country: nl
Re: Bricked ATMega 328
« Reply #1 on: February 17, 2020, 06:49:04 pm »
This is probably due bad fuses. When the fuses select a clock source that is not available these are the symptoms.
For this to be solved: Have some external clock source (eg, another atmega setting the pin high and low in a loop)
Feed this signal into the XTAL1 pin of the bricked atmega. Then connect with avrdude using a slow clock and reset the fuse.
 
The following users thanked this post: Kim Christensen

Online wraper

  • Supporter
  • ****
  • Posts: 19537
  • Country: lv
Re: Bricked ATMega 328
« Reply #2 on: February 17, 2020, 07:02:40 pm »
Most likely either fuses programmed for crystal oscillator and there is no crystal attached or disabled Reset pin.
 

Offline Eturtle

  • Newbie
  • Posts: 6
  • Country: de
Re: Bricked ATMega 328
« Reply #3 on: February 17, 2020, 10:29:25 pm »
Hi. 10 MHz as SCK is a way too fast. Try use -B 10 at avrdude.
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Bricked ATMega 328
« Reply #4 on: February 17, 2020, 11:38:15 pm »
This is probably due bad fuses. When the fuses select a clock source that is not available these are the symptoms.
For this to be solved: Have some external clock source (eg, another atmega setting the pin high and low in a loop)
Feed this signal into the XTAL1 pin of the bricked atmega. Then connect with avrdude using a slow clock and reset the fuse.

There is a 16MHz clock across pin 9 and 10 with 2x 22pF decoupling capacitors to ground.

As stated, if I swap in the working chip it functions great so I know the crystal is working.

How do I reset the fuse?
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Bricked ATMega 328
« Reply #5 on: February 17, 2020, 11:39:44 pm »
Most likely either fuses programmed for crystal oscillator and there is no crystal attached or disabled Reset pin.

As stated, crystal is attached an working fine. The reset pin is connected to +5V with a 10k pull-up resistor and to 0V with a momentary push button.

When swapping in a working IC then the circuit works fine including the reset button.
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Bricked ATMega 328
« Reply #6 on: February 17, 2020, 11:42:23 pm »
Hi. 10 MHz as SCK is a way too fast. Try use -B 10 at avrdude.

As stated, it is working perfectly with another IC swapped in.

Where do I select this avrdude option to try it anyway?

I am using the Arduino IDE version 1.8.5 from Ubuntu snap named arduino-mhall119.
I am using Ubuntu 18.04.4 LTS
 

Online wraper

  • Supporter
  • ****
  • Posts: 19537
  • Country: lv
Re: Bricked ATMega 328P-PU?
« Reply #7 on: February 17, 2020, 11:48:10 pm »
Did you check if crystal is oscillating? Fuses can be programmed for lower frequency crystal or ceramic resonator, 4 options in total. With high frequency crystal it simply may not start. If RSTDISBL fuse is programmed, then only high voltage programming can bring it back to life.
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Bricked ATMega 328P-PU?
« Reply #8 on: February 19, 2020, 05:43:02 pm »
Did you check if crystal is oscillating? Fuses can be programmed for lower frequency crystal or ceramic resonator, 4 options in total. With high frequency crystal it simply may not start. If RSTDISBL fuse is programmed, then only high voltage programming can bring it back to life.

I haven't got access to an oscilloscope to check this.

Although using the same crystal with a working IC proves the crystal is not faulty.

Is there a way I can check without a scope?
 

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Bricked ATMega 328P-PU?
« Reply #9 on: February 21, 2020, 04:59:33 pm »
Hi.

I have just received two brand new ATMega 328P-U ICs and I am experiencing the same problem with those.

I must be doing something wrong here.  |O

Can anyone please advise?

Thanks
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3890
  • Country: ca
  • Living the Dream
Re: Bricked ATMega 328P-PU?
« Reply #10 on: February 21, 2020, 05:50:04 pm »
The Mega328 is the only Atmel(PIC) processor I've managed to brick by intermittent contact during programming. There was nothing that could be done, the ISP port was dead. I believe the only way to recover it would be via parallel programming. It is possible the glitch was nothing more then disabling ISP programming via fuses of course, but it has never happened with other Atmel's I've worked with during thousands of programmings.
VE7FM
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10095
  • Country: us
Re: Bricked ATMega 328P-PU?
« Reply #11 on: February 21, 2020, 06:16:58 pm »
Google has a lot of hits on how to change the avrdude command line options including:
https://www.asensar.com/guide/arduino_atemlstudio/program-arduino-with-avrdude.html

It would probably be best to start with the default configuration as shown before adding options.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 9179
Re: Bricked ATMega 328P-PU?
« Reply #12 on: February 22, 2020, 03:47:48 am »
It's worth noting the device signature is itself stored in flash, an area which is accessible by undocumented commands -- which may happen due to noise/glitches during programming:

https://www.eevblog.com/forum/microcontrollers/bootloader-on-smd-atmega328p-au/msg268938/#msg268938

If you want to go down that rabbit hole deeper...

https://www.avrfreaks.net/forum/undocumented-signature-row-contents
 
The following users thanked this post: oPossum

Offline paul_g_787Topic starter

  • Frequent Contributor
  • **
  • Posts: 494
  • Country: gb
Re: Bricked ATMega 328P-PU?
« Reply #13 on: February 24, 2020, 05:27:23 pm »
Alright I got the new ICs working. The breadboard was not making good contact on some pins, I have replaced this with a new breadboard and both the brand new 328P-PU ICs work fine.

However I am still experiencing the problem with the old 328P-PU:

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.

I think this must be most likely incorrectly set fuses.. maybe?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->