Go Down

Topic: Fail to burn bootloader into standalone atmega2560 (Read 203 times) previous topic - next topic

paulius172

Hello, I am making a project where I use standalone atmega2560. I used arduino mega schematic to put all necessary components so atmega2560 would be working. I tried to burn bootloader into it using arduino mega as ISP, but failed. I get this error:
Code: [Select]

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cstk500v1 -PCOM4 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xD9:m -Ulfuse:w:0xFF: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 "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 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.

I use schematic which I attached.

At first I uploaded arduinoISP example code to my arduino mega and then used it to program several arduino megas to be sure that it is working and then I connected cables to arduino mega ISCP connector which is master and then put them into my PCB board X3 connector which also has SPI connected to it. After trying to burn bootloader I got an error above.

Things I already did:
Made sure that all VCC pins are connected. And AVCC is connected to VCC
Made sure that all GND pins have ground and my PCB has same GND level as arduino mega (programmer)
Made sure that I connected SPI correctly.
Made sure that arduino as ISP is working.
Made sure that VCC level is high (it is about 4.7 V)
I also tried to put external voltage, but it also did not help.
I tried putting capacitor between Reset and GND pins on arduino mega (programmer)

What could go wrong? After all my struggles I came to the conclusion that it is probaby hardware problem, but I cannot find it.
Also I read that atmega2560 by default use 8 MHZ internal clock, can it be a problem?





missdrew


paulius172

What is wrong?
It needs to be like this?


missdrew

#3
Feb 22, 2021, 05:01 pm Last Edit: Feb 22, 2021, 05:03 pm by missdrew
Yes. :) - Kind of, the 1M resistor should be over 33 & 34 with no R19

paulius172

I fixed as you suggested, still I get the same error. This is how it looks now:


missdrew


paulius172

It did not help... I'm wondering, if atmega use internal clock with default fuses can external clock be an issue?

missdrew

No, I program 328s and 2560s from the factory on boards with the crystal wothout issues.

paulius172

I see. Thanks for your help. Any other ideas?

missdrew

post an in focus close up photo of your board!

wvmarle

When the internal clock is enabled (default for bare chips) the external crystal is ignored. You must explicitly set the fuses for it to use an external clock input (crystal).

Remember to connect the RESET of the ISCP header to the reset pin (the label disappeared in the snippet of #4). The 10k pull-up should not be necessary.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

hammy

Have a look at the schematic for the mega 2560.
Check your oscillator is running if you have  a scope .

Check you have  power supply and 0v in the right places and no pins shorted to ground or supply.
Crystal and 22pf should be close to the processor .
I use a cheap ICSP programmer from eBay and gave not had any issues with 1284, 328 processors .

Any internal settings of the processor get over written when boot loading .
Are you selecting mega 2560 in the processor options ?

wvmarle

OP gets a device signature of 0x000000 which implies the ICSP is not connected properly to the processor, as there is no response whatsoever.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

missdrew

The X3 header is not in the classic ICSP footprint, could that be the issue here? if using a standard programmer, this will not work, the normal is :

MISO    VCC
SCK       MOSI
RESET    GND

With MISO on pin 1

wvmarle

The X3 header is not in the classic ICSP footprint, could that be the issue here?
Good one!
KiCAD has the ICSP footprint with proper labelling (choice of the 6 and 10 pin versions, I've never seen the point of the 10-pin one, just takes up a lot more space) in the standard library, making it very easy to get that right, so I didn't think of checking on that...
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Go Up