New to Arduino. My question is about using the serial monitor (PC) for debugging purposes
(Serial.print messages) while powering the arduino with a external 9V power supply. The
serial communication is done through the USB cable but once I attach the 9V ext. ps, the USB
is disabled (COM port dissapears).
I know about pins 0 and 1 (RX/TX) for serial communication, but those are only 2 pins and all
USB to serial cables I've seen end up in a 6 pin connector (RX,TX plus others).
The simplest way is to disconnect the battery when using the USB cable. You should be able to use both, IF you are putting the 9V in the right place. But, we have no idea where you are putting it, or why this is an "Interfacing with software on the PC" issue.
mainex:
The serial communication is done through the USB cable but once I attach the 9V ext. ps, the USB
is disabled (COM port dissapears).
If that is true, and it may not be, you have a serious problem, or a fundamental misapplication.
The USB cable provides both signal and power, just like for any other USB device.
It is (usually) quite OK to power any bare Arduino from the USB cable, but you are likely to get problems when you add stuff.
Common practice, therefore, is to use a 9v wall wart (not a PP3 battery) connected to the barrel jack AND have the USB cable connected at the same time. Arduino doesn't care where the power comes from, it just takes what it needs from wherever it can get it.
So, is your 9v external supply a kosher wall wart, and not a 9v PP3 battery?
And, is it plugged into the barrel jack?
Note that common wall warts are 1amp. Anything less is likely to be a lot less - and inadequate.