AVR ISP shield uploads bootloader then won't communicate again.

Hello guys and gals.
I’m sorta of in a weird bind.

I bought a AVR ISP shield and I can program atmega328p-pu with UNO bootloader over and over and upload sketches to it just fine.

But when I try to upload a bootloader to it for atmega328p-pu using 8mhz internal oscillator I have issues.

I upload the bootloader just fine everything works the first time with a blank chip. Then I try to upload a sketch and AVR will just keep saying 0x03 error over and over.
If I take the chip and put it on a breadboard and hook up a LED it will blink the LED since it has the blink sketch on it. But if I try to put it back in the programmer to upload a sketch it will give me the same 0x03 error over and over again.

Now mind you up until I upload the 8mhz internal bootloader the chip will work just fine IE take bootloader for UNO and sketches.

If you guys can help me that would be awesome as I’m trying to figure out a way to program atmega328p-pu to use with and without oscillator so I can choose which ever option suits the build I’m doing while keeping me stock in only one chip.

Big thanks to all

uvamosk:
But when I try to upload a bootloader to it for atmega328p-pu using 8mhz internal oscillator I have issues

Which bootloader?

uvamosk:
everything works the first time with a blank chip.

Do you mean you can upload a sketch the first time after uploading the bootloader or that you can only upload the bootloader and uploading a sketch fails every time.

uvamosk:
Then I try to upload a sketch and AVR will just keep saying 0x03 error over and over.

It’s much more useful to post the full error message. Please use code tags(</> button on the toolbar) whenever you post warning/error messages.

I just tried to put the Arduino Pro or Pro Mini ATmega328 (3.3V, 8 MHz) bootloader on my Pro Mini today and couldn’t upload to it:

C:\Program Files (x86)\arduino-1.6.9\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\arduino-1.6.9\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM12 -b57600 -D -Uflash:w:C:\Users\per\AppData\Local\Temp\build423dc2a9ff91db321f7c3176646a0576.tmp/sketch_jul25a.ino.hex:i 

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\arduino-1.6.9\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM12
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x55

etc. No problems uploading when using the 16MHz Pro Mini bootloader or the Uno bootloader.
Well actually my intent was just to verify that the 8MHz Pro Mini bootloader had the watchdog endless loop bug so I skipped further troubleshooting and tried the MiniCore ATmega328, 328P / 328PA, 8MHz internal and it worked fine. So you might give that a try, compared to the stock Pro Mini bootloader it’s smaller and doesn’t have the watchdog bug: GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB

I checked the fuse settings in boards.txt and found the cause of my problem: The Pro Mini 8MHz entry is set to use an external 8MHz crystal, not internal. Since mine has a 16MHz crystal of course it didn't work.

I followed this tutorial and used the breadboard 1.6.x board file. https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

Only difference I'm using the sparkfun AVR ISP shield instead of the wiring setup they use.

The second question you asked is the interesting one because I can upload the above bootloader once then the chip becomes unresponsive with the 0x03 error 10 times and times out the next time I try to write the same bootloader to it right after I just uploaded it to it.

But! I can put the chip on the breadboard and it will blink a LED. So I was assuming the blink sketch was part of the bootloader upload.

I can't upload the full error I'm at work, but it looks exactly like the one you put up except it says 0x03 and the baud rate is 19200. It doesn't matter if I do sketch or bootloader it always says 0x03 even if I try to upload a standard UNO bootloader.

Thanks for your help...!

uvamosk: I followed this tutorial and used the breadboard 1.6.x board file. https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

I just put it on my Pro Mini using Arduino IDE 1.6.9 and USBasp programmer and was able to upload to it after so it is possible to use that bootloader.

uvamosk: Only difference I'm using the sparkfun AVR ISP shield instead of the wiring setup they use.

Are you able to try uploading when the chip is on the breadboard, not connected to the shield? That would eliminate the shield as the cause of the problem.

uvamosk: But! I can put the chip on the breadboard and it will blink a LED. So I was assuming the blink sketch was part of the bootloader upload.

Correct, the blinking LED is an indication the bootloader is on there. It should be a short flash(maybe 100ms) once a second.

uvamosk: I can't upload the full error I'm at work, but it looks exactly like the one you put up except it says 0x03 and the baud rate is 19200.

Please check the box next to File > Preferences > Show verbose output during: upload, then try an upload, then copy everything in the black console window and paste it in a message here.

I do recommend using MiniCore instead of that breadboard bootloader because the breadboard bootloader will use 1.5kB more flash and has a bug that causes an endless reset loop after the MCU is reset by the watchdog timer. For use with 16MHz crystal the Uno bootloader is fine, it's doesn't have any significant disadvantages vs MiniCore.

Arduino: 1.6.9 (Windows 7), Board: "Arduino/Genuino Uno"

Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB

Sketch uses 1,066 bytes (3%) of program storage space. Maximum is 32,256 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 2,039 bytes for local variables. Maximum is 2,048 bytes. C:\Special Projects\Arduino\hardware\tools\avr/bin/avrdude -CC:\Special Projects\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM3 -b19200 -Uflash:w:C:\Users\Uva\AppData\Local\Temp\build99ac4d5ebe121648fce34a28f1ee5de3.tmp/Blink.ino.hex:i

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch

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

Using Port : COM3 Using Programmer : stk500v1 Overriding Baud Rate : 19200 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03 avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03

avrdude done. Thank you.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

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

The above is all I get when i try to load a sketch or a bootloader.

The chip is pretty much worthless other than just making a led blink.

I'm really confused why I can write a bootloader to them and after that they become locked or have communication issues. I have 3 chips now that I can't do anything with as they all 3 give me this same problem. I also don't seem to see anyway to erase them to try to write on them again. I cant see it being the AVR ISP SHIELD as before I tried to use the "8mhz internal oscillator" I could write on them over and over and over bootloaders and sketches.

Compare the switches passed to avrdude in your upload:

uvamosk: -v -patmega328p -cstk500v1 -PCOM3 -b19200 -Uflash:w:

to mine: -v -patmega328p -carduino -PCOM12 -b57600 -D -Uflash:w:

I'm using the same board files(https://www.arduino.cc/en/uploads/Tutorial/breadboard-1-6-x.zip) and the same IDE version(1.6.9). Why are they different?

If you look at the 1.6.x boards.txt from that tutorial:

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

You can see that indeed, protocol should be arduino, not stk500v1 and upload baud should be 57660, not 19200. Please post the contents of your {sketchbook folder}\hardware\breadboard\avr\boards.txt file.

uvamosk: I'm really confused why I can write a bootloader to them and after that they become locked or have communication issues. I have 3 chips now that I can't do anything with as they all 3 give me this same problem

Usually the cause of this is setting the fuses on the chip to use an external clock when you don't have a crystal attached. The solution is to connect the correct crystal and after that you can reset the fuses to whatever you like.

I took the chip and put it on a breadboard and hooked it straight to the arduino per the tutorial https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

It worked flawlessly... multipul boot loader uploads and sketches...

So then I put the chip back in the AVR ISP Shield and did a bootloader upload and it worked great. Then I tried to upload a sketch and bam got that same error 0x03. So I pulled the chip put it back on the breadboard and tried to write a bootloader to it and again success worked just like it should.

Took the chip back out put it in the AVR ISP shield and wrote a bootloader to it and again it worked fine. Then tried to do a sketch and again 0x03 error..

WTH is going on.