I have a simple question but I'm unable to find an answer online.
I'm powering my Uno/Mega with and external battery through the Vin pin. If I upload a sketch and then disconnect the USB, the microcontroller keeps running the sketch as it should.
But when I reconnect the USB, and I start the Serial monitor, it seems that the sketch restarted from the beginning. Does reconnecting the USB reset the microcontroller?
Or maybe just the serial repeats all the messages from the beginning of the sketch?
Larry, that is interesting. I assume that the reset is caused by the same circuitry that allows the USB to reset the Controller as part of the upload process (DTR across a capacitor temporarily pulls the reset pin low). Cutting a trace to prevent this would then presumably also negatively affect the ability to upload new sketches which could be solved by manually pressing the reset button as part of the upload process. Are These assumptions correct?
I would also think that it would be possible to connect a FTDI to a running Arduino, leaving the one pin off that allows the reset. Connecting to the FTDI USB would then allow communicating with the running Arduino without causing an unintended reset.
Am I off on this? I'm interested because in a Project I am currently planning, I intend to connect to a running Arduino, send it a Signal, and have it dump the logged data out the Serial port. I definitely wouldn't want a reset. In my case, it's even easier because it's a Pro-Mini which only communicates over a FTDI anyway.