Problem burning bootloader on ATMEGA328P SMD using Arduino As ISP

Hi,

I'm trying to burn a bootloader using arduino IDE on my ATMEGA328P SMD soldered on another board.
I use an Arduino Uno as programmer, it has been loaded with ArduinoISP sketch.

Wiring:
RESET: arduino pin D10 -> ICSP RESET PIN
MOSI: arduino pin D11 -> ICSP MOSI PIN
MISO: arduino pin D12 -> ICSP MISO PIN
SCK: arduino pin D13 -> ICSP SCK PIN
VCC: arduino 5V -> ICSP 5V
GND: arduino GND -> ICSP GND

Error
Arduino IDE gives me this error:

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

AVRDUDE VERBOSE

C:\Program Files (x86)\Arduino\hardware\tools\avr\bin>avrdude -c arduino -P COM3
-p m328p -C "C:\Program Files (x86)\Arduino\hardware\tools\avr\etc\avrdude.con
" -b19200 -v -v -v

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 "C:\Program Files (x86)\Arduino\hard
are\tools\avr\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 Ma
W ReadBack



eeprom 65 20 4 0 no 1024 4 0 3600 3
00 0xff 0xff
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Ma
W ReadBack



flash 65 6 128 0 yes 32768 128 256 4500 4
00 0xff 0xff
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Ma
W ReadBack



lfuse 0 0 0 0 no 1 0 0 4500 4
00 0x00 0x00
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Ma
W ReadBack



hfuse 0 0 0 0 no 1 0 0 4500 4
00 0x00 0x00
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Ma
W ReadBack



efuse 0 0 0 0 no 1 0 0 4500 4
00 0x00 0x00
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Ma
W ReadBack



lock 0 0 0 0 no 1 0 0 4500 4
00 0x00 0x00
Block Poll Page
Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW Ma
W 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 Ma
W ReadBack



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.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.03s

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.

Signature is 0x000000 and I don't know why :frowning: The microcontroller is connected to a 16mhz resonator and wiring seems correct to me.
I need your help :frowning:

Thanks

EDIT: I forgot to say that RESET is working.

Double check your wiring, it's a clue. There is no response from ATmega therefore the programmer is reading only zeros.
Your connection description looks good so check the wires twice or something is wrong with the circuit on your board.

Ive read somewhere that signature 0x0000 means the chip is damaged.

Budvar10:
Double check your wiring, it's a clue. There is no response from ATmega therefore the programmer is reading only zeros.
Your connection description looks good so check the wires twice or something is wrong with the circuit on your board.

I rechecked wiring again, it seems ok :frowning:

Here's ICSP:

and ATMEGA:

spiLED also blinks when I try to burn the bootloader...

mart256:
Ive read somewhere that signature 0x0000 means the chip is damaged.

:frowning: but I don't understand how it could have been damaged.
soldering points are ok, wiring is ok and I never overvolted it...

Do you have the decoupling caps? Without those on the board, you can get just about any bad behavior. Are you sure the wires are correct? That error can happen if some of the data lines aren't connected right. Double check that they're connected to the right physical pin numbers (ie, checking continuity to the pin on the '328. )

Do you have anything connected to these pins? They may be getting loaded down.

DrAzzy:
Do you have the decoupling caps? Without those on the board, you can get just about any bad behavior. Are you sure the wires are correct? That error can happen if some of the data lines aren't connected right. Double check that they're connected to the right physical pin numbers (ie, checking continuity to the pin on the '328. )

are you talking about capacitors on XTAL1 & XTAL2 pins?
No, I'm using a 16mhz resonator.

Just did a continuity test between ICSP and ATMEGA pins using a multimeter. Traces are perfect. Continuity test passed...

proto-pic:
Do you have anything connected to these pins? They may be getting loaded down.

Hmm no, just a LED on SCK pin (as you can see in schematics)

Can you post the full schematic, may be a minor over-site causing a major issue.

Also - you have a pin marked D10 and one marked RST - are these connected?

Just looked again and they are the UNO and separate header, A full diagram of your board would help.

proto-pic:
Also - you have a pin marked D10 and one marked RST - are these connected?

yes, sure. And when I press reset button on arduino uno even the 2nd PCB resets.

Loading caps are not decoupling caps.

Put the 0.1uf caps between Vcc and Gnd pins on the chip, right next to the chip. I have seen a few tutorials that omit these, which is very unfortunate, because the result doesn't reliably work. Sometimes atmel chips will do okay without the decoupling caps. Other times they don't. And they'll never work without them if you're driving things directly off the chip. I have personally experienced multiple issues due to missing loading caps and had to discard a batch of boards I had made as a result of locating it improperly.

simonepsp:
yes, sure. And when I press reset button on arduino uno even the 2nd PCB resets.

That doesn't sound right. Only the uno should reset, not the second one... D10 on the Uno running ArduinoAsISP should go to RST on the other board... (Edit: Oh, I'll bet ArduinoAsISP sets the pin mode to output before writing 1 to it, that bit makes sense... And wait, how do you know that the second PCB is resetting if there's nothing running on the chip?

Can you show the connections? In your posts above, you describe how you've wired it, but it's not clear which thing is which?

DrAzzy:
Loading caps are not decoupling caps.

Put the 0.1uf caps between Vcc and Gnd pins on the chip, right next to the chip. I have seen a few tutorials that omit these, which is very unfortunate, because the result doesn't reliably work. Sometimes atmel chips will do okay without the decoupling caps. Other times they don't. And they'll never work without them if you're driving things directly off the chip. I have personally experienced multiple issues due to missing loading caps and had to discard a batch of boards I had made as a result of locating it improperly.

Yes, I have already have a 0.1uF between VCC and GND.

Here's schematics image :slight_smile:

DrAzzy:
That doesn't sound right. Only the uno should reset, not the second one... D10 on the Uno running ArduinoAsISP should go to RST on the other board... (Edit: Oh, I'll bet ArduinoAsISP sets the pin mode to output before writing 1 to it, that bit makes sense... And wait, how do you know that the second PCB is resetting if there's nothing running on the chip?

Can you show the connections? In your posts above, you describe how you've wired it, but it's not clear which thing is which?

Sorry, I thought 2nd PCB was resetting but I couldn't be sure about that.
I only saw LED on SCK pin blinking.

Probably it was just receiving something from the Arduino

D10 is connected to RST pin on ICSP

Any ideas? :frowning:

Thanks so much

You need pins 5 & 6 connected to Gnd and 3.3V
And more decoupling caps, one on each VCC and AVCC pin (3 total - you only have 1) along with the Aref cap which you have now.
If your signals are a 3.3V levels already (Vcc connected to 3.3V) why do you need resistor dividers to the uSD card? Ditch those.
Do not have a uSD card installed while bootloading.
Atmega328 is not spec'ed for 16 MHz operation at 3.3V. You may see some weird results, such as serial not working reliably.

CrossRoads:
You need pins 5 & 6 connected to Gnd and 3.3V
And more decoupling caps, one on each VCC and AVCC pin (3 total - you only have 1) along with the Aref cap which you have now.
If your signals are a 3.3V levels already (Vcc connected to 3.3V) why do you need resistor dividers to the uSD card? Ditch those.
Do not have a uSD card installed while bootloading.
Atmega328 is not spec'ed for 16 MHz operation at 3.3V. You may see some weird results, such as serial not working reliably.

Board is powered with a 3.7V rechargable battery or with 5V USB cable.

Pin 5&6? Are you talking about the atmega microcontroller?

Thanks for your help

EDIT: If you are talking about the microcontroller pin 5 and pin 6 are already connected to GND and VCC (I've checked on the PCB) :slight_smile:

CrossRoads:
[...]more decoupling caps, one on each VCC and AVCC pin (3 total - you only have 1) along with the Aref cap which you have now.

Checking schematics I see a cap connected to AREF as you said and a 0.1uF cap connected to VCC and AVCC.
(marked in red)

Isn't enough? :frowning:

Thanks

You should have one on each of the two Vcc pins, and one on AVcc pin, right next to the chip, plus the one on AREF. 4 caps total.