pert:
You can make it not reset by using a different terminal program than Serial Monitor, which won't send the reset pulse.
This is incorrect. autoreset is being trigger by DTR.
The DTR signal is controlled by the OS not the application.
When the application opens the serial port, the OS drops DTR and holds it low for as long as the serial port is open.. This happens before the application can do anything to stop it.
Applications can contrl RTS and some, but not all, operating systems do allow applications to control DTR, once the port is open.
However, the application has to open the serial port to be able to manipulate any of the modem control signals, so by the time the open() function, which is used to get control the serial port, returns, it is too late. DTR has already been set to be low, which triggers the auto reset in the Arduino h/w
When auto reset uses RTS instead, then the auto reset does not automatically happen when the serial port open is done.
In fact the original FTDI USB to serial cable used RTS and not DTR. It was nice in that when the original FTDI serial port cable was used, auto reset would not happen when the serial port was opened.
What never made any sense to me was that when the Arduino design abandoned the FTDI chip in favor of 16U2 they should have changed the code to use RTS instead of using DTR. That would have allowed the open to work without reseting the board.
avrdude has code to explicitly toggle RTS when the "arduino" protocol is used so auto reset would still work for uploads for cables that used RTS instead of DTR.
The older IDE opened the serial port, toggled RTS, and closed the serial port before it ran avrdude, so that even before the "arduino" protocol existed, you could use RTS instead of DTR.
Using RTS instead of DTR the best of all worlds.
The whole reason DTR was used rather than RTS was they went for a h/w solution to a s/w problem.
When auto reset was originally added it was done as a h/w only modification to the board.
Because the OS drops DTR to low when the serial port opens, when using DTR for auto-reset nothing has to be done to support it in any of the s/w applications - like avrdude.
However, the DTR remains active - low - all the time the serial port is open.
This is the reason a cap was put in series with the auto reset signal. This changes the DTR level based signal to a pulse so that the AVR can start running again.
When using RTS instead, the application can do a real pulse and there is no need for a cap.
But like I said, the side effect of using DTR for auto reset is you will get it whether you want it or not, whenever the serial port is opened.
Some version of Windows used to have some advanced settings that allowed controlling the DTR behavior at open time. While this violates the standard, it can be useful for certain situations where there are h/w issues that need a work around - like in this case.
--- bill