(Topic changed to better described the problem and let others know it got fixed.)
Hi all!
I just ebayed what was called "NEW ATmega2560-16AU CH340G MEGA 2560 R3 Board" and am having some troubles with it. (I suspect it being a clone since it doesn't have the six-pin header near the USB port, only a six-pin ICSP header next to the main Atmel chip.)
When I first got it, I uploaded the 'Blink' sketch just to test it. That worked well. After that, I can't upload sketches anymore!
However, if I connect an USBasp to the ICSP header and choose 'Burn Bootloader' from the Arduino IDE, then that seems to always succeed, and the next time I plug in the Arduino via the USB port, again I can program and upload ONE sketch - it refuses to accept new sketches after that.
I can seemingly repeat this over and over.. re-burning the bootloader and then being able to upload a single sketch through the CH340G chip/USB port. (It doesn't matter if it's the same sketch that just worked, that I try to upload again - it's only the first time I upload that will work, all subsequent tries gives 'timeout' from avrdude.)
Any help on this, please? Is there a particular bootloader binary I should put on this board that will work better than what's in my Arduino IDE? (Arduino 1.6.6/Linux 32-bit, if that helps.)
The baffling part is, how come the first upload works without problems but after that I'm "locked out" even though I'm using all the same settings?
Board Arduino Mega, Processor Mega 2560, Programmer AVRISP mkII, avrdude says this while programming the first sketch:
Using Port : /dev/ttyUSB0
Using Programmer : wiring
Overriding Baud Rate : 115200
AVR Part : ATmega2560
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Something just hit me - can it be so evil that the Mega2560 chip also has the bootloader on it, and when I upload my first sketch, I also overwrite the bootloader?? That would certainly explain why it won't respond to further upload attempts, since the Blink example code doesn't include a fresh bootloader.. But if that's the case, how do I keep from erasing the bootloader when uploading new sketches? Or should I resign to just upload via the ICSP port and skip "the easy way" of upload-and-testing through the USB port?