Hi,
I have narrowed down the problem.
1. The device signature is read as 0x000000
2. Erasing seems to be working correctly with -e switch with avrdude
3. Writing any of the lock/fuse bits results in failure
PFB the avrdude logs:
Code:
G:\debojit\electronics project\arduino-1.0.4-windows\arduino-1.0.4\hardware\tools\avr\bin>avrdude -C ..\etc\avrdude.conf -v -p atmega8 -c avrisp -P \\.\COM6 -b 19200 -U lock:w:0x3F:m -F -V
avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "..\etc\avrdude.conf"
Using Port : \\.\COM6
Using Programmer : avrisp
Overriding Baud Rate : 19200
AVR Part : ATMEGA8
Chip Erase delay : 10000 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 4 20 128 0 no 512 4 0 9000 9000 0xff 0xff
flash 33 10 64 0 yes 8192 64 128 4500 4500 0xff 0x00
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
calibration 0 0 0 0 no 4 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.09s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA8 is 1E 93 07
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):
Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.17s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x3f != 0x00
avrdude: verification error; content mismatch
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: Fuses OK
avrdude done. Thank you.
All the fuses are set as 0x00, but when it is tried being overwritten, it results in writing failure.
But the thing is: with the same chip connection i was able to burn bootloader on the chip. I have two atmega and both of them are behaving in the same way.
One more thing: When I remove the mosi miso sck connections (only arduino's 10 is connected to reset pin of target atmega-pin 1), the same error comes out; seems no connection are there between atmega's 17,18,19 and arduino's 11,12, and 13. However i have checked the connection atleast 100 times, even with digital multimeter, and they are fine. To disable auto reset on serial connection on arduino, i added 10uf between pin-1 and ground, and 110 ohm between pin-1 and Vin. Also for the target atmega i have added a 10k between pin-1 and Vin. I am not able to figure out why device signature is coming as 0x000000. Did I brick the chip. And if it is bricked, what wrong i would have done. I need to know this because if i buy new costlier chips (atmega328) i should not damage the chip.
Please help.
Thanks in advance.
Debojit