Using UNO R3 as ISP to burn bootloader on new ATMEGA328-PU

Hi,

I am trying to burn a bootloader onto a new atmega328-pu that i bought, using the minimal arduino as isp method using my new UNO R3. http://arduino.cc/en/Tutorial/ArduinoISP

I however cannot get the bootloader uploaded. I just keep getting the avrdude signature error. I have tried many of the techniques described over the internet, and the only thing that changed the error was changing the avrdude.conf file. (The first error I got made specific mention of the signature byte that was wrong)

I also don't have a lot of electronics to build circuits with at this stage, so its a little hard to build some of the other (cap, crystal) breadbread circuits some mention.

Does anyone know how to bootload from the UNO R3 as ISP? I'm using IDE 1.0.3 on OS X.

http://arduino.cc/forum/index.php/topic,108697.0.html

Have tried this method before, but gave it another bash, anyway...got the same result as before

         avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.
  1. Double check your connections, and that you have the 10uF capacitor in place to disable auto reset on the Uno.

  2. Is it an atmega328-pu or an atmeg328p-pu you are trying to bootload? It makes a difference.

  3. Has the device signature ever been reported?

  4. Once you have successfully changed the fuse settings (which is part of the process of burning the bootloader), your mcu will become unresponsive unless you connect a crystal and caps to it, or feed it with an external clock.

BTW I'm wondering why ArduinoISP doesn't put out a clock signal on one of the PWM pins, to assist with programming of mcus that have had the fuses set to require a crystal. It shouldn't be difficult to do.

Reading your comment, I think i've been going about this completely wrong.

I've got my board setup like this Where would I put the cap (and would a 100uF work, as its all i have). After the board is set up correctly, how do I then go about bootloading?

Sorry, it seems like this is a lot harder than I thought it would be, so I'm a little lost.

You should have a 0.1uF cap across the Vcc and ground pins of the target device, but it probably isn't critical. The 10uF cap goes between the reset and ground pins of the Arduino you are using as ISP, after you have uploaded the ArduinoISP sketch to it. 100uF will be OK.

Have found a 0.1uF cap and have put it over the pins, and have put the 100uF across the RESET and GND on UNO. But still getting the same issue. Not sure what setting the fuses means. But looking at it on Google, I'll need to buy a Crystal to set them.

So, I'll explain what I use and the process I followed.

I have an UNO R3, and program with IDE 1.0.3 on OS X. I'm trying to program ATMEGA328-PU not the pico (ATMEGA328P-PU).

My process is as follows:

  1. Load the ArduinoISP sketch onto my UNO R3.
  2. Close IDE
  3. Unplug USB cable / Power Off Arduino
  4. Change the signature in the avrdude.conf to 0x1e 0x95 0x14
  5. Wire ATMEGA328-PU as follows:
  6. Arduino 10 -> Chip 1(RESET PIN)
  7. Arduino 11 -> Chip 17 (MOSI PIN)
  8. Arduino 12 -> Chip 18 (MISO PIN)
  9. Arduino 13 -> Chip 19 (SCK)
  10. 0.1uF cap across Chip 7 (VCC) and Chip 8 (GND)
  11. Arduino 5V to Chip 7 (VCC) and Chip 20 (AVCC)
  12. Arduino GND to Chip 8 (GND) and Chip 22 (GND)
  13. 100uF cap across Arduino GND and Arduino RESET
  14. Connect USB cable / Power On Arduino
  15. Set programmer to Arduino as ISP
  16. Burn bootloader

The verbose results are:

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

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

         Using Port                    : /dev/tty.usbmodemfa131
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         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
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [02] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [01] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [12] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [98]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
avrdude: Send: A [41] . [84]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [85]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [86]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [87]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [89]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [01] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [82]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [12] 
avrdude: Recv: . [10] 
avrdude: Send: B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [04] . [00] . [00] . [00] . [80] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: E [45] . [05] . [04] . [d7] . [c2] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: Send: P [50]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: V [56] 0 [30] . [00] . [00] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: Send: V [56] 0 [30] . [00] . [01] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
################avrdude: Send: V [56] 0 [30] . [00] . [02] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
################################## | 100% 0.06s

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

avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.

Hopefully this helps a little.

dc42:

  1. Double check your connections, and that you have the 10uF capacitor in place to disable auto reset on the Uno.

  2. Is it an atmega328-pu or an atmeg328p-pu you are trying to bootload? It makes a difference.

  3. Has the device signature ever been reported?

  4. Once you have successfully changed the fuse settings (which is part of the process of burning the bootloader), your mcu will become unresponsive unless you connect a crystal and caps to it, or feed it with an external clock.

BTW I'm wondering why ArduinoISP doesn't put out a clock signal on one of the PWM pins, to assist with programming of mcus that have had the fuses set to require a crystal. It shouldn't be difficult to do.

Well ArduinoISP (at least the one in IDE 1.0.3 does output a 'heartbeat' signal on to pin 9, but I can't tell what speed it is to be useful as a clock pulse for the target chip. If not maybe it could be changed to a faster rate?

// this provides a heartbeat on pin 9, so you can tell the software is running.
uint8_t hbval=128;
int8_t hbdelta=8;
void heartbeat() {
  if (hbval > 192) hbdelta = -hbdelta;
  if (hbval < 32) hbdelta = -hbdelta;
  hbval += hbdelta;
  analogWrite(LED_HB, hbval);
  delay(20);
}

It's reporting a device signature of zero, which means failure to communicate with the mcu. This could indicate a bad or incorrect connection, or that the fuses have already been set. Maybe you have already succeeded in burning the bootloader once? Or could it be that you purchased an atmega328p with a bootloader already installed (and hence fuses already set) instead of a blank atmega328p?

retrolefty:

dc42:
BTW I'm wondering why ArduinoISP doesn't put out a clock signal on one of the PWM pins, to assist with programming of mcus that have had the fuses set to require a crystal. It shouldn't be difficult to do.

Well ArduinoISP (at least the one in IDE 1.0.3 does output a 'heartbeat' signal on to pin 9, but I can't tell what speed it is to be useful as a clock pulse for the target chip. If not maybe it could be changed to a faster rate?

It looks to me that timer 2 is free; so it could easily be used to provide (say) a 1MHz clock signal, independent of the heartbeat.

If the bootloader has been loaded onto the ATMEGA328-PU, will it work if I put it in my UNO? Even though the UNO uses a 328p and mine is the normal 328? If it will, then at least I can test it.

DirkoS:
If the bootloader has been loaded onto the ATMEGA328-PU, will it work if I put it in my UNO? Even though the UNO uses a 328p and mine is the normal 328? If it will, then at least I can test it.

Yes it will. Once you have gotten around actually burning the bootloader onto the chip the arduino IDE does not try and read the signature bytes to just uploading sketches via the serial USB connection. It's only when burning bootloaders from the IDE or possibly using the newer files menu option of 'upload sketch using programmer' that the signature bytes mismatch can become an issue.

Lefty

retrolefty:

DirkoS:
If the bootloader has been loaded onto the ATMEGA328-PU, will it work if I put it in my UNO? Even though the UNO uses a 328p and mine is the normal 328? If it will, then at least I can test it.

Yes it will. Once you have gotten around actually burning the bootloader onto the chip the arduino IDE does not try and read the signature bytes to just uploading sketches via the serial USB connection. It's only when burning bootloaders from the IDE or possibly using the newer files menu option of 'upload sketch using programmer' that the signature bytes mismatch can become an issue.

Lefty

More importantly, if you put it in a Uno then it will have a crystal connected.

Okay, then neither of the blank chips I bought has a bootloader on at this stage. Both just fail saying the chip is not responding when I try and upload a sketch.

Is there any other way of getting a bootloader on these chips?

There was a bug in ArduinoISP shipped with version 1.0 of the IDE (for Windows at least) that prevented it from working. Do we know that it is definitely fixed in the 1.03 IDE for OSX?

Try this solution:
http://3g1l.com/blog-burn-bootloader-blank-atmega328atmega328p-arduino-uno

For me worked like 1-2-3.