I'm building a distributed robot control system using 5 UNO boards, 4 'twi_slave' UNO controlling steppers and one 'twi_master' coordinating motion and communicating with a PC via USB (and with the slaves over TWI). I developed this under the Arduino IDE, but moved to AVRStudio4 when I began having stack overflow problems, needing the additional tools for memory mapping.
This move from the Arduino IDE to AVRStudio4 requires I compile the core, including HardwareSerial.cpp. It compiles fine, but the first time I ran it, I fried the USB driver chips on the UNO. That UNO is toast.
In searching for a cause to this bug, I read the source for SoftwareSerial.cpp, which includes a call to digitalWrite(_transmitPin, HIGH ); The init() code of HardwareSerial.cpp does not have this assignment. If the USB of the PC and that of the UNO each tried writing to the same wire, this could cause the UNO to fry.
So my questions to the forum are:
1 - Is there a pin assignment to the USB in/out of the UNO associated with HardwareSerial.cpp? If so, where is it? Perhaps in .init4? 2 - Is there any other reason the USB on the UNO could fry? 3 - Suggestions as to how to avoid stepping in this particular cowpie again?