Go Down

Topic: Quick help with burning bootloader (Read 3939 times) previous topic - next topic

Skadoodles

Hey,

I'm having trouble burning bootloader to my new ATMEGA328-pu chips. I have two arduino UNO
I tried http://arduino.cc/en/Tutorial/ArduinoISP, this did not work. I even inserted a 124 ohm resistor from 5v to reset and a 10uf cap from reset to ground. Found this on a forum somewhere.
my steps. -> select arduino isp sketch in the examples,,, then go to tools -> Programmer -> arduino as ISP
then -> tools burn bootloader.
AVR dude sync error

then I found these articles:

http://scuola.arduino.cc/it/node/129
http://www.3guys1laser.com/blog-burn-bootloader-blank-atmega328atmega328p-arduino-uno
...
This is where I save my sketches:

C:\Users\***\Documents\Arduino\optiLoader\optiloader.ino and optiloader.h
changed name of the Include Wprogram.h to arduino.h as im using the new arduino IDE 1.0
then I go file->sketchbook-> optiloader.
upload it....

i get Binary sketch size: 13018 bytes (of a 30720 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00

Furthermore, when I try upload to arduino the serial rx and tx do flash then all of sudden stop and then with a little bit of a wait then I get the error above.

How do I get around this. What must I look into?

gcm2

Skadoodles:

Below is how I did it. A little different then using avrdude, but this worked for me.
=====================================================================
[original post]
I'm a newbie. Success first try!

Details:

Chips = ATMEGA328P-PU. I bought these blank chips from Mouser specifically because it's what came on my UNO. (I have not tried any others). http://www.mouser.com/ProductDetail/Atmel/ATMEGA328P-PU/?qs=K8BHR703ZXguOQv3sKbWcg%3d%3d

Wiring: exactly like this http://arduino.cc/en/Tutorial/ArduinoToBreadboard  (except I'm not using the IDE at all, just the diagram at the top showing how to hook things up).

Downloaded WestfW's optiLoader from https://github.com/WestfW/OptiLoader#readme

Loaded sketch in UNO, stuck blank chip in ZIF socket on the breadboard, and it worked first time no problems.

I did have the UNO hooked up to USB on the computer (not required) just to read the mesages.

Took chip over to my Arduino-on-a-breadboard tester and uploaded Blink pgm just fine.

It took me awhile to try this as I had read a lot of posts where some were having troubles burning the bootloader onto a blank chip.

Thank all of you great contributors who answer questions, and especially Bill Westfield for optiLoader!


CrossRoads

328-pu and 328p-pu have different signatures.

I believe westfw's optiloader recognizes both.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

DuaneB

Hi,
   Strongly recommend optiLoader, have used it program ATMega8's.

   You run the sketch on your main Arduino, the sketch contains three copies of the bootloader within itself and uses these copies to load your target chip. It has a copy each for ATMega 8, 168 and 328.

   It gives useful feedback during the processes so you have a good chance of troubleshooting should you need to.

   One tip - double check your wiring before powering up the two boards, a mistake could lock you out of the target chip, other than that it is pretty simple.

   You can use the same breadboard wiring as used in the ArduinoISP tutorial, use the version withe crystal, the bootloaders in optiLoader are design for boards with a crystal.

optiLoader - https://github.com/WestfW/OptiLoader
ArduinoISP - just copy the wiring with the crystal -






Duane B.

rcarduino.blogspot.com
Read this
http://rcarduino.blogspot.com/2012/04/servo-problems-with-arduino-part-1.html
then watch this
http://rcarduino.blogspot.com/2012/04/servo-problems-part-2-demonstration.html

Rcarduino.blogspot.com

cantlow

Hi
I have been also trying to burn a bootloader onto an Atmaga 168 20PU on a breadboard from an Arduino Uno. I have set up the board as shown in DuaneB's post and also played with putting in a 120 ohm resistor and a 10 microfarad capacitor between 5v and reset. I also added this code to the end of the boards.txt file as suggested on the old forum
##############################################################

atmega168bb.name=ATmega168 on a breadboard (8 MHz internal clock)

atmega168bb.upload.protocol=stk500
atmega168bb.upload.maximum_size=14336
atmega168bb.upload.speed=57600

atmega168bb.bootloader.low_fuses=0xE2
atmega168bb.bootloader.high_fuses=0xD9
atmega168bb.bootloader.extended_fuses=0x07
atmega168bb.bootloader.path=arduino:atmega
atmega168bb.bootloader.file=ATmegaBOOT_168_pro_8MHz.hex
atmega168bb.bootloader.unlock_bits=0x3F
atmega168bb.bootloader.lock_bits=0x0F

atmega168bb.build.mcu=atmega168
atmega168bb.build.f_cpu=8000000L
atmega168bb.build.core=arduino:arduino

I load in the ARduino ISP from the examples menu then select Arduino Uno for the board and upload it . All Ok so far. I then hook up the reset override resistor between the reset pin and the 5v rail and set "Arduino as ISP" for the programmer and "ATmega168 on a breadboard (8 MHz internal clock)" for the board then do burn bootloader.

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

I have double checked the connections and am sure they are right. I saw somewhere something that says you can't do this burn to a breadboard process from an Arduino Uno. Is that correct or should the changes described above fix this?

I saw the references to Optiloader on Github and tried to do something with that but I'm not sure where to put the header file and the pde file. I tried compiling the pde file in sketch but this give me errors.

Is there a problem with the code I added to the boards.txt file? or can anyone sugegst how this process should work for an Arduino Uno and an atmega168 20PU on the breadboard.  I haven't put my 16Mhz crystal and 18-22pf capacitors on the breadboard as the boards file addition post suggested they should not be used
I've been struggling all day so any help would be much appreciated.
David

dweston



   Strongly recommend optiLoader, have used it program ATMega8's.

   You can use the same breadboard wiring as used in the ArduinoISP tutorial, use the version withe crystal, the bootloaders in optiLoader are design for boards with a crystal.


I've given optiLoader a try with apparent success as follows:

Quote
OptiLoader Bootstrap programmer.
2011 by Bill Westfield (WestfW)

Target power on! ...
Starting Program Mode [OK]

Reading signature:950F
Searching for image...
  Found "optiboot_atmega328.hex" for atmega328P
  Start address at 7E00
  Total bytes read: 502

Setting fuses for programming
  Lock: 3F FFE000  Low: FF FFA000  High: DE FFA800  Ext: 5 FFA400

Programming bootloader: 512 bytes at 0x3F00
  Commit Page: 3F00:3F00
  Commit Page: 3F40:3F40
  Commit Page: 3F80:3F80
  Commit Page: 3FC0:3FC0

Restoring normal fuses
  Lock: 2F FFE000

Target power OFF!

Type 'G' or hit RESET for next chip


Only problem is that if I then take the bootloaded target and install it into my Arduino Duemilanove board I get the following error when attempting to then load a normal sketch.

Quote
avrdude: stk500_recv(): programmer is not responding


I'm using Arduino IDE 1.0 under MacOSX 10.6.8.

This seems to suggest the optiLoader bootstrap is incompatible with IDE 1.0.

westfw

Quote
if I then take the bootloaded target and install it into my Arduino Duemilanove

Did you change the "board" selection to "Uno"?  Once you have a 328p with optiboot in it, it behaves more like an Uno than a duemilanove....

dweston


can anyone sugegst how this process should work for an Arduino Uno and an atmega168 20PU on the breadboard.


You may have missed the reference on http://arduino.cc/en/Tutorial/ArduinoToBreadboard in which they specifically state the breadboard approach does not work with the Uno.

Quote
Note that these techniques only work with the Arduino Duemilanove w/ an ATmega328, not the Arduino Uno (or older Arduino boards w/ an ATmega168).

dweston


Quote
if I then take the bootloaded target and install it into my Arduino Duemilanove

Did you change the "board" selection to "Uno"?  Once you have a 328p with optiboot in it, it behaves more like an Uno than a duemilanove....



Thank you westfw, that worked a treat.

Go Up