Arduino Serial Monitor  - Reset  - Page 1
Forum section: electronics / general

author: picandmix
author_rank: Frequent Contributor
timestamp: May 06, 2017, 10:10:00 am
content: Hi,When using the Arduinos Serial Monitor with the Arduino IDE and a Uno to just send Out basic text , if the serial monitor is closed down then opened again, it causes the program in the chip to restart from the beginning, which I gather is normal.Using the same program code but instead connecting the serial /usb output to an independent terminal like Putty or Teraterm on the PC, it does the same thing ?How / why do these terminal programs cause the Uno to reset when they are only receiving data ?Is there any parameter I can change in Putty /TeraTerm to stop this happening eg I just want to occasionally view the Unos output , not monitor it all the time.

author: FreddyVictor
author_rank: Regular Contributor
timestamp: May 06, 2017, 12:14:27 pm
content: Quote from: picandmix on May 06, 2017, 10:10:00 amThe typical serial connection has some other wires apart from the TX & Rx data, one being the DTR (opposite end to GND on a serial breakout board).This wire gets signalled on a serial connection and on Arduino is connected to the uC RESET.On UNO, things are not exactly as above since there is a 2nd ATMega used for the serial, but the principle is the same.Looking atSparkfun Uno R3 board, there is a 'RESET EN' jumper which is shorted by a trace and allows the reset to happen.You can - using a knife - cut through the track between the jumper breaking it, then solder/un-solder it when required or not.Note though that when flashing from the IDE, the board must be reset somehow, so having the jumper disconnected will requirethe userto reboot it by pressing the reset button on the board at the appropriate time - so really not ideal!Could do with a proper pinheader jumper fitted ....I have yet to see any setting that stops the sending of the DTR signal from the host side, but there may be oneI'm guessing it's probably something to do with the driver rather than the serial terminal being usedYou can ofcourse get another serial breakout board and then connect its Rx (plus a Gnd) to the boards Tx (D1) header so you can then see the serial output.Opening/connecting/closing this won't cause any resets

author: Seekonk
author_rank: Super Contributor
timestamp: May 06, 2017, 12:31:35 pm
content: That is annoying. I found somewhere that you can keep it from resetting from a USB connect if you put a 10uf or higher on the reset pin. Keep it removable because you will not be able to upload new programs with it in place.

author: Ian.M
author_rank: Super Contributor
timestamp: May 06, 2017, 12:41:11 pm
content: The reset signal is capacitively coupled to the ATmega328P (with a pullup resistor) so any low going transition on the handshake line resets the MCU, but if the line is low it isn't held in reset.There's a bodge that will work - If you plug a >1uF capacitor into the header between Reset and Gnd (negative side to Gnd if electrolytic), it forms a capacitive potential divider with the 100nF reset coupling cap limiting its swing to 0.5V, preventing the reset pin from going low. You need to remove the extra cap to program if you don't want to mess with the reset button fumble, and it will reset if you plug it in while powered because the cap's uncharged, but it wont reset when the port's opened/closed or the handshake line's toggled as long as the cap is there. Keep the cap as small as possible that will do the job as its hard on the manual reset button.However, smart people cut the reset jumper previously mentioned and wire in an ultra-miniature SPST slide switch or similar. If you use a SMD one you can solder its mounting feet to the side of the USB B connector housing, with a sliver of Kapton tape under its electrical leads so they are isolated from the housing so you can fly-wire the switch back to the pads of the jumper you cut..

author: tablatronix
author_rank: Regular Contributor
timestamp: May 06, 2017, 12:45:36 pm
content: disable flow control in your terminal, turn off dtr and rts, also I thought that arduino ide bug terminal reset was fixed , maybe it only works for some boards or your boards.txt is different, not sure which reset method the uno uses, but I thought auto reset was fixed.What ide version you using ?

author: Buriedcode
author_rank: Super Contributor
timestamp: May 06, 2017, 01:21:06 pm
content: As suggested there are hardware solutions:https://tushev.org/articles/arduino/22/preventing-arduino-from-auto-reset-when-com-port-opens-closeshttp://forum.arduino.cc/index.php?topic=48577.0But also you can prevent the board resetting by disabling the DTR line/flow control in your terminal software.I have found that for most 'Arduino' applications (ie: knocking up a quick prototype to test something) the fact it resets when the terminal is opened is an advantage: it can display data sent at the very start (like in the setup routine). But you're right, for applications where one uses the terminal for occasional monitoring it is irritating. I would lean towards a hardware solution, even permanent mod on the Arduino board as they (and their clones) are so cheap.

author: TK
author_rank: Super Contributor
timestamp: October 30, 2017, 12:28:43 pm
content: If you need the serial monitor output in a permanent basis, you can use a separate USB to TTL cable/adapter and hook it directly to the RX/TX lines and use the incorporated USB port only to program the ATmega328P MCU.