Unable Bootloader on ATmega328-AU TQFP32 through Arduino Uno

Hi Guys,

I'm trying to burn the Optiboot Bootloader on a ATmega328-AU TQFP32(conrad) through Arduino Uno but unsuccessfully. I modified yesterday the Signature of the "avrdude.conf" like that:

part parent "m328"
id = "m328p";
desc = "ATmega328P";
signature = 0x1e 0x95 0x14;

ocdrev = 1;

So 0x0F to 0x14 but I still got this error:

avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

I tried many configurations: Arduino 1.6.6
*Config 1: -Board Arduino/Genuino Uno

  • Programmer: Arduino as ISP
    *Config 2: -Board : LilyPad Arduino
  • Programmer: Arduino as ISP

I think the frequency 20MHz of the ATmega328-AU TQFP32 doesn't match with the programming frequency. What do you think about?

I will be greatful to read your solutions about this Problem.
when I tried to burn ArduinoISP on this chip ATmega328-AU TQFP32 I get this error:

avrdude: Expected signature for ATmega328P is 1E 95 14
Double check chip, or use -F to override this check.

(deleted)

spycatcher2k commented while I was writing but just since these instructions are more complete I'll post it anyway.

Please do this:

  • File > Preferences > Show verbose output during: > upload(check) > OK
  • Tools > Burn Bootloader
  • After it fails you will see a button on the right side of the orange bar "Copy error message". Click that button.
  • Paste the error in a message here USING CODE TAGS(</> button on the toolbar).

I tried again to burn the bootloader as Pert said. I get that:

< Arduino: 1.6.6 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM4
Using Programmer : stk500v1
Overriding Baud Rate : 19200
AVR Part : ATmega328P
Chip Erase delay : 9000 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 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
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.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
/>

could you help me please?

Thank you in advance!

I tried now with the LilyPad Arduino as Board selected and the Processor ATmega328. That is the verbose Output:

Arduino: 1.6.6 (Windows 7), Board: "LilyPad Arduino, ATmega328"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 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        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

Thank you in advance!

(deleted)

what do you mean with normally wiring ? or you try to say that the wiring is faulty or incorrect?

They mean that getting a device signature of 0x000000 is normally an indication that your wiring is faulty(bad cable or connection) or incorrect(wires not connected or wires connecting the wrong pins).

I check my wiring again and i don't see any problem.
Please check the Picture attachement:
with the Board LilyPad Arduino and Processor: ATmega328 I get the following verbose Output by burning the Bootloader:

Arduino: 1.6.6 (Windows 7), Board: "LilyPad Arduino, ATmega328"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 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        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.00s

avrdude: Device signature = 0xffffff (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0xffffff (retrying)

Fehler beim Brennen des Bootloaders.
Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

When I tried to burn the bootloader now with Arduino/genuino Uno set as Board I get this error:

Arduino: 1.6.6 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM4 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 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        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.01s

avrdude: Device signature = 0xffffff (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0xffffff (retrying)

Fehler beim Brennen des Bootloaders.
Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

NB: please note that I modified the Signature in the "avrdude.conf" like that:

part parent "m328"
    id               = "m328p";
    desc        = "ATmega328P";
    signature        = 0x1e 0x95 [color=red]0x14;[/color]

    ocdrev              = 1;

0x000000 is usually wiring or chip set to use crystal but no crystal connected.

0xffffff is almost invariably a wiring problem.

Check your wiring with an ohm meter, including checking for shorts to vcc or gnd

take a look to the attachement to how my wiring looks like.
why should I still get the error although I change the signature in the "avrdude.conf" file:
avrdude: Expected signature for ATmega328P is 1E 95 14
Double check chip, or use -F to override this check.
what should I do to get the bootloader burned on the ATmega328-AU TQFP 20MHz with Arduino Uno.

DrAzzy you are right a didn't use an external crystal because I thought. It could also burn the Bootloader whithout an external crystal.

Any suggestions?
Please help me!

Thank you.

Foks50:
take a look to the attachement to how my wiring looks like.

That looks good but it doesn't show the entire picture. You also need to be using the right pins on the Uno and you need to connect those to the right pins on the ICSP header. It's very easy to forget which end is which on the header and connect to it backwards.

Foks50:
why should I still get the error although I change the signature in the "avrdude.conf" file:
avrdude: Expected signature for ATmega328P is 1E 95 14
Double check chip, or use -F to override this check.

The signature you put in avrdude.conf is correct for ATmega328 but you need to look at the entire error:

avrdude: Device signature = 0xffffff

It doesn't matter that you put the right signature because the signature being read from the chip is wrong so it will never verify.

Foks50:
When I tried to burn the bootloader now with Arduino/genuino Uno set as Board

When you do that avrdude sets the fuses to use an external crystal oscillator. If there's no external crystal connected then you effectively just "bricked" your chip. But not to worry. You only need to connect a crystal long enough to set the fuses back to using the internal oscillator.

Burn bootloader is 2 step process - it first sets the fuses, then writes the flash.

If you select Uno board (or any other board that uses a crystal) and attempt to do "burn bootloader", it will write the fuses, exit programming mode (thus latching the fuses) and then attempt to write the flash. The fuses are now telling it that it's using an external crystal, however, and no such crystal is present - as a result, the chip cannot be programmed (ISP programming requires the clock speed to be at least 6 times the SPI clock iirc - something like that, at least - and without a crystal, the system clock is non-existent), and the signature will read as 0x000000. Installing a crystal (and appropriate loading caps) and doing burn bootloader again will fix this.

I just want to know now. Do I need to connect on y ATmega328-AU TQFP32 all the VCC pins together and all GND together?
Or may be it doesn't matter to have them all connected together.

Greatly Thank you!

You probably don't need to connect all of the VCC and GND pins for programming but you should in your final design.

Try adding a crystal (4 to 20 MHz, whatever is handy) to XTL1 and XTL2 pins. You may not need the loading capacitors (20 pF from each pin to GND). If you can't find a spare crystal or you try the crystal and still get the "Device signature = 0x000000" error you should get this modified ArduinoISP sketch from adafruit: GitHub - adafruit/ArduinoISP: A fork of the ArduinoISP that has 8mhz output clock Upload this version of ArduinoISP to your ISP Arduino. Connect Pin 9 of the ISP Arduino to the XTL1 pin of the target processor. That will provide an 8 MHz clock to allow programming without a crystal.

Dear Mr Pert,
Dear Mr DrAzzy,
Dear Mr Johnwasser,

I could reply for 2 Weeks because I was sick. But now it's evrything fine. The great News: It Works!!!

a Big Thank to Mr Pert and Mr DrAzzy

Special thanks to Mr Johnwasser because I was be abble to burn the Bootloader on the chip only with the Crystal 16 000MHz on XTAL1 and XTAL2 without capacitors. I am proud to see a forum like that where the questions have been faster satisfactorily answered.

Thank you All

SOLVED

Congratulation! Both you and the project are fine.
Expecting your next project :slight_smile:

I removed the external Crystal after succesfully loaded my sketch up. Now I get no Voltage on the Pins declarated as Outputs in my Sketch

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328
         Chip Erase delay              : 9000 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        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.01s

avrdude: Device signature = 0x1e9514
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "C:\Users\afo\AppData\Local\Temp\builda3cfce4cb6cfa3c5e1ed260185e98ea6.tmp/TEST_ESBK.ino.hex"
avrdude: writing flash (2298 bytes):

Writing | ################################################## | 100% 2.52s

avrdude: 2298 bytes of flash written
avrdude: verifying flash memory against C:\Users\afo\AppData\Local\Temp\builda3cfce4cb6cfa3c5e1ed260185e98ea6.tmp/TEST_ESBK.ino.hex:
avrdude: load data flash data from input file C:\Users\afo\AppData\Local\Temp\builda3cfce4cb6cfa3c5e1ed260185e98ea6.tmp/TEST_ESBK.ino.hex:
avrdude: input file C:\Users\afo\AppData\Local\Temp\builda3cfce4cb6cfa3c5e1ed260185e98ea6.tmp/TEST_ESBK.ino.hex contains 2298 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.40s

avrdude: verifying ...
avrdude: 2298 bytes of flash verified

avrdude done.  Thank you.

Any Idea about the Issues ???

First declare that my English is not very good

But I would like to know why this Mr Johnwasser method can be used

taco111:
I would like to know why this Mr Johnwasser method can be used

If the fuses of the microcontroller are set for an external clock source and you don't have an external clock source connected then the microcontroller will not be able to run, even though it has an internal clock source because it's configured to use the non-existent external clock. This often leads to a situation where people "brick" their bare chips by accidentally having a board that uses an external oscillator selected from the Tools > Board menu when they do Tools > Burn Bootloader, which sets the fuses for the external clock source. The solution is to provide some sort of an external clock source temporarily just long enough to set the fuses to use the internal oscillator. After that the external clock source is no longer necessary and your microcontroller is usable again.