This problem is an old one for me:
when I am using the serial interface, that is, there is a device connected to "Serial", I cannot upload a program using Arduino IDE. I am using DueMilaNove.
My solution is simply to open the RX (I/O 0) pin. But this is very annoying because I have to do this millions of times. Is there any way to avoid this? I believe not because there is just one single way to upload the program: the Serial interface.
For Arduino Mega, I never use Serial for my apps, which is not a problem because I still can use more 3 serial channels.
Is there any way to avoid this? I believe not because there is just one single way to upload the program: the Serial interface.
No, there is no true solution to that situation if using the hardware serial function externally. Pins 0 & 1 wire to both the shield connector and to the on-board FTDI usb serial converter chip, so if you need to use the on-board serial function, as in uploading from the PC, there can be interaction with anything you have wired externally to those pins.
There is a software serial library available you could use for your external communications needs that can utilize any two other pins you have available.
I will open a new thread to discuss how accurate and issues related to software serial implementation.
Have you tried just putting a double pole switch in series with your external Rx/Tx lines to disconnect them?
Yes, I also have this solution, but not for all platforms I am working...