Pages: [1]   Go Down
Author Topic: Can't upload code to ATmega328P after using ArduinoISP to burn bootloader+sketch  (Read 809 times)
0 Members and 1 Guest are viewing this topic.
Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Go Banana!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm wondering if anyone can explain what's going on here and possibly find a solution. It's a little hard to explain so I'll just start by explaining how to reproduce the problem.

To reproduce it, start by wiring up two Arduino UNOs as outlined in the ArduinoISP tutorial page:



Don't forget to put a 10uF capacitor between GND and RESET on the UNO that you're plugging in to your computer (the bottom one in the diagram on that page). Follow steps 1-7 and burn the bootloader.

After successfully burning the bootloader, open the Blink example sketch and select "Upload using Programmer." The little LED for pin 13 should be blinking away nicely.

Now, unplug both UNOs and set aside the one you were just using as an ISP. Plug the UNO with the newly bootloaded ATmega328P into your computer and try to upload the Blink sketch again. The upload will fail, saying that the programmer is not responding.


Does anyone know why this is? If you burn the bootloader using the ISP but don't upload any sketch using the ISP, you can upload sketches to it directly with no problem.

Sorry if any of this is too confusing, I've spent a good 3 hours troubleshooting my connections here and I'm a bit tired. If you need clarification on anything just let me know.
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 78
Posts: 1719
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you uploaded blink using "Upload With Programmer", it will have erased the bootloader.
You will need to re burn the bootloader using ArduinoISP in order to upload normally (via usb).
Logged

~Tom~

Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Go Banana!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That makes sense. Am I right in assuming that there's no way to upload the code "normally" using the Arduino as an ISP?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you had two arduinos as pictured above, why not just connect USB cable to the 2nd Uno & download sketch directly?
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Go Banana!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you had two arduinos as pictured above, why not just connect USB cable to the 2nd Uno & download sketch directly?

The two-arduino setup was just me troubleshooting. I initially noticed the problem when I used my ArduinoISP shield to burn the bootloader and upload a sketch to an ATmega328P. After doing that and putting the ATmega328P back into an UNO I couldn't upload any more sketches to it, so I wanted to verify that this wasn't a problem with my shield.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Me too experiencing the same problem after flashing bootloader to new Atmega328p uC...smiley-sad cannot upload any sketch.... Any solution guyz??
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You may have a mismatch in speeds between what the bootloader is using and what the IDE/PC is using.
I had the same problem a while back - had loaded optiloader on a chip I had on a Duemilanove - if Duemilanove was selected as Board type sketch downloads failed. Sketch download did not work until Board type was selected as Uno.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: