5

If I connect to an Arduino Uno via a serial console to read debugging statements and then disconnect, the Arduino appears to reset. How do I stop this from happening?

I'm trying to program an Arduino to receive a "shutdown" signal from a Raspberry Pi via serial, which will make the Arduino cut the RPi's power. However, this will also cut the serial connection, and if it causes the Arduino to reset, it'll reactivate power.

4

There is a link on the Uno marked RESET-EN which links the Atmega16U2 (or 8U2) which handles incoming serial data to the main chip, the Atmega328P. If you cut that link (eg. with a knife) then it won't reset. However uploading new sketches will be harder because you will have to manually press the Reset button when the IDE starts to upload a new sketch.


Board:

RESET_EN link


Schematic:

Schematic


One thing that people do is put a 10 µF capacitor between RESET and GND. That holds enough current to "weather" the reset pulse, and that stops the board resetting. You can always remove the capacitor to reprogram the board.

  • I have seen this on the Schematic and never understood what it was for. I gather the diagram is meant to indicate a pad with a cutable link. – Milliways Feb 8 '16 at 9:34
  • So you're saying the serial connection is hard-wired to perform a reset after disconnect? I can understand it resetting after a sketch upload, but why also reset after a non-programming serial connection? – Cerin Feb 8 '16 at 16:57
  • No it's not. However if your operating system brings DTR low when you disconnect, then that will generate the reset pulse. Do you physically disconnect, or drop the connection? – Nick Gammon Feb 8 '16 at 19:35
  • Tried to put 10uF ecap in my Uno, seems to be not working at all. in fact any data written to serial does not go thru at all. – GeneCode Dec 23 '18 at 8:02
0

I found the solution to my problem was this answer, which works for me on both a normal laptop and Raspberry Pi without having to modify any Arduino hardware.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.