IDE resets Mega Rev3 when open

Hi,

With IDE closed, I connect Mega Rev3 board with USB to PC. When I open IDE, after project properly loads the boards resets.

Q1: Why does board reset ?
Q2: What to do to prevent this IDE behaviour ?

Thank you
Frank

It's probably because the terminal (serial monitor) opens and that resets the microcontroller. Keep the serial monitor closed and the board shouldn't reset. Using a different terminal program for UART communications may/will prevent the reset thing; I often use Termite for this (although it tends to suffer from buffer overflows under certain conditions).

1 Like

as @rsmls says, the Serial monitor resets the board, You can put a 10uf capacitor across RST & GND which will (usually) stop the board from resetting, although for uploading sketches the board needs to be reset, so either you will to remove it again or you have to press the reset button manually during upload the same way you would on a Pro-mini. Alternatively you could use a separate USB to TTL converter to connect one of the Mega's other UARTs to the USB of the PC.

1 Like

I'll elaborate slightly on what @rsmls wrote in case it isn't clear:

Arduino IDE remembers whether or not you had the Serial Monitor view open the last time a given sketch was open and restores the IDE to that same state the next time you open the sketch (which will be done automatically on IDE startup if the sketch was open at the time you exited the previous IDE session).

If you want to avoid the Serial Monitor being open the next time you open the sketch, remember to close the view by clicking the X icon on the "Serial Monitor " tab in the bottom panel of the Arduino IDE window:

215050213-e6c41c1a-0eae-448a-ae91-f2acefedf793

2 Likes

Great, thanks. But why is the reset by Monitor necessary ? I'll add request to add setting to disable this.

Not really helpful in my case but good to know about the capacitor. Thanks.

There is one already:

https://arduino.github.io/arduino-cli/latest/platform-specification/#serial-monitor-control-signal-configuration

1 Like

Ah yes. I had noticed that and then forgot about the Monitor behaviour when left open. Its only few weeks I use Arduino, will take time to learn all the dos/donts. I tried to send data aslo to another UART. Still dont see the point in reseting the target just because you want to listen to the data.

Much appretiate your prompt replies @ptillisch . Will have a look. Thank you.

I tried Different terminal and that resets the boards as well
https://freeware.the-meiers.org/

Hm, interesting. So its not about the IDE. Seems it has something to do with that MCU sitting between PC and Atmega.

There is some general information about it at the link I shared in my previous reply.

If you would like to learn about how it works at the electrical level, there is a good explanation here:

(that is about the UNO R3, but the Mega has the same auto-reset system)

2 Likes

I was tinkering with an idea to hook up few probes to my board, but fortunatly, you saved me from that. Thank you again.

1 Like

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