Hello everyone,
I have an atmega 328p-pu chip set up on a breadboard. I use a arduino 2560 to program it. I have been running this set up for more than a month for simple projects and have written many times on the 328 chip without any problem.
Today I adjusted the time of the rtc (ds 1307) which is sitting at one corner of the same breadboard connected with the 328p. The time adjusting sketch got uploaded properly to the 328 but after that the 328 refuses to get reprogrammed. It shows the error
avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.
I have cross checked all connections several times, downloaded fresh version of arduino ide, reset and reuploaded arduino-isp sketch to the arduino 2560, checked usb cable, changed ports, disconnected all wires from the 328 leaving only the 16 mHz xtal and its 22pF caps and power wires...and did everything else I know but it doesn't seem to help. It gives the same problem.
(I googled about this and read at a site that its quite easy to accidentally erase the signature bytes. Is this same case?!?!)
Can any body say what's wrong and how can I again upload sketches to the 328p chip?
Thanks.
Do you program it without the bootloader ? So you have the Arduino Mega 2560 as programmer ?
Does avrdude return zero for the signature ?
Perhaps the ATmega328p is broken or the crystal is broken.
I hope you have a bunch of ATmega328p chips. Fiddling around with an ATmega chip on breadboard can easily damage the chip. With bad connections of the breadboard, or static electricity or a loose 12V wire. Perhaps I'm wrong, but I think most of us have had that.
Thanks for the reply.
I had burned the bootloader when the 328 was brand new. After that I would directly burn the sketchs using the Mega and it worked without any problem.
No, the avrdude does not ruturn any value. it just says "avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override this check." and nothing else.
I have tried with 3 different crystals but the same error pops up! Actually i didn't take out the chip for a while from the breadboard. I power it from a regulated 5V power supply so no over voltages that may kill it.
I was searching the internet and tried the instructions from here: Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board
"Test the Chip" test shows only "Atmega chip detector." with xtal, without xtal and with external clock. Does that mean it didnt enter programming mode??
I also tried "Programming the Bootloader" from that page and the result is attached in the screenshot.
May be the chip is permanently damaged. But I'm not sure...Can any one tell me how to check that?
It means the you didn't enter the programming mode.
Don't use the -F flag with avrdude. If you can run avrdude in a command line, try using -v or -vv or -vvv
It is hard to tell if the chip is actually damaged. You need another one to test that. But everything points in that direction.
As you said I tried running avrdude in command line. I tried to upload the blink sketch and used -v, -vv and -vvv. For -v and -vv I got the same result. But when using -vvv I got something which looked the same but in a different way. I am posting what I got.
This is what i got when using -v and -vv:
C:\>avrdude -P COM10 -b 19200 -c avrisp -p m328p -vv -U flash:w:"C:\Users\Atreya\Desktop\Blink.cpp.hex":i
avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"
Using Port : COM10
Using Programmer : avrisp
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 5 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 AVR ISP
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.08s
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.
I have changed breadboard, checked all the power and ground, xtal, caps with multi-meter but all seems ok.
Any suggestions whats going on? As I dont understand much what all these things are.
Signature is indeed all zeros. When avrdude reads the line, it reads zero. The chip is damaged or doesn't have power or wiring is wrong.
Since you checked everything, it is probably a blown chip.
Thanks a lot Caltoa for assisting me. I'm sure the chip is history now This is the first atmega chip that i blew up...so I was a little confused at first. Now its time to buy new chips...
Thanks again.