0

I am trying to burn a bootloader onto an ATmega328P-AN using an Microcenter knock-off Arduino Uno R3 as my ISP for several days with no luck. The farthest I've gotten is writing and reading a few fuses prior to bootloader burn.

I have checked and rechecked the connections:

Uno    ATmega328P-AN
GND    GND
VCC    VCC
MISO   MISO
MOSI   MOSI
SCK    SCK
SS     RESET
  • I have a 2.2 uF cap from ground to RESET on my Uno, and a 16 MHz crystal with two 22 pF load caps to ground on my ATmega328P's XTAL pins.
  • I have ArduinoISP loaded onto the Uno and my bootloader target is "Arduino Pro or Pro Mini", and my processor is set to "ATmega328P (5V 16MHz)".

I am using Arduino 1.8.9 on Windows 10.

Things I've tried:

  • Multiple boards and ATmega328P ICs - No difference.

  • Burning a bootloader to an Ebay Arduino Pro Mini knockoff, which worked, but there's no obvious electrical difference between this part and a raw ATmega328P. (Weirdly, the slight progress I made (setting some fuses - see below) was done by bypassing the DTR-cap-pullup reset path and running the ISP SS directly to the reset pin on the ATmega328P chip.)

  • Using Arduino IDE 1.0.x - No success.

  • Using a genuine Arduino Uno R1. No success.

  • Checking all the rails. I have a clean 5V and a clean ground. Unfortunately my lousy scope isn't picking up any of the 16 MHz oscillators, so I'm not sure what my clocks are up to.

  • In-circuit programming in a populated board with flying leads from the appropriate ICSP nodes. No success.

  • In-circuit programming with fresh board and just a power supply bypass cap, oscillator, load caps, and supply rails available.

Here's my Arduino IDE terminal output:

    C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/bin/avrdude -CC:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m 

    avrdude: Version 6.3-20171130
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch

             System wide configuration file is "C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"

             Using Port                    : COM3
             Using Programmer              : arduino
             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 : Arduino
             Description     : Arduino
             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 = 0x1e950f (probably m328p)
    avrdude: erasing chip
    avrdude: reading input file "0x3F"
    avrdude: writing lock (1 bytes):

    Writing | ################################################## | 100% 0.01s

    avrdude: 1 bytes of lock written
    avrdude: verifying lock memory against 0x3F:
    avrdude: load data lock data from input file 0x3F:
    avrdude: input file 0x3F contains 1 bytes
    avrdude: reading on-chip lock data:

    Reading | ################################################## | 100% 0.01s

    avrdude: verifying ...
    avrdude: 1 bytes of lock verified
    avrdude: reading input file "0xFD"
    avrdude: writing efuse (1 bytes):

    Writing | ################################################## | 100% 0.02s

    avrdude: 1 bytes of efuse written
    avrdude: verifying efuse memory against 0xFD:
    avrdude: load data efuse data from input file 0xFD:
    avrdude: input file 0xFD contains 1 bytes
    avrdude: reading on-chip efuse data:

    Reading | ################################################## | 100% 0.01s

    avrdude: verifying ...
    avrdude: 1 bytes of efuse verified
    avrdude: reading input file "0xDA"
    avrdude: writing hfuse (1 bytes):

    Writing | ################################################## | 100% 0.02s

    avrdude: 1 bytes of hfuse written
    avrdude: verifying hfuse memory against 0xDA:
    avrdude: load data hfuse data from input file 0xDA:
    avrdude: input file 0xDA contains 1 bytes
    avrdude: reading on-chip hfuse data:

    C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/bin/avrdude -CC:\Users\xxx\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b19200 -Uflash:w:C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.23/bootloaders/atmega/ATmegaBOOT_168_atmega328.hex:i -Ulock:w:0x0F:m 
    Reading | ################################################## | 100% 0.01s

    avrdude: verifying ...
    avrdude: 1 bytes of hfuse verified
    avrdude: reading input file "0xFF"
    avrdude: writing lfuse (1 bytes):

    Writing | ################################################## | 100% 0.02s

    avrdude: 1 bytes of lfuse written
    avrdude: verifying lfuse memory against 0xFF:
    avrdude: load data lfuse data from input file 0xFF:
    avrdude: input file 0xFF contains 1 bytes
    avrdude: reading on-chip lfuse data:

    Reading | ################################################## | 100% 0.01s

    avrdude: verifying ...
    avrdude: 1 bytes of lfuse verified

    avrdude done.  Thank you.


    avrdude: Version 6.3-20171130
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2014 Joerg Wunsch

             System wide configuration file is "C:\Users\jms\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"

             Using Port                    : COM3
             Using Programmer              : arduino
             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 : Arduino
             Description     : Arduino
             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 = 0x000000 (retrying)

    Reading | ################################################## | 100% 0.01s

    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.

If I try to burn the bootloader again, I just get the "Device signature = 0x000000 (retrying)" messages, but no fuse write/read cycles.

My circuit

I am really stumped at this point. Questions

  • Am I bricking my ATmega328P parts when the bootloading process is not successful?

  • What am I missing?

  • 1
    Do yourself a favour and get a proper programmer, rather than using an Arduino. Remove that link from the chain. A USBASP costs <$5 from eBay/Amazon/AliExpress. – Majenko May 7 at 9:41
  • That was my next step. What makes the Arduino a poor programmer? – schadjo May 7 at 12:15
  • 1
    It's not so much a bad programmer - it's awkward and easy to get it wrong. Far simpler to stick to something that is designed for the task - plug in and go. – Majenko May 7 at 12:19
  • Cool. A programmer is on the way, and we'll see what happens. – schadjo May 7 at 12:20
  • 1
    No, not normally. The main way of bricking one is to get the fuses wrong so it needs an external clock. For that you need to apply a 1MHz clock signal to the crystal input to get it to work again. Or use a High Voltage Programmer (Nick Gammon has a tutorial on doing it IIRC). – Majenko May 7 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.