UNO & ATMega328 with internal clock

Dear community,

I guess this is a typical issue, however having followed some tens of tutorials I thought that there might be an update I am missing.
I am trying to use ArduinoUNO R3 to burn the bootloader on an ATMega328P using the internal oscillator.
My breadboard set up is seen on the picture below, built following http://arduino.cc/en/Tutorial/ArduinoISP and adding the 10uF capacitor between the reset and GND.
The three extra leds are the one described in the ArduinoISP code.

The steps I am taking are:
->upload ArduinoISP to the UNO board
->Connect UNO to the breadboard
->choose “ATmega328 on a breadboard (8 MHz internal clock)” on the ISE
->choose Programmer → Arduino as ISP
->Burn bootloader

However I am always receiving a message from the avrdude:

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

My hardware support file is also shown below.

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

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.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard

Thank you in advance for any suggestions,corrections etc etc!

Kind regards,
Dimitris

some possibility's:

  1. You have a atmega328 (non p)
  2. Your atmega fuses has been set to use external x-tal

Try change this

atmega328bb.upload.protocol=stk500 to stk500v1 or arduino

or you simply has bad connections.

You need a pullup resistor on the breadboard chip's reset pin. You should also have bypass caps (.1uF) on the power pins of the breadboard chip power pins as near to the CPU as you can get them. Make sure you are picking the board type for a 328p on a breadboard with 8MHz internal clock. Be sure to use "File/Upload Using Programmer". I don't think it's really important unless the boards.txt file is written to use it, but the "Tools/Programmer" should be set to ArduinoISP.

Dear Erni,

Erni: 1. You have a atmega328 (non p)

I have an ATMega328p, sorry for not mentioning.

Erni: 2. Your atmega fuses has been set to use external x-tal

I have no idea what that means or any way to check it and work around it.

Erni: atmega328bb.upload.protocol=stk500 to stk500v1 or arduino

I tried that but with no luck. I will try to post some more detailed avrdude messages soon, however I do not have access to the board for the time being.

Erni: or you simply has bad connections.

Well that is always a problem, however I have double checked them with a multimeter and they look ok.

What make me wonder is why so many people, just like afremont, suggest adding more circuity (pullup resistors, caps etc) while others just do it with the minimal schematic described on the official page. If all these elements are needed how can many people achieve programming the ATMega just by following the tutorial? Excuse my ignorance, I am very very new to these domains.

Regards, Dimitris

I'll tell you why I suggest those things. 1) The datasheet says you need them 2) I have discovered thru trial and error, that you do indeed need them because sometimes it just doesn't work any other way 3) Just because somebody else go away with not doing something right doesn't mean that you will

Not having a pullup on the reset pin is just plain wrong. The programmer might be driving it high and low actively, but once you want it to run on its own in the circuit, it needs the pullup. See item number 3. They clearly left it out of the first breadboard diagram on that page, but it is in the one on the right (that uses crystal oscillator).

Not nearly as many as you might otherwise think.. I've tried it both way's because I was in a hurry one night I forgot them and the chip might program 2 of 3 times... Different also is the PSU used.. If the wires from the pus to the chip are 3 - 4 " long and the power supply is well bypassed, It may well work fine. The common consensus however is that Atmel recommends them because they make programming stable under all but really bad power supplies. Microcontrollers make noise when they change states internally thousands of very small capacitors charging and discharging at the same time can mean some large fast current pulses, fast enough to make wires look like inductors.. The resistance to the flow of pulses or AC in an inductor increases as frequency increases.. A capacitor decreases it's resistance to the flow of fast pulses or AC as the frequency increases. So the two, the inductance and the added capacitance of the bypass capacitors work together to eliminate the noise at the source, both by the changes with increasing frequency and they help to overcome the weakness of breadboards inductive and very high (relative to a PCB) resistance of the power and ground rails by acting as a reservoir of energy close to the processor pins and thus quieting those little current spikes. Any questions?

Doc

There is a pull-up on the reset line of the 328 But it's one of those weak pull-up things and ATmel's recommendation is to supplant it with a resistor of 4K7 to 10K. For reasons of reset timing the 10 K/100nF combination works well with the DTR pulse from the computer to insure an adequate reset when programming via the USB cable or (same thing) an FTDI adapter.

Doc

afremont: Not having a pullup on the reset pin is just plain wrong.

They're a very bad idea if you're worried about power consumption.

I made a device the other day which consumed an average of 3 microamps. If I added a 10k pullup on the reset pin it would consume 0.3 milliamps - 100 times more than the device just for the pullup!

Great! Clarified answers! Thank you all. I will come back to thins when I get some resistors and caps.
Could you please describe how the bypass caps are connected?

fungus:

afremont: Not having a pullup on the reset pin is just plain wrong.

They're a very bad idea if you're worried about power consumption.

I made a device the other day which consumed an average of 3 microamps. If I added a 10k pullup on the reset pin it would consume 0.3 milliamps - 100 times more than the device just for the pullup!

Something else must be going on. I always have a 10K pullup on the reset pin and have no trouble achieving 0.1µA in power-down mode as per the datasheet. In fact, my SOP is to make all unused pins inputs with pullups. CMOS circuitry has exceedingly high input impedances, a pullup on an input pin will draw effectively no current. I was just taking some measurements yesterday: http://arduino.cc/forum/index.php/topic,164146.msg1232507.html#msg1232507

there is no way a pullup can cause increased consumption if its the only thing on that pin. almost certainly there was other circuitry there. i will however add that imo the reset pullup serves no real purpose. recommendations for it are probably a holdover from the old days when mcus lacked sophisticated debounce circuit of avr. in most cases nothing at all should be connected to that pin. in rare situations where a long cable is attached a 1k series may be used but removed when cable is removed. during arduino upload with that cap to ftdi attached a 10k is needed but for stand alone i find anything at all connected to the reset pin is cause for trouble.

So after following all suggestions I still have no luck. I will post the total avrdude results. Sorry for the long post but I am hopping that this might help somebody help me.

/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/ttyACM0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xE2:m 

avrdude: Version 5.11.1, compiled on Oct 30 2011 at 10:41:10
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf"
         User configuration file is "/home/asdfg/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         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.

Try "arduino" instead of stk500v1 as the programmer type.

I did as you had previously suggested, however still no result. However I moved to a lower step. I just try to read the address and it looks like it is not possible. I still get the nuliffied Device signature.

:~$avrdude -P /dev/ttyACM0 -b 19200 -c avrisp -p m328p -n

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 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 done.  Thank you.

avrdude has an interactive mode you might want to play around with. I think you just add -t.

You could have a bricked or bad chip. Do you have another m328p to test with? Or even another type of AVR to test with?