Bricked ATMega 328P-PU? - Page 1
Forum section: electronics / general

author: paul_g_787
author_rank: Frequent Contributor
timestamp: February 17, 2020, 02:59:08 pm
content: 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?Thanksavrdude: Version 6.3-20190619Copyright (c) 2000-2005 Brian Dean,http://www.bdmicro.com/Copyright (c) 2007-2014 Joerg WunschSystem 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, skippingUsing Port : /dev/ttyACM0Using Programmer : stk500v1Overriding Baud Rate : 19200AVR Part : ATmega328PChip Erase delay : 9000 usPAGEL : PD7BS2 : PC2RESET disposition : dedicatedRETRY pulse : SCKserial program mode : yesparallel program mode : yesTimeout : 200StabDelay : 100CmdexeDelay : 25SyncLoops : 32ByteDelay : 0PollIndex : 3PollValue : 0x53Memory Detail :Block Poll Page PolledMemory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xffflash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xfflfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00Programmer Type : STK500Description : Atmel STK500 Version 1.x firmwareHardware Version: 2Firmware Version: 1.18Topcard : UnknownVtarget : 0.0 VVaref : 0.0 VOscillator : OffSCK period : 0.1 usavrdude: AVR device initialized and ready to accept instructionsReading | ################################################## | 100% 0.02savrdude: Device signature = 0x000000 (retrying)Reading | ################################################## | 100% 0.02savrdude: Device signature = 0x000000 (retrying)An error occurred while uploading the sketchReading | ################################################## | 100% 0.02savrdude: Device signature = 0x000000avrdude: Yikes! Invalid device signature.Double check connections and try again, or use -F to overridethis check.avrdude done. Thank you.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: February 17, 2020, 06:49:04 pm
content: 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.

author: wraper
author_rank: Unknown
timestamp: February 17, 2020, 07:02:40 pm
content: Most likely either fuses programmed for crystal oscillator and there is no crystal attached or disabled Reset pin.

author: Eturtle
author_rank: Newbie
timestamp: February 17, 2020, 10:29:25 pm
content: Hi. 10 MHz as SCK is a way too fast. Try use -B 10 at avrdude.

author: paul_g_787
author_rank: Frequent Contributor
timestamp: February 17, 2020, 11:38:15 pm
content: Quote from: GromBeestje on February 17, 2020, 06:49:04 pmThere 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?

author: paul_g_787
author_rank: Frequent Contributor
timestamp: February 17, 2020, 11:39:44 pm
content: Quote from: wraper on February 17, 2020, 07:02:40 pmAs 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.

author: paul_g_787
author_rank: Frequent Contributor
timestamp: February 17, 2020, 11:42:23 pm
content: Quote from: Eturtle on February 17, 2020, 10:29:25 pmAs 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

author: wraper
author_rank: Unknown
timestamp: February 17, 2020, 11:48:10 pm
content: 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.

author: paul_g_787
author_rank: Frequent Contributor
timestamp: February 19, 2020, 05:43:02 pm
content: Quote from: wraper on February 17, 2020, 11:48:10 pmI 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?

author: paul_g_787
author_rank: Frequent Contributor
timestamp: February 21, 2020, 04:59:33 pm
content: 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.Can anyone please advise?Thanks

author: TheSteve
author_rank: Unknown
timestamp: February 21, 2020, 05:50:04 pm
content: 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.

author: rstofer
author_rank: Super Contributor
timestamp: February 21, 2020, 06:16:58 pm
content: 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.htmlIt would probably be best to start with the default configuration as shown before adding options.

author: amyk
author_rank: Super Contributor
timestamp: February 22, 2020, 03:47:48 am
content: 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/#msg268938If you want to go down that rabbit hole deeper...https://www.avrfreaks.net/forum/undocumented-signature-row-contents

author: paul_g_787
author_rank: Frequent Contributor
timestamp: February 24, 2020, 05:27:23 pm
content: 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 = 0x000000avrdude: Yikes! Invalid device signature.I think this must be most likely incorrectly set fuses.. maybe?