Avr signature doesn’t match, flash address 0x0000 wrong

avrflashmicrocontroller

I'm new to electronics.

I've bought an ATmega32 (a link to docs) and I'm trying to light up a single LED. I have managed to do it a few times, but then I tried to change the hookup wires to a single 10 pin wire and after a few failures, I went back to wires.

The problem is, when I try to program the device, it gives me a warning:

WARNING: FLASH byte address 0x0000 is 0x00 (should be 0x0C).. FAILED!

When I read the signature of the device straight after plugging it in, it says it's

0x1E 0x95 0x02

and it says it matches the device.
Then when I try to erase it (or program it), I got the mentioned warning. Also, after doing this, when I read the signature of the device, it reads it from the device as

0x00 0x01 0x02

There's also a warning that 'signature does not match selected device'.
I can erase the device and it says that erasing device was OK.

I'm not sure if that's relevant or not, but I've also realised that fuse bits (low to high) are at the beginning 0xE1 0x99 and later 0x04 0x04 and after erasing it changes the

SUT_CKSEL Int. RC Osc. 1 MHz; Start-up time: 6 CK + 64 ms; default value

to

SUT_CKSEL Int. RC Osc. 8 MHz; Start-up time: 6 CK + 0 ms

(it also changes some other fields there as well, e.g. brown-out detection from VCC=2.7V to 4.0V)

I'm using AVR Studio 4.18.716, and a JTAG ICE programmer.

Is there anyway I could fix this or have I killed it?

Best Answer

Most likely you are running the programmer at too high of a bit rate. The bitrate can be set on the command line with the -B N flag, where N is the period of the programmer SCK signal in microseconds. Try something high like -B 100 and see if you get more consistent results. The following link seems to show how you would set this up in AVR Studio (v4): Atmel STK500 Programming.

Related Topic