I've found that Arduino Mega restarted when a message send to Ardoino through USB.
Steps to reproduce:
connect USB cable Arduino to Linux
send any message to Arduino
read from Arduino: Serial.read
Arduino reboot immediately.
Is there any way to stop it?
Mega has several RX/TX pins.
Will it work with additional USB port from arduino?
Something like this probably? :
usb adaptor
Yes, it is supposed to auto reset when you establish a serial connection through USB, because that is how the Arduino runs the bootloader to upload a sketch.
You can use one of the other serial ports other than RX0/TX0, such as RX1/TX1 using a cable such as the one you linked to, and it will not auto reset. The Serial statements would need to be changed in your sketch from Serial.begin to Serial1.begin, and change all the other statements such as read in the same way, Serial.read to Serial1.read, etc.
Or you can simply disable auto reset and continue to use the built-in USB Serial port by connecting a 10uF or bigger capacitor between GND and Reset. The striped or negative side of the capacitor goes to GND. Remove the capacitor before uploading a new sketch.
Thanks,
I've tried a solution with capacitor. Each time disassemble device to load new code became annoying problem.
Probably for production or for static code it will work...but for development - that's a disaster ;(
Will try another USB port.
thanks again.