Electronic – AVR Atmega32 flash verification error

avravrdude

I just got an Atmega32A chip and I've been trying to program it with a usbasp for quite a few hours. I can change the fuses and write the program, but verification fails.

I'm getting this message after verification:

avrdude -c usbasp -p m32 -u -U flash:w:first.hex

verification error first mismatch at byte 0x0000

0x0c != 0x00

I'm connecting according to this diagram here:
schematic

The chip can be erased and fuses can be changed, my only problem is with the verification. The program seems to be written to memory but my LEDs aren't blinking.

Could this be a problem with my connections? Can anyone point me to a better programming schematic?

Best Answer

Have you been able to verify at all that the device is responding at any level? You say you programmed the fuse bits, but have you been able to verify that they were actually changed?

According to the data sheet:

The SPI Serial Programming instructions will not work if the communication is
out of synchronization. When in sync. the second byte ($53), will echo back
when issuing the third byte of the Programming Enable instruction. Whether
the echo is correct or not, all four bytes of the instruction must be
transmitted. If the $53 did not echo back, give RESET a positive pulse and
issue a new Programming Enable command.

Perhaps you could see if you can test this, either with an option to/modification of avrdude, or even just looking with a scope to see if the miso line is wiggling at all?

I'd think the question has aged enough that if it's still an issue, ordering any older chips from the atmega8/16/32 family to test the programmer would be worthwhile.

The atmel literature seems to imply that the change are primarily fab process related, so it's possible that the new device might be more noise sensitive in some respects.