Go Down

Topic: Serial monitor resets arduino everytime? (Read 539 times) previous topic - next topic

joedodo

Everytime, when I open the serial monitor in the arduino ide, it seems, the arduino starts to work from the beginning of the code.  How does this happen?

If I just want the pc communicate with the arduino from time to time,  may I avoid this? 

Robin2

That is the intended behaviour. When the PC program opens the serial port the Arduino resets.

If you want to start a serial connection from time to time without disturbing the Arduino the simplest way is probably to use a USB-TTL cable connected directly to Rx Tx and GND.

There are mechanisms for disabling the auto-reset feature but they can get in the way of uploading programs.

...R

Two or three hours spent thinking and reading documentation solves most programming problems.

sterretje

#2
Oct 22, 2019, 07:31 pm Last Edit: Oct 22, 2019, 07:35 pm by sterretje
If you want the PC to communicate with the Arduino from time to time, you can use a dedicated terminal program. Saves you from having to open the IDE first as well.

Some offer the option to suppress DTR/RTS when opening the serial port. At the windows side of the world, RealTerm is one of them.

Alternatively, you can write your own.

// Edit
Be aware that only one application can have the serial port open at a time. So any terminal program can interfere when you want to upload a new code; that is the only benefit of using Serial Monitor as the IDE handles it all.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Go Up