Go Down

Topic: Burning Bootloader to Atmega 328p (Read 658 times) previous topic - next topic

henrypgill

I am trying to load the standard arduino bootloader onto an Atmega328P according to the minimal configuration in this tutorial: https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

Every time I attempt to load the bootloader onto the atmega328p I get the error message:
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.

I have checked all my wiring and it is correct, I wish to do this without using an oscillator or capacitors and by using the internal 8mhz clock on the atmega328p. below is the verbose output during upload.

Code: [Select]

Arduino: 1.8.12 (Mac OS X), Board: "ATmega328 on a breadboard (8 MHz internal clock)"

/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/cu.usbmodem14101 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xE2:m

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

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/Henry/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem14101
         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.02s

avrdude: Device signature = 0x000000 (retrying)

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

avrdude: Device signature = 0x000000 (retrying)

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

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"
option enabled in File -> Preferences.


the Segment for the 8Mhz atmega328p board configuration I am using in my boards.txt file is:
Code: [Select]

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

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.protocol=stk500
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=57600

atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.path=arduino:atmega
atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F
atmega328bb.bootloader.tool=avrdude

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard


And my avrconf.txt is as it came originally. Does anyone have any idea as to how to fix this?

DrAzzy

First, there is no need to futz about with your own board def, just install MiniCore - https://github.com/MCUdude/MiniCore - has everything all set up for almost any conceivable clock speed and set of configuration options for the atmega x8/x8p/x8pb parts - it is by far the easiest way to work with bare-bones/custom atmega-based boards that don't match the clock configuration of an official board (he also maintains similar cores for the atmega x4 (MightyCore) and x1/x0 (MegaCore), and the megaavr x08 and x09 series (MegaCoreX), just like I do for the ATtiny parts).

But that's not related to the issue at hand - either you have a wiring mistake, or the chip was previously set to use an external crystal (in which case, you need to provide a crystal or clock source in order to program it not to expect one).

By the way - you do realize that no matter what, you need a 0.1uF ceramic cap between vcc and ground pin, and avcc and gnd, and these must be right next to the chip. Without these, the part may reset or hang seemingly at random; these "decoupling caps" are needed between power and ground on all digital ICs, 0.1uF unless datasheet says otherwise), and they always need to be as close to the part as possible.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up