Problem while burning Bootloader ("verification error; content mismatch")

Hi everybody

I'm trying to bring up the bootloader to a ATMEGA168PA-PU. I have already added that kind of device to the boards.txt.

##############################################################

diecimilaP.name=Arduino Diecimila, Duemilanove, or Nano w/ ATmega168P

diecimilaP.upload.protocol=stk500
diecimilaP.upload.maximum_size=14336
diecimilaP.upload.speed=19200

diecimilaP.bootloader.low_fuses=0xff
diecimilaP.bootloader.high_fuses=0xdd
diecimilaP.bootloader.extended_fuses=0x00
diecimilaP.bootloader.path=atmega
diecimilaP.bootloader.file=ATmegaBOOT_168_diecimila.hex
diecimilaP.bootloader.unlock_bits=0x3F
diecimilaP.bootloader.lock_bits=0x0F

diecimilaP.build.mcu=atmega168P
diecimilaP.build.f_cpu=16000000L
diecimilaP.build.core=arduino

The Board being burned is a Duemilanove. The programmer is a USBtinyISP V3.0.

And now the Problem: I almost get an Error like this:

avrdude: verification error, first mismatch at byte 0x3a00
0x81 != 0x85
avrdude: verification error; content mismatch

The interesting thing is, that it is not always at the Same place!
Next time its this:

avrdude: verification error, first mismatch at byte 0x3800
0x0c != 0xff
avrdude: verification error; content mismatch

it's really random.
Once the boot loader could be burned. But that was just one time.
So I think, there is a problem during the transmission. May be a bad link.
Is there any way to slow down the transmission speed? Or has anybody an other idea to solve that Problem?

Sorry for my bad English.

Regards,
Jens

Sounds to me like one of the following:

  • faulty or excessively long wiring
  • bad power supply
  • you have something else connected to one of the MISO, MOSI and SCLK pins that is interfering with programming

If it's a home-made board, the following might also be causing the problem:

  • wrong value capacitors connected to the crystal pins of the atmega168 or no capacitors connected
  • no decoupling capacitor between atmega168 Vcc and ground pins

Hi dc42,
thanks for your answer.

That's my composition:

The Arduino is supplied by the Programmer.

  • faulty or excessively long wiring
  • bad power supply

I don't think, that the cable is to long.
But maybe I should try to supply the Arduino Board via USB. (I know, I have to remove the Jumper before)

Jens

nonesense:
But maybe I should try to supply the Arduino Board via USB. (I know, I have to remove the Jumper before)

It was not the solution :frowning:

From the photo, your setup looks fine to me. But I've no experience of the USBTinyISP, I use the AVRISPmkII.

Try plugging in a power source (eg. a 9V battery) to the Arduino while programming it. If that doesn't work I suggest slowing down the programming rate. Not sure exactly how to do that when programming from the IDE.

However try locating the avrdude configuration file: avrdude.conf

Inside that locate the progammer you are using, and add a baudrate line, eg.

programmer
  id    = "usbtiny";
  desc  = "USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/";
  type  = usbtiny;
  baudrate = 9600;    # default is 115200   <--- add a slower baud rate here

Or, try uploading the bootloader file from the command line, eg.

 avrdude -c usbtiny -p m328p -U flash:w:optiboot_atmega328.hex -B9600

Where "optiboot_atmega328.hex" is the file name (pathname) of the bootloader you want to use, and -B9600 is the (slower than usual) baud rate you are trying to use.

Now it works more often :smiley:
Thanks!