Problem with burning bootloader to AtMega 328p-AU

I have build a circuit with a AtMega328P-AU microcontroller. Now I want to burn the bootloader to the chip but I cant get it to work. I used an Arduino Uno to do this but I always get this error:

avrdude: verification error, first mismatch at byte 0x0000
0x00 != 0x3f

This is the whole output: C:\Users\phili\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-ardu -

My circuit is attached to this post.

Does anyone know how I can fix this issue?

Schematic_Heizung_Final_2020-09-26_12-25-37.pdf (71.3 KB)

Here's some pointers that spring to mind that may suggest why you can't program your 328p:

  • It's not clear to me if any of the VCC, AVCC or GND pins on the 328p are actually connected to anything.
  • Decoupling capacitors - some 100n capacitors on the supplies.
  • AREF looks to be wired up wrong.
  • Why not stick to the standard 6-pin programming header pinout?

There's probably some others too.

And maybe have a look at this discussion too for some pointers.

First, try setting the fuses and burning the bootloader first, and only setting the lock bits at the end. By the way, it appears that erasing the chip with -e already clears the lock bits to 0x3F. At the end of an IDE bootloader burning session the lock bits read back as 0x0F, so I assume the IDE thinks that's the right value.

Second, if you are using the Uno as ISP as the programmer, try using the -carduino option. I don't know if it makes any difference, but this works for me when using a Nano as ISP to burn the bootloader to a Pro Mini 8MHz, which also uses the 328P:

avrdude -C C:\Arduino\hardware\tools\avr\etc\avrdude.conf -c arduino -p m328p -P com4 -b 19200 -U flash:w:ATmegaBOOT_168_atmega328_pro_8MHz.hex

Third, nothing works for me (either the IDE or AVRdude) unless I have a 10uF cap installed on the Reset pin of the programmer Nano.