"Yikes!" ~ Programming a breadboard microcontroller.

Hi! I've been trying to get a ATMega328P chip programmed using a sparkfun redboard (Just a Arduino Uno). I've wired it up as posted in the the tutorial as shown in this image. I have tried with and without the 10uF capacitor between the programmer's reset and ground (because most tutorials disagree on whether or not this is an important step). My process is as follows:

  • Upload "ArduinoISP" to the redboard.
  • Connect the breadboard arduino
  • Select "Breadboard AtMega328P with 8MHz internal clock" and "Arduino as ISP"
  • Press "Burn Bootloader"

I get the following (verbose) output every time:

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 "D:\Shared\Program Files\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.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

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.

Error while burning bootloader.

What am I doing wrong? Is it because I'm using a third-party board? One of the main selling points of this thing are that it works as a programmer! :P

Thanks for any insight!

Forgot to mention: This AtMega328 chip was sold by adafruit with a custom bootloader installed. I have tried uploading sketches (before I was trying to burn the bootloader) and it would tell me the device sync failed. Whenever I did get it to work, it would end up not programming the breadboard controller, but rather the programmer board.

Fuzzyzilla: This AtMega328 chip was sold by adafruit with a custom bootloader installed.

If it is this ATmega328P from Adafruit it will not work with your setup like this:

The micro controller you have, has set the fuses in a way so it does need external 16 MHz crystal. It will not work without. Even burning a bootloader is not possible. So your setup has to be like this:

Once you have this setup (with external crystal), you can burn the bootloader (which will also set the fuses) like you planned to: Breadboard ATmega328P with 8MHz internal clock.

Edit: 2 minutes late... :) After that you can remove the crystal and the ATmega328P will work with internal clock.

Thanks, but it still doesn't work even after my Eureka moment. Same errors, "cannot sync"

I'm pretty frustrated right now...

Sync error when doing burn bootloader via Arduino as ISP typically indicates that you have not successfully disabled autoreset. Is a cap between reset and ground present?

Yes, there is a 10uF cap.

I don't know if this is helpful, but:

When I try to upload...

The pin 13 LED goes crazy, RX pulses a few times, TX does nothing

Using stk500v1 programmer type means that there is not reset pulse (DTR, RTS) at start of programming from the computer to Arduino as ISP, so the 10uF cap is not necessary. Zero response indicates more that programmed MCU didn't start - probably missing clock. Moreover, if it was not raw chip, the fuses were set to external clock use with high probability. Your setup should be as on the 2nd picture in #2 response from uxomm. Arduino as ISP works pretty reliably for me.

First, check you wiring carefully again, especially the crystal and clock signal - it should be cca 2.5V DC on XTAL1 pin (pin 9 of DIL28) of ATmega328. Any cheap DMM for 5EUR is enough to do this.

Using stk500v1 programmer type means that there is not reset pulse (DTR, RTS) at start of programming from the computer to Arduino as ISP, so the 10uF cap is not necessary.

The (original) elegance of the auto-reset feature is that some operating systems and/or drivers would drop DTR (ie make it "true") when the PC-side sketch opened the serial port; no explicit toggling in the AVRDude code was needed. I'm not sure what changed, that the "arduino" programmer type was added (and it DOES do an explicit DTR/RTS pulse) (avrdude has changed in other ways, we're 3 generations of OS later, and have a bunch of different USB/Serial chips with different drivers), but you are NOT safe assuming that an auto reset will not occur, just because you are using -cstk500v1. The 10uF cap is always a good idea.

I don't know what's wrong with your bootloading attempt. signature 0 can indicate bad wiring, lack of target clock, and who knows what else; it's pretty all-inclusive :-( I suggest using Nick Gammon's Bootloader-loader sketch instead of the "burn bootloader" process.

Fuzzyzilla: Thanks, but it still doesn't work even after my Eureka moment. Same errors, "cannot sync"

I'm pretty frustrated right now...

Me too. I wasted many times to upload the sketch to a breadboard microcontroller. But It's unlucky with several failures. Nothing ỉncorrect here but it seems that the connection, crystal and capacitors all are not stable enough to get in done successfully.

Finally, I put the microcontroller to an Uno board. It worked like a charm. Should try it with guide in the link: http://www.gammon.com.au/bootloader

Good luck

Evil Mad Scientist ISP Shield. I have never had to deal with this crap ever since I bought it.