Can upload once after burn bootloader

I used this method to burn a bootloader on my atmega2560

it works great, but the problem is that i can only upload a sketch once, then i have to burn the bootloader again, cause when i try uploading a second time i got timeout error.

anyone know how to solve that ? i tried pushing reset button when start uploading but did not work.

Do you burn an ATMEGA328p bootloader into Atmega2560 ?

No, i burned ATmega2560

Usually the "can only upload once after burning bootloader" symptom is caused by your board's auto-reset circuit not working.

Normally you need to do a hardware reset of the microcontroller to activate the bootloader, then start an upload before the bootloader times out and starts the user application. However, after burning bootloader the bootloader is perpetually activated so no reset is necessary, meaning the first upload will work with or without a reset.

The auto reset circuit is the DTR pin of the USB-TTL serial chip connected to the reset pin of the ATmega2560 via a 0.1 uF capacitor. In combination with the pullup resistor on that pin, it generates a reset pulse when the serial connection is opened.

To test this, you could see whether uploads work after a manual reset. The tricky thing is that when you press the "Upload" button in the Arduino IDE, it first compiles your sketch before starting the actual upload. If you reset the microcontroller immediately after pushing the button, the bootloader will have timed out by the time the upload actually starts. The way to get the timing right is:

  1. Select Sketch > Upload from the Arduino IDE's menus to start an upload (or click the upload button or whatever you prefer).
  2. Watch the black console window at the bottom of the Arduino IDE window until you see something like this:
    Sketch uses 444 bytes (1%) of program storage space. Maximum is 30720 bytes.
    Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. 
    Maximum is 2048 bytes.
    
  3. Immediately press and release the reset button. The upload should now finish successfully.

Yeah, you are right, this is the problem, can u show a scheme on how to do this ? with this capacitor ? cause i know nothing about this things hehe

Here is a good one:


In that schematic, it's the C1 capacitor and the R1 resistor.

Still dont get it, do u have a photo showing where each side of resistor i'm gonna to connect ?

There's one in this tutorial:

But this is for when you are creating a circuit from a bare chip. The situation is a bit different if you have a regular Arduino Mega board because you don't have so much access to the circuit.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.