This tells me the problem is coming from the PC, but I don't know how to prevent the resets on the Arduino side.

I see this as a big problem in my particular application. I hope a solution comes soon.

Sounds to me like your PC has something in it that is scanning for unconnected comm ports, such that as long as the comm port is opened and assigned to an application like your processing program then all is well. But when you quit the app and the comm port is released something is scanning for it by opening it and then closing it at a periodic rate. Do you have any bluetooth drivers active, or something like that, that would be searching for comm ports?

Though it's not occurring nearly as frequently, it's still happening. I've noticed a lot of "serial noise" on the arduino through the fact that it executes a command occasionally. The command is executed upon receiving a "0" over the serial stream. Yes, probably not a good idea for that to execute a function, so I should change the code for that.

Some interesting things I've noticed:

- My desktop PC randomly powers itself up when shut off. I suspect this is related to the same EMI issue that is causing the arduino to get serial noise and corrupt the com port in windows. Wake on LAN is not turned on. Probably some kind of EMI causing the ATX power on signal to go high. Solution right now is turning off the switch on the ATX power supply.

- The serial noise sometimes corresponds with an inductive load (mini fridge) cycling. This fridge is on the same circuit but a different outlet in the room. Might be related perhaps.

- Sometimes the serial noise occurs when the PC has been powered off and I then switch the ATX switch to on.

Wish I could track this down. I don't have a scope, and suspect in order to really get any further I'd need one. I will try taking the mini fridge off that circuit, however, and see if that makes any difference.

I hate to seem like I keep bumping this or whatever, but I did want to share what I found out from my extensive troubleshooting on this problem, hopefully it's helpful information to anyone with a similar issue.

I've now had things running without any serial port crashes for over a week. I cannot say for certain what exactly "fixed" the problem, but it was one of two things:

1) I added a MOV in parallel with the mini fridge to get rid of the inductive kick when it switches off. Even though I moved the fridge to a different circuit and the other 120V leg, I still noticed a clear correlation between when it shut off and noise on the serial port.

2) I needed to get a new case for my desktop system since a video card I was upgrading did not fit in the old one. Obviously this changes the grounding characteristics and etc of the system. It's possible the old case had a fault that caused random noise on the USB ports.

I strongly suspect the MOV is what solved the problem, but I have no way of knowing since I don't have a scope. I'm sure this would have been a lot easier to track down if I did have one. Of course I'm still not 100% certain it's truly fixed either.