Arduino Forum

Using Arduino => Microcontrollers => Topic started by: Vilimerth on Mar 14, 2015, 10:45 pm

Title: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 14, 2015, 10:45 pm
Hi there,

For the last couple of hours I was trying to burn bootloader on standalone Atmega328. I want to use 8Mhz internal clock instead of external 16MHz clock. As a guidelines, I followed below instructions:

http://arduino.cc/en/Tutorial/ArduinoToBreadboard
http://oddwires.blogspot.com/2012/06/burning-bootloader-into-bare-atmega328.html
http://phaq.phunsites.net/2013/09/12/use-arduino-micro-as-isp-with-atmega-on-a-breadboard/

The problem is that when I am trying to burn bootloader I am receiving following error message:
"Error while burning bootloader: missing 'bootloader.tool' configuration parameter"

None of the solutions which I could find solved my problem.

It looks like, that avaiable solutions apply for older version of the 'Arduino IDE' and they do not work with the latest IDE releases ( I was trying both: 1.6 and 1.6.1).

Any idea how to solve it?

I will be very grateful for help.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johnwasser on Mar 15, 2015, 12:22 am
Sounds like the boards.txt entry you are using was not updated for Arduino 1.6.  Just before "{name}.bootloader.low_fuses=0xff" put "{name}.bootloader.tool=avrdude".

Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 15, 2015, 10:50 am
Thank you John,
I did as you said and I can see some progress - still not success but I have different error message.
This time it is:
"Could not find tool avrdude"
I was trying to google it, but without success. This how my 'boards.txt' file looks like:
##############################################################

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.tool=avrdude
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


Any advice?

Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johnwasser on Mar 15, 2015, 01:41 pm
Looking at the ATtiny core for Arduino 1.6.x it looks like you have to use 'arduino:avrdude' instead of just 'avrdude' in your custom boards.txt files.  Sorry I did not know that before.

Without using a custom boards.txt file you can get the same effect (328p with internal clock) by treating your ATmega328p as a LilyPad Arduino board with an ATmega328 processor (Select Tools->Board->LilyPad Arduino, then Tools->Processor-> ATmega328)


Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 15, 2015, 04:34 pm
John, every advice from you is taking me further, but I am still not quite there yet.
Now I have another error message:

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

Error while burning bootloader.'

I can see this error in both cases: for LilyPad and for standalone Atmega 328 and on both IDE's: 1.6 and 1.6.1.

Do you have any idea what to do next?
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: mart256 on Mar 15, 2015, 04:49 pm
I'd try with 1.0.6 IDE, 1.6 I recommend for Yun and Due.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johnwasser on Mar 16, 2015, 02:14 pm
Did you, by any chance, purchase an ATmega328 instead of the ATmega328P used in all the Arduinos?  The 'P' (Pico-power) version has a different signature.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Budvar10 on Mar 16, 2015, 03:01 pm
Did you, by any chance, purchase an ATmega328 instead of the ATmega328P used in all the Arduinos?  The 'P' (Pico-power) version has a different signature.
He should set to verbose output (in preferences) to obtain exact signature bytes. If it is zero or not.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 16, 2015, 04:32 pm
 
Did you, by any chance, purchase an ATmega328 instead of the ATmega328P used in all the Arduinos?  The 'P' (Pico-power) version has a different signature.
No. I checked that and I have only ATmega328P. I am able to run my project with the external oscillator but I would like to shrink it, and that is why I need to use internal oscillator.

He should set to verbose output (in preferences) to obtain exact signature bytes. If it is zero or not.
I did it as well and this is what I am getting:

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

         Using Port                    : /dev/tty.usbmodem14211
         Using Programmer              : stk500v1
         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 : 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.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.06s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

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

Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johnwasser on Mar 16, 2015, 09:32 pm
What model Arduino are you running the ArduinoISP sketch on?  One of the page you link to is for an Arduino Micro.

Did you select "Arduino as ISP" (not "ArduinoISP") from Tools->Programmer before selecting Tools->Burn Bootloader? 

"avrdude: Device signature = 0x000000"

That tends to indicate a wiring error.  The wiring will somewhat depend on which model Arduino you are using for ArduinoISP.  

Has the ATmega328P you are programming been set to expect a crystal?  If so you have to provide a crystal or an alternative clock.  Adafruit has an alternative version of ArduinoISP that uses Arduino Pin 9 for an 8 MHz clock output.  You can connect it to pin 9 (XTL1) of the ATmega.  https://github.com/adafruit/ArduinoISP (https://github.com/adafruit/ArduinoISP)
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 16, 2015, 10:47 pm
What model Arduino are you running the ArduinoISP sketch on?  One of the page you link to is for an Arduino Micro.
I am running ArduinoISP sketch on UNO.

Did you select "Arduino as ISP" (not "ArduinoISP") from Tools->Programmer before selecting Tools->Burn Bootloader?
Yes


"avrdude: Device signature = 0x000000"

That tends to indicate a wiring error.  The wiring will somewhat depend on which model Arduino you are using for ArduinoISP. 
This is what I using for wiring: http://oddwires.blogspot.com/2012/06/burning-bootloader-into-bare-atmega328.html

Has the ATmega328P you are programming been set to expect a crystal?  If so you have to provide a crystal or an alternative clock.  Adafruit has an alternative version of ArduinoISP that uses Arduino Pin 9 for an 8 MHz clock output.  You can connect it to pin 9 (XTL1) of the ATmega.  https://github.com/adafruit/ArduinoISP (https://github.com/adafruit/ArduinoISP)
I have 3 ATmega 328P. Only one of them should be set to work with crystal and it works with crystal. The other 2  are new and it shouldn't work with external crystal but when I was trying burn bootloader on them I can see this:
 '  Oscillator      : Off'

so I am not so sure anymore.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 16, 2015, 11:34 pm
I tried to use 'https://github.com/adafruit/ArduinoISP' file.

- I enabled LOW_SPEED, and loaded it to the programmer.
- I connect Arduino pin 9 with with Atmega XTL1
- I switched to 'LilyPad Arduino'
- I tried to 'Burn Bootloader'

This is the error message I got:

'avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x1e950f
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/avr/bootloaders/atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex"
avrdude: writing flash (32652 bytes):

Writing | ################################################## | 100% 0.00s


avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x00
avrdude: stk500_cmd(): programmer is out of sync
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.'
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 16, 2015, 11:41 pm
After previouse attempt I loaded regular 'ArduinoISP' sketch, and with the Arduino pin 9 still contected to ATmega XTL1 I tried to burn bootloader again. In this case I recived below error message:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e950f
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing |  ***failed; 
################################################## | 100% 0.16s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x3f
avrdude: verification error; content mismatch

avrdude done.  Thank you.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johnwasser on Mar 17, 2015, 04:34 am
That symptom looks like what I saw when I had not disabled auto-reset on the Arduino UNO running ArduinoISP.  The Arduino bootloader uses the same protocol as the ArduinoISP.  The bootloader will return the signature for an ATmega328P but then it will return 0 if you try to read memory or fuses.

Did you connect a 1 to10 uF capacitor from Reset (+) to Ground (-)?
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 17, 2015, 08:09 am
I tried with the capacitor and I have exactly the same errors like before...
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johnwasser on Mar 17, 2015, 01:43 pm
I've run out of ideas. :(
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Mar 17, 2015, 03:46 pm
John, could you please give me the setup which you are using for the same task to make me sure that I have done everything as it should be?
I will not give up on this :)
The only thing is that for the next 2 weeks I will be offshore so I have to suspend my efforts.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johnwasser on Mar 17, 2015, 05:48 pm
Burning a Bootloader
(Arduino 1.6.1 running on MacBook Pro w/ OS X 10.10.2)
ISP Arduino: Arduino Diecimila w/ATmega168 (didn't have a second ATmega328P available)
Target chip in breadboard: ATmega328P (has UNO bootloader and no crystal)

Connect the USB cable to the PC and ISP Arduino

Install the ArduinoISP sketch in the ISP Arduino.
File->Examples->ArduinoISP
Tools->Board->Arduino Duemilanove or Diecimila
Tools->Processor->ATmega168
Tools->Port->(serial port for ISP Arduino)
File->Upload


Go to Preferences... and check the box for "Show verbose output during: [  ] compilation [X] upload"

Install the breadboard wiring:

Target
Pin
Arduino
Pin
Target
Pin
Arduino
Pin
1Pin 1028
227
326
425
524
623
7+5V22GND
8GND21
9
20+5V
1019Pin 13
1118Pin 12
1217Pin 11
1316
1415


Attempt to burn bootloader without disabling auto-reset on ISP Ardiuino.
Tools->Board->Arduino UNO
Tools->Port->(serial port for ISP Arduino)
Tools->Programmer->Arduino as ISP
Tools->Burn Bootloader.

Reading | Error while burning bootloader.
################################################## | 100% 0.05s

avrdude: Device signature = 0x1e9406
avrdude: Expected signature for ATmega328P is 1E 95 0F
         Double check chip, or use -F to override this check.



Note: If the ISP Arduino had an ATmega328P processor this check would have passed and an error would occur further into the process. Here is what happens if I put an ATmega168 into the breadboard and try to burn a Diecimila 168 bootloader to it:
avrdude: Device signature = 0x1e9406
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing |  ***failed;  
################################################## | 100% 0.13s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x00 != 0x3f
avrdude: verification error; content mismatch



Added a 10 uF capacitor to the ISP Arduino with the positive side of the capacitor going to Reset and the negative side of the capacitor going to Ground.

Now attempt to burn a bootloader.  If the chip is not set to expect a crystal or external clock then this should be successful.  If the chip came with (or has had burned) an Arduino bootloader it will fail like this:

Tools->Burn Bootloader.

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



This is a symptom of the target chip's clock not running.  An ATmega that is expecting a crystal won't accept serial programming without a crystal or ceramic resonator between pins 9 and 10, or an external clock injected into pin 9.   I found a crystal between 8 MHz and 20 MHz (14.3180 MHz in my case) in my 'salvaged parts' box and plugged it into the breadboard between pins 9 and 10.

Attempt to burn bootloader again: Tools->Burn Bootloader.

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude done.  Thank you.



SUCCESS!
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johshmoh on Mar 21, 2015, 02:07 am
Here's what I did:
1) locate your installed boards.txt (mine was in /usr/share/arduino/hardware/arduino/avr/boards.txt)
2) add the following at the end. Restart the IDE and choose ATmega328 on a breadboard from the list

hope that works for you!
##############################################################
atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.protocol=arduino
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.maximum_data_size=2048
atmega328bb.upload.speed=57600

atmega328bb.bootloader.tool=arduino:avrdude
#atmega328bb.bootloader.tool=avrdude

atmega328bb.upload.tool=avrdude

atmega328bb.bootloader.low_fuses=0xE2
#atmega328bb.bootloader.low_fuses=0xFF
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05

atmega328bb.bootloader.file=atmega/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.core=arduino
#atmega328bb.build.variant=arduino:standard
atmega328bb.build.variant=standard
###Experimental name:
atmega328bb.build.board=AVR_BARE
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Vilimerth on Apr 12, 2015, 12:20 pm
Guys thank you for all your help.

Final I managed to burn bootloader on the standalone Atmega328P.

To accomplish that I removed all old Arduino IDE's (all together with the all boards.txt files with which I was playing), I installed Arduino 1.6.3, afterwards I edited boards.txt with the instructions from johshmoh,  I took brand new Atmega328P and followed johnwasser instructions. Everything went smoothly. It works even without 10uF capacitor.

 I checked all my microcontrollers with Atmel Studio and Atmel ICE and I found that during my first attempts of upload bootloader I changed the fuses to use external oscilator... I don't know how it happend.

Anyway now everything works how it should.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johshmoh on Jun 02, 2015, 10:24 pm
update 1.6.4 broke things. here's the new boards.txt section:
##############################################################

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.tool=avrdude
atmega328bb.upload.protocol=arduino
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
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: LukasD on Jun 03, 2015, 09:05 am
johshmoh, your update is not corect, i had to add the line "atmega328bb.bootloader.tool=arduino:avrdude" to make it work.
Please check and confirm.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: GoForSmoke on Jun 03, 2015, 02:30 pm
Guys thank you for all your help.

Final I managed to burn bootloader on the standalone Atmega328P.

To accomplish that I removed all old Arduino IDE's (all together with the all boards.txt files with which I was playing), I installed Arduino 1.6.3, afterwards I edited boards.txt with the instructions from johshmoh,  I took brand new Atmega328P and followed johnwasser instructions. Everything went smoothly. It works even without 10uF capacitor.

 I checked all my microcontrollers with Atmel Studio and Atmel ICE and I found that during my first attempts of upload bootloader I changed the fuses to use external oscilator... I don't know how it happend.

Anyway now everything works how it should.
Some time try Nick's burner program, it's really good.
http://www.gammon.com.au/bootloader

I have yet to bootload chips without wiggling some wires to get all the contacts right. Need to solder.
With Nick's software I didn't have to edit text to get my 328P-PU chips recognized.

There is also Nick's minimal breadboard blog that covers so much so well.
http://www.gammon.com.au/breadboard
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: prettyasadiagramm on Jun 17, 2015, 12:44 pm
Hey there.
I have the same problem but the instructions doesn't really helped.
I try to put biitloader in ATmega 328P with a Leonardo board as ISP.

I tried to do it on 1.6.4 IDE and took the same steps Johnwasser has adviced to Vilimerth but after taking the 2nd step I got this msg :

C:\Program Files\Arduino\hardware/tools/avr/bin/avrdude -CC:\Program Files\Arduino\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P\\.\COM7 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

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

         System wide configuration file is "C:\Program Files\Arduino\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM7
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: ser_send(): write error: sorry no info avail

and it works the same for both internal and external CLK source, and for 1.6.4. IDE the same as for 1.0.6., I also used 2 different MCUs.

Could you pls help me with that trouble or at least say what may be wrong?
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johshmoh on Jul 03, 2015, 09:50 am
johshmoh, your update is not corect, i had to add the line "atmega328bb.bootloader.tool=arduino:avrdude" to make it work.
Please check and confirm.
Yes, i can confirm it's working fine as is on v1.6.5 on Arch Linux and Windows 8.1
I really don't know what i'm doing, but i managed to get it working for me. glad you were able to work it out?
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Glenn81 on Oct 11, 2015, 05:28 pm
I'm not sure if anyone is watching this anymore...

I have the same problem, a device I built for a customer, based on Atmega328 internal 8MHz clock.
I have updated the boards file as per the above post, I can't get the device to respond for programming.
The serial link is OK because the 'old' installed program communicates properly via the serial link (input and output).

Has avrdude changed anything in it's protocol?  I don't remember what version of the IDE I used originally - 1.5 something...

Please help!

[Update :] followed the (super) how-to on Nick's site, flashed a new chip with the "Lilypad internal 8MHz" profile, but still no joy.  Incidently, I took out my original chip and cheked it with Nick's 'detector' program, it responds correctly and has the correct bootloader.  *So - my problem persists....*
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: EEGamble on Oct 16, 2015, 07:25 pm
Hi,

I have the exact same problem as Glenn81. I have bootloaded several times, using both Nick Gammon's beautiful work (Arduino_Board_Programmer) and the 'official' at https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard (https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard). Both methods have bootloaded the chip fine, i have checked with Nick's verify function in Arduino_board_programmer sketch. And also checked with the Arduino_Board_Detector (Also Nick's work)..

Also as Glenn81, i have messed around with the boards.txt file but nothing is working unfortunately.

So the problem is the same as Glenn81, i cant program the chip.

i'm using Arduino IDE v.1.6.5..

Have anyone solved this yet?

Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: CrossRoads on Oct 16, 2015, 07:27 pm
Are you last 2 posters using '328, or '328P? They have different signature bytes that can cause issues.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: EEGamble on Oct 16, 2015, 08:29 pm
It should be '328P



Atmega chip detector.
Written by Nick Gammon.
Version 1.17
Compiled on Oct 16 2015 at 20:17:01 with Arduino IDE 10605.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0xE2
HFuse = 0xDA
EFuse = 0xFD
Lock byte = 0xEF
Clock calibration = 0xB7
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 2048 bytes starting at 7800




*** EDITED OUT (bootloader) ***


MD5 sum of bootloader = 0x27 0xEB 0x87 0x14 0x5D 0x45 0xD4 0xD8 0x41 0x44 0x52 0xCE 0x0A 0x2B 0x8C 0x5F
Bootloader name: ATmegaBOOT_168_atmega328_pro_8MHz



*** EDITED OUT (Program memory) ***




Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: johshmoh on Oct 23, 2015, 02:47 am
Don't know if this helps anybody or is just wasting space, but:
I upgraded to arduino 1:1.6.5.r5-2 (Arch Linux) and that seems to have broken something. This boards.txt file (living at <arduinofolder>/hardware/breadboard/avr) works now:
##############################################################

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.tool=arduino:avrdude
atmega328bb.upload.protocol=arduino
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=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F
atmega328bb.bootloader.tool=arduino:avrdude

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=arduino:standard


*****
Confusingly, there's a 1-6-x zip file on the Arduino Tutorial page (https://www.arduino.cc/en/uploads/Tutorial/breadboard-1-6-x.zip) that doesn't work as-is.
For those still having trouble, have you tried a complete removal of the IDE and re-install?
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: JT81 on Oct 28, 2015, 02:10 am
Everyone needs to try that Gammon Bootloader sketch if they haven't. I justnspent a couple hours trying to just burn a bootloader through the Arduino IDE with no luck after trying every trick and changing every setting you could think of.

Thankfully I finally found this thread and tried out that sketch. It worked like a charm the first try with no trouble at all. I'm so thankful for Gammon's work that I registered just to post in this thread. He's made several helpful tools and blog posts.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: deskwizard on Nov 30, 2015, 12:04 am
Exact same story here... spent the afternoon messing around until I found the previous post.

Nick Gammon's tool is flawless.

http://www.gammon.com.au/bootloader (http://www.gammon.com.au/bootloader)

Just use the Lilypad bootloader for 8mhz internal oscillator configuration.

DW
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: jebobrow on Feb 03, 2016, 11:52 pm
I have also been struggling with burning bootloaders. I have used several programmers, including the AVRISP II and the ArduinoISP. I get an avrdude error:
  avrdude: usbdev_open(): did not find any USB device "usb"
when using the AVRISP II in version 1.6.7 but it works fine in an OLD Arduino version 1.0.1.

I wish I could make a bootloader work with the latest version of Arduino...
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: Maverick71 on Apr 13, 2016, 03:30 pm
Hello,

I'm in the same situation since 1.6.8 (maybe 1.6.6).
Before I was able to burn Bootloader with UNO.
I used Nick Gammons Software for burning the bootloader for Crystal-Less Atmega 328P but
now I'm not able to upload code to the 8MHz Atmega Chip if I use UNO as programmer.

Any hints or known problems?

Regards,
Mav.
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: jarri on Apr 18, 2016, 09:43 pm
johnWasser Thanks a lot for the Lilypad tip !! It works to me !! :D
Title: Re: Burning bootloader on standalone Atmega328(internal clock 8MHz)
Post by: sincze on Sep 28, 2016, 09:58 pm
Exact same story here... spent the afternoon messing around until I found the previous post.

Nick Gammon's tool is flawless.

http://www.gammon.com.au/bootloader (http://www.gammon.com.au/bootloader)

Just use the Lilypad bootloader for 8mhz internal oscillator configuration.

DW
Great stuff. I used it as well NANO to NANO. Original FTDI to CLONE CH340.
Revived the 340 instantly. Have been puzzeling for hours before I found Nick Gammon's tool.
Excellent.