Go Down

Topic: Issues burning bootloader onto new 328P-PU chips using UNO as ISP (8MHz) (Read 409 times) previous topic - next topic

Prop-Forge

Let me preface this that I did reference the existing thread from 2011, but the solution therein did not fix my issue.

I'm trying to load my program onto a 328P chip using an Uno as an ISP. This chip will be using its internal oscillator at 8MHz. 

Following https://www.arduino.cc/en/Tutorial/ArduinoISP, I loaded my UNO without any fanfare.

I then used the ICSP pins to wire to my 328P chip (in a ZIF socket) and placed a 10uF cap between GND (typo has been fixed) and RESET. I tested for continuity and found all was good.

I then attempted to burn the appropriate(?) bootloader to my 328P (programmer as "Arduino as ISP") with my board selection as "ATmega328 on breadboard" from the minimal configuration found under https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard. I get a failure and the error reads
Code: [Select]
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

I'm assuming that somewhere I need to alter or add an entry for 328P, but I'm at a loss as to where. I can't even find the "ATmega328 on a breadboard" entry in my boards.txt to even reference it. Looking at the avrdude.conf, there's some language about 328P after the 328 entry, but I've no clue what it is actually doing.

Coding Badly


pert

Is the 10 uF capacitor on the Uno, or on the breadboard?

I'm assuming that somewhere I need to alter or add an entry for 328P
No. That's has nothing to do with your error. That board is actually configured for ATmega328P, and won't even work for ATmega328. For some reason, all through Arduino's documentation and board names, they used to call ATmega328P "ATmega328". I guess the person writing the stuff didn't know that there is an important difference between ATmega328 and ATmega328P and, no, you can't just leave off the "P" (and why would you want to anyway?). This inaccuracy caused a lot of confusion over the years. I went on a campaign to get it all fixed a while back and did manage to get a lot of it fixed, but for some reason they balked at fixing the error in all of the documentation, including that Arduino on a Breadboard tutorial:
https://github.com/arduino/Arduino/issues/6466


Please do this:
  • (In the Arduino IDE) File > Preferences
  • Check the checkbox next to "Show verbose output during: upload
  • Click "OK"
  • Tools > Burn Bootloader
  • After the Burn Bootloader process fails, you'll see a button on the right side of the orange bar "Copy error messages". Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the Burn Bootloader output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

Prop-Forge

The capacitor is on the Uno I'm using as my programmer.

Error as follows:

Code: [Select]

Arduino: 1.8.9 (Windows 7), Board: "ATmega328 on a breadboard (8 MHz internal clock)"

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM4 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xE2:m

avrdude: Version 6.3-20171130
         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              : 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  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 : 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.00s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% -0.00s

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.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Coding Badly


Prop-Forge

Still wired incorrectly?


Nope. It was correct on the board, but I had a brain fart when I was typing.

kprims

Quote
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% -0.00s

avrdude: Device signature = 0x000000 (retrying)
Any possibility the chip already has the fuses set for a crystal?  Some Vendors put the Uno bootloader on the chips.
If that is the case you will either have to put a crystal on your chip or install the chip on a spare Uno to burn the 8MHz internal clock bootloader and fuses or check out Gammon's breadboard using pin 9, Alternate clock source.

http://www.gammon.com.au/breadboard

Prop-Forge

Any possibility the chip already has the fuses set for a crystal?  Some Vendors put the Uno bootloader on the chips.
If that is the case you will either have to put a crystal on your chip or install the chip on a spare Uno to burn the 8MHz internal clock bootloader and fuses or check out Gammon's breadboard using pin 9, Alternate clock source.

http://www.gammon.com.au/breadboard
I bought them (from Digikey I think) without the bootloader on them, and this one in particular is right from the tube and has never been used before.

Is this the same thing the UNO is doing? I do have a Tiny AVR programmer from SF.

If I'm going to have to do a fair number of these chips, now and into the future, am I better off just buying a dedicated programmer that can reset fuses and do all that nonsense?

kprims

Quote
Is this http://www.technoblogy.com/show?1YO1 the same thing as the UNO is doing? I have a Tiny AVR programmer from SF.
Yes A USBtinyISP will do the same thing for burning the bootloader and setting the fuses. You would select Programmer: USBtinyISP with it wired correctly.

You may have a bad chip, try another one.  Remember, if the fuses have been set for an external clock you will still need a crystal to change the fuses.

Coding Badly


...reasonable clock signal on XTAL1.  An actual crystal is not required.


Prop-Forge

...reasonable clock signal on XTAL1.  An actual crystal is not required.


That could be accomplished via Gammon's pin D9 method?

Coding Badly


Yes.

There are at least two published versions of the ArduinoISP sketch capable of providing a clock.


Prop-Forge

If I were to use my TINY AVR Programmer as a programmer, and seat the 328P to be bootloaded/programmed into the UNO, I assume I'd just hook up the 6 ICSP pins:

1-1
2-2
...
6-6

and proceed with ArduinoISP for loading the bootloader to the 328P (on the UNO).

That way, I can program the 328P to be either 8 or 16MHz, right?

kprims

Yes. But you should select USBtinyISP as the programmer. You might want to check out MiniCore also.

https://www.youtube.com/watch?v=Ec5GQ9KzSVA

Minicore

https://github.com/MCUdude/MiniCore

Coding Badly


"Yes" that it will work.

"I don't know" in regards to the wiring.  I believe you are correct that the wiring is "straight through".  But I suggest a careful check of the Sparkfun documentation.  At a minimum, do not mix up VCC and GND.


Go Up