I have a PC connected to the USB port on my Mega 2560 Arduino-based still controller. Everything is fine when the Arduino controller is turned on and then the PC is turned on. However, when you shut down the Arduino controller and then restart it, the Arduino controller goes amuk. Here are some important facts. If I disconnect the USB connection to the PC before shutting down the Arduino controller, the Arduino controller restarts just fine. Then, when I reconnect the USB port, everything works fine. The Arduino controller has its own 9 vdc power supply plugged into Arduino and it, of course, shuts down when the controller is shut down. Do I have to instruct the user to disconnect the USB port if he is going to power down the controller and then power back up or is there something that can be done in software to make it work without disconnecting the PC? I suspect the problem has something to do with the reset that is done (or not done) when powering back up. When the controller powers down, the 9 vdc supply turns off, but if the PC is still connected, I think power is still supplied to the Arduino through the USB. This does not seem to work. On the other hand, if the PC is disconnected, all power is removed and when the controller is powered back up, the Arduino goes through the normal power up sequence, which works fine.
I've read many of the "reset" posts, but have not found anything relative to this issue