Have to reburn bootloader to reprogram standalone ATMega328p

Hi
Here we go again…

I’m trying to use my (genuine, italian made) Arduino Uno to program a standalone ATMega328p-pu chips. It’s meant to run programs using its internal 8MHz internal clk (no external crystal or resonator).

My Arduino IDE is v. 1.6.5. I’m using Gammons great guide on how to burn the bootloader onto the chip (Link). I have the newest versions of his “Board_Detector”- and “Board_Programmer”-codes.

The bootloader burning works great. The chip get verified, and I burn the “Lilypad Arduino”-bootloader onto the chip as suggested in the guide.

I then wire the board as shown below with the addition of a 10uF capacitor between RESET and GND on the breadboard Mega328 (now with bootloader).

I select “Lilypad Arduino” as my board and keep “AVRISP mkII” as my programmer and upload a program onto the chip. According to Arduino IDE the program is successfully uploaded to the chip.

I then try to upload the same, or another, program to the chip. The loading-bar becomes stuck indefinitely at 90% with the message “Uploading…”. When attempting to reupload the program to the chip I get: (Certain parts translated to English)

Arduino:1.6.5 (Windows 8.1), Board"LilyPad Arduino, ATmega328"

avrdude: ser_open(): can’t open device “\.\COM4”: No access.

Problems while uploading to card. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xee

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xee

Problems while uploading to card. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

If I disconnect the USB cable, reopen Arduino IDE, and try to upload a program the Loading-bar again gets stuck at 90%, and every following attempt at reuploading has the same error message as the one above.

Now I’ve attempted to reburn the bootloader a bunch of times and every time I get a successful upload of the first program, followed by failure on every consecutive upload.

I’ve used modified versions of the basic “Blink.ino” example to test the seemingly successful uploads. They work. The intended program however, which is more complicated, does not, even though Arduino IDE claims the program was uploaded successfully.

So…

I’ve tried to search for answers on this bizarre issue, but I’ve come up empty handed (hopefully due to using the wrong search-words). Is anyone familiar with this issue?

knutolai:
...
I then wire the board as shown below with the addition of a 10uF capacitor between RESET and GND on the breadboard Mega328 (now with bootloader).

I select "Lilypad Arduino" as my board and keep "AVRISP mkII" as my programmer and upload a program onto the chip. According to Arduino IDE the program is successfully uploaded to the chip.

I then try to upload the same, or another, program to the chip. The loading-bar becomes stuck ....

Is anyone familiar with this issue?

Ok, here's the deal:

When you put a bootloader on the chip, all it does is run continuously. So, it will definitely work to upload a program. Once you use the bootloader to upload a program once, the bootloader never runs again, unless you reset the processor. It just runs the program you uploaded.

By adding a 10uF capacitor between RESET and GND you have disabled reset. Remove the 10uF capacitor between RESET and GND, so auto reset will work.

You have the instructions for using the Arduino as a serial adapter, muddled!

Go back and re-read Nick’s instructions.

Oh my... Am I really this stupid?

Yeah it's working now. Thank you so much! I've been stuck with this for 2 days. :blush:

knutolai:
Oh my... Am I really this stupid?

Yeah it's working now. Thank you so much! I've been stuck with this for 2 days. :blush:

But, I can almost guarantee you that you will never repeat this mistake. Hard knocks often have forward momentum.

Ray