Pages: [1] 2 3   Go Down
Author Topic: Re-burning bootloaders  (Read 3889 times)
0 Members and 1 Guest are viewing this topic.
Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Today, I received an ATMEGA 328 in the post from RS. I found the hardware files for the 328 (without an external crystal) here:
http://arduino.cc/en/Tutorial/ArduinoToBreadboard
It said that I needed to burn a bootloader to program it, so I did. (I burned the bootloader to use it with the internal oscillator). I then connected it up how they did in the diagram, and it did not work. As I already had the bootloader on it, but I could not program it on the breadboard, so I put it into my arduino to program. It still did not work, so I tried to burn a new bootloader to it. This did not work either. I successfuly managed to burn the no-crystal bootloader onto it, using the arduino as an ISP. I just cannot program it now. >:-(
Is there any way to burn a new bootloader onto it, or get it to work some other way?

Thanks everyone.
Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is what I had to do to get it to program.
 
After you hook up your breadboard to RX and DX and removed the chip from you main board, connect a wire from the pin 1 on the main board (now empty) socket (not pin 1 on the headers.....on the chip socket)and connect it to the pin 1 on your on-breadboard chip.

Logged

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
After you hook up your breadboard to RX and DX and removed the chip from you main board, connect a wire from the pin 1 on the main board (now empty) socket (not pin 1 on the headers.....on the chip socket)and connect it to the pin 1 on your on-breadboard chip.
That makes sense, as pin 1 is the reset, and we will need to reset the IC to program it.

Just tested it, and it still does not work. Thanks anyway though!
Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8821
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the exact error message you are getting when you try to program the chip?

I thought my ATmega168 chips were fried because I always got a verification failure programming the lock bits.  Turns out that AVRDUDE was resetting the Arduino that was supposed to be acting as an ISP and talking to the Arduino bootloader instead of the ArduinoISP sketch.  smiley-sad  The fix was to add a capacitor (2.2ufd in my case)  from Reset to Ground to keep AVRDUDE from resetting the Arduino.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12853
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Once you have the ArduinoISP connected, instead of burning a bootloader, try to upload a simple Sketch like Blink.  Don't forget to add an LED + resistor on pin 13.  If that works then you've proven that your ArduinoISP really is working the way it should.  Reburn the bootloader.

When Blink + burning the bootloader works, I think these are the remaining possibilities...

1. You didn't get RX + TX connected correctly (loose wire, swapped).

2. You didn't get the Arduino processor "disabled" when you tried to upload a Sketch to the target.
Logged

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
After you hook up your breadboard to RX and DX and removed the chip from you main board, connect a wire from the pin 1 on the main board (now empty) socket (not pin 1 on the headers.....on the chip socket)and connect it to the pin 1 on your on-breadboard chip.
That makes sense, as pin 1 is the reset, and we will need to reset the IC to program it.

Just tested it, and it still does not work. Thanks anyway though!
Onions.

Newcastle..........great beer!

What Arduino do you have? The Uno? I have the Uno.

Are you trying to load on a breadboard that as a 16mhz crystal or are you using the internal clock?
I forgot to say that I do it with a 16mhz resonator. I never go it to work with the 8mhz breadbord thing.  
Logged

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1601
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I had experience with both Parallel Programmer and A Serial programmer out of the two make the Serial programmer the LINK > http://diy4fun.blogspot.com/2009/01/simple-serial-programmer-for-avr.html ,Although i had some different circuit but this will work as fine, WHY SERIAL OVER PARALLEL?, The thing is the LCP1 port is taken as a Printer port by the system, so sometimes it's harder to amend that ,sometimes you have made all the right settings in preferences.txt, boards.txt and in windows but it wont just work's , so further use the PONYPROG and that's it!, will work Fine, i was able to do read and write (And that's all! mainly).(although in one of my experiment i burned my ATmega168 but yes after uploading it.).

So with my experience use the SERIAL + PONYPROG Really easiest and most cost effective method.

and ALPARENT is right , i have had the same problems with this UNO and internal Oscillator ,it's just needing an CRYSTAL and 2 22PF caps not that COSTLY!

WATCH MY VIDEO about this STANDALONE!

http://www.facebook.com/v/199181843427999
« Last Edit: February 25, 2011, 01:25:38 pm by Nishant » Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Let us know what board you have.
And I can give you a step-by-step of what worked for me. (If you want?)

I didn't need an external programmer. Just my Uno, a spare atmega, a breadboard, a 16mhz 3 pin resonator (as the caps integrated) and a 10k resistor.
« Last Edit: February 25, 2011, 01:37:10 pm by alparent » Logged

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again!
Quote
What is the exact error message you are getting when you try to program the chip?

"Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions" in the bar, and
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
In the box below.

Quote
What Arduino do you have? The Uno? I have the Uno.

Are you trying to load on a breadboard that as a 16mhz crystal or are you using the internal clock?
I forgot to say that I do it with a 16mhz resonator. I never go it to work with the 8mhz breadbord thing.

I am using the duemillanove. Yes, I was trying to load the program onto a 328 on a breadboard, set up to use the internal oscillator. I will probably end up using the resonators / crystals instead.

Quote
So with my experience use the SERIAL + PONYPROG Really easiest and most cost effective method.

and ALPARENT is right , I have had the same problems with this UNO and internal Oscillator ,it's just needing an CRYSTAL and 2 22PF caps, not that COSTLY!

The only problem is, I do not have the crystal, capacitors, or a resonator lying around, and I forgot to order one with the 328  smiley-sad.

Quote
Let us know what board you have.
And I can give you a step-by-step of what worked for me. (If you want?)

That would be good, thanks!  smiley-grin

Quote
I didn't need an external programmer. Just my Uno, a spare atmega, a breadboard, a 16mhz 3 pin resonator (as the caps integrated) and a 10k resistor.

I will probably end up using the same. The only problem is, local electronics shop is shut tommorow, so I cannot buy the bits yet. smiley-sad

 
Quote
Once you have the ArduinoISP connected, instead of burning a bootloader, try to upload a simple Sketch like Blink.  Don't forget to add an LED + resistor on pin 13.  If that works then you've proven that your ArduinoISP really is working the way it should.  Reburn the bootloader.

When Blink + burning the bootloader works, I think these are the remaining possibilities...

1. You didn't get RX + TX connected correctly (loose wire, swapped).

2. You didn't get the Arduino processor "disabled" when you tried to upload a Sketch to the target.

I will try that now...

Thanks everyone!
Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, I cannot upload blink to the new 328 with the arduino as an ISP.
I uploaded the “arduino as ISP” sketch to the original 328 on the arduino, then uploaded blink with the “ATmega328 on breadboard (with 8MHz internal oscillator)” option, and it uploaded to the original 328 instead – the one I was trying to use as the ISP. This was very annoying, and confusing. I took the original 328 out of the arduino, and replaced it with the new 328 that was not working. I then uploaded the blink sketch in the same way as before, and it did not work again! As everything with the breadboard (internal oscillator) option failed, I tried to upload it to the 328 in the same way that I would with any other program (using the duemilanove option). Once again, it did not work. Each time, it came up with the warning in the previous post.
Thanks again, Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Gatineau, Qu
Offline Offline
Jr. Member
**
Karma: 1
Posts: 94
Did you Arduino today?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok let's just start over.

First you need a board with a working atmega.
Then there are 2 steps. 1- Put the boot loader on the chip (this might be done already) 2. Put the sketch on the chip.

To do the first part, load the Use Arduino as ISP sketch to the chip on the board.
Make sure you ave selected the right board and the right port.
Then connect you breadboard like this (bottom secion of this page) Circuit (targeting an AVR on a breadboard) http://arduino.cc/en/Tutorial/ArduinoISP
Like I said it only worked if I used an external clock. (I have the Uno board, with optiboot)

Then use the burn bootloader with arduino as ISP.

Now your new chip as a bootloader!

Then remove the chip from your board.

You could just pop the new chip on the board and program any sketch you would like on it.

But is you want leave the chip on the breadboard and load  a sketch on in.........do this.....

Disconnect wires to header pin 10,11,12,13 and connect pins rx and tx the the rx and tx pins on the atmega on the breadboard. Like this
http://arduino.cc/en/Tutorial/ArduinoToBreadboard  Uploading Using an Arduino Board

Then add a wire from the board socket pin 1 (reset) to the breadboard chip pin 1 (reset)

Then load the sketch you want to the chip on the breadboard.


Remember never to change the board selection............but like I said it only worked with an external clock.
« Last Edit: February 27, 2011, 08:31:03 am by alparent » Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12853
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I uploaded the “arduino as ISP” sketch to the original 328 on the arduino, then uploaded blink with the “ATmega328 on breadboard (with 8MHz internal oscillator)” option, and it uploaded to the original 328 instead – the one I was trying to use as the ISP

After uploading the Arduino ISP sketch, did you disable auto-reset on the Arduino?
Logged

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks alparent! I am hoping to go out and buy the resonator tomorrow, so I will let you know how I get on.

Quote
After uploading the Arduino ISP sketch, did you disable auto-reset on the Arduino?

I don't know how to  smiley-confuse. I might have done it accidentally though...


Thanks again guys!
Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12853
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Start with this...
http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection
Logged

Newcastle, England
Offline Offline
Sr. Member
****
Karma: 3
Posts: 489
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, I haven't put a 120ohm resistor in, or taken anything out, and I don't think I changed any of the software...

Out of interest, what differences would it make if I did disable the auto-reset? Apart from having to hold the reset button, will it add more memory, or speed up upload times?

Onions.
Logged

My website: http://www.harryrabbit.co.uk/electronics/home.html Up and running now! (Feel free to look round!) smiley-grin

Pages: [1] 2 3   Go Up
Jump to: