[Programming&Bootloader Problem] with ARDUINO MEGA 2560

Hello everyone,

I made an arduino mega2560 by myself,and I buy IC from Taobao(From China).

When I first time to burn bootloader into the IC, IDE shows successful~

And I first time Uploaded a sketch into the board ,It's all Fine......(I uploaded 'Blink')

I tried to upload second time......IDE show"stk500v2 timeout",so I re-burn Bootloader into IC,IDE show some error,But I'm sure that there have no sketch in mega2560,because LED is off now.

Although shows error ,I still tried to Upload a sketch into board after I re-burn bootloader ,It's successful..........It's really weird!!!!

My flow:
1.Burn bootloader(First time,and shows successful)

2.Upload a sketch(First time,and shows successful)

3.I got a problem(stk500v2 timeout) when I want to upload a new sketch(Second time,show error 'timeout')

4.I tried to re-burn bootloader,but shows error.....

Does anyone know how to solve this problem? I saw other topic in Arduino Forum,I think is Bootloader problem.

Thanks Everyone for watching my article.

I would be looking at the DTR reset circuit.

Could also be a fuse setting problem.

aarg:
I would be looking at the DTR reset circuit.

Yup~I have checked DTR ,Reset Pin....It's connected,and have a capacitor 0.1uF between DTR,Reset Pin.
It's really weird!!
P.S I used CH340G USB2TTl IC.

CrossRoads:
Could also be a fuse setting problem.

How can I checked fuse setting?
It's there have any problem?......

Thank you for your reply~!!!

When you burn the bootloader you also set the fuses. In the IDE preferences you can checkmark the show verbose output on upload option. Then burn the bootloader and look at the output shown in the console area at the bottom of the IDE window. Show us the output (all of it).

What are you using for an ISP programmer device?

Are you trying to program an Arduino Mega2560 board using an external USB-serial adapter? That doesn't work - you have to reset it manually, because the existing DTR reset circuit (connected to the 16u2 serving as USB-serial adapter) interferes with the autoreset.

dmjlambert:
When you burn the bootloader you also set the fuses. In the IDE preferences you can checkmark the show verbose output on upload option. Then burn the bootloader and look at the output shown in the console area at the bottom of the IDE window. Show us the output (all of it).

What are you using for an ISP programmer device?

I used USBtinyISP,and I have checked Fuse Setting,the fuse setting is same as default.I also used WinAVR Write Fuse again,but still have error.

DrAzzy:
Are you trying to program an Arduino Mega2560 board using an external USB-serial adapter? That doesn't work - you have to reset it manually, because the existing DTR reset circuit (connected to the 16u2 serving as USB-serial adapter) interferes with the autoreset.

I'm not using 16u2,I use ch340g.

tsaifuming:
I used USBtinyISP...

Well that's the end of that mystery. USBtinyISP does not work with the large memory AVRs such as ATmega2560. You need to use another Arduino such as Uno or Mega as an ISP programmer, by loading the ArduinoISP sketch and selecting the programmer "Arduino as ISP"

DrAzzy is concerned that you may be trying to program with an external USB-to-serial adapter if there is already another USB-to-serial adapter built into the board. Auto reset will often not run correctly in that circumstance. We're not sure exactly what your board and any connecting wiring may look like.

dmjlambert:
Well that's the end of that mystery. USBtinyISP does not work with the large memory AVRs such as ATmega2560. You need to use another Arduino such as Uno or Mega as an ISP programmer, by loading the ArduinoISP sketch and selecting the programmer "Arduino as ISP"

DrAzzy is concerned that you may be trying to program with an external USB-to-serial adapter if there is already another USB-to-serial adapter built into the board. Auto reset will often not run correctly in that circumstance. We're not sure exactly what your board and any connecting wiring may look like.

But I can use USBTinyISP to upload sketch ...and It's work....It's all fine!!

You can't use it to upload a large sketch (over 128K) or a bootloader which goes in high memory. It ends up writing it to another place in memory and reporting back the upload was OK. I also do not recommend USBasp. There has been much discussion on the Microcontrollers section of the forum about USBasp and how some versions work OK and others do not, depending on the firmware.