Arduino Mega broken but still working?

Hi,

My Weather balloon project was getting a bit big for an Arduino Nano so I purchased a Mega Pro. I uploaded the sketch to it on the board on its own, nothing attached, it uploaded fine and the serial monitor printed some of the setup strings.

Then I soldered the Mega Pro onto some perf board with everything attached and its throwing this error:

Sketch uses 28066 bytes (11%) of program storage space. Maximum is 253952 bytes.
Global variables use 1648 bytes (20%) of dynamic memory, leaving 6544 bytes for local variables. Maximum is 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1

So now it won’t upload any sketch at all.

Now it's obvious that something in the hardware isn't working, but I've triple checked all the connections and it looks ok, I even unsoldered the 5vline from all the sensors so nothing apart from the board is powered but still no joy. Strangely the old code is still working and the serial monitor is still printing the strings for setup.

What could I Have done or broken for it to behave like this?

Go into tools and check if you have the correct board. It may be a different version and so try some of the others to be sure.

It’s definitely the correct settings, as I didn’t change them between uploading the original code when the board was ‘naked’ to when it was all soldered in place.

I don’t think it’s bricked because it still works, just can’t upload. The cable is good as I’ve tested it on something else.

Ok I've kinda solved it.

" 1. Board is not in Bootloader Mode:The Arduino Mega is not executing the bootloader for some reason. If the programmer is not resetting the micro before attempting to connect, this might be the reason. Try to reset the board (press and release the button) while the programmer is attempting to connect. Sometimes software that runs in a tight loop will prevent the bootloader from connecting. Barring that, the fuses might have gotten messed up or the code erased. You would need to reflash the bootloader and proper fuses, again, see the appropriate info page for your device."

This was the issue, but does anyone know why or how to make it so I don't have to do this?

Hi @jaddion82052.

The Mega 2560 has an "auto-reset" circuit that momentarily pulls the ATmega2560's reset pin LOW when the serial port is opened. This reset activates the bootloader. This means that when you upload to the board, the opening of the serial port for the upload automatically activates the bootloader and allows the upload to proceed without the user needing to manually reset the board as would be the case if there was no auto-reset circuit.

If you connect anything to the board's reset pin, this could cause the auto-reset circuit to no longer function. It might seem unlikely that the reset button would still function under those conditions, but the auto-reset circuit is more sensitive than the button circuit, which simply connects the pin directly to ground so it is possible.

So carefully check your soldering around the reset pin to make sure you didn't create any connections, shorts, conductive debris, etc. there.

There is a nice explanation of the auto-reset circuit here:

It is for the UNO R3, but the circuit is the same on the Mega 2560 (and presumably on your "Mega Pro" as well, but not guaranteed).

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