releasing TX pin

I want to connect the TX & RX pins of the Arduino together.
Then I have to modify the Serial library in such a way that the TX pin is released (i.e. set as input) when the Arduino is not sending data. because If the TX pin is kept as output then I will not be able to “hear” another controller which I'm monitoring.

Is there any SoftwareSerial library which allows me to implement this method? , or how I can change the original SoftwareSerial library to release TX pin,
Thank you.

I want to connect the TX & RX pins of the Arduino together.

Why ?

Which pin do you mean when you say 'the Tx pin' ? Are you sure that you really need to use the Tx pin as an input ? Have you run out of other pins to use and, if so, what are you doing with them ? What board are you using and have you considered an alternative with more pins available ?

I’m trying to control motor of ardrone 2 with an Arduino board, but I am not able to read and write serial data on the same line (Pin 3) to communicate with the controller. because ardrone motor controller use one pin as tx/rx but on my arduino uno it is not possible

because If the TX pin is kept as output then I will not be able to “hear” another controller which I'm monitoring.

With a little extra hardware like small signal diodes, you can have several different inputs to the arduino rx pin.

zoomkat:

because If the TX pin is kept as output then I will not be able to “hear” another controller which I'm monitoring.

With a little extra hardware like small signal diodes, you can have several different inputs to the arduino rx pin.

my problem is that I have to release TX first, otherwise If the TX pin is kept as output I will not be able to “hear” the controller, and I potentially blow up the Arduino + the motor controller.

something like opposite of this:
http://forum.arduino.cc/index.php?topic=112013.0

meman:
I’m trying to control motor of ardrone 2 with an Arduino board, but I am not able to read and write serial data on the same line (Pin 3) to communicate with the controller. because ardrone motor controller use one pin as tx/rx but on my arduino uno it is not possible

Are you saying that the AR Drone controller has a pin that is sometimes a serial input and at other times is a serial output ?

UKHeliBob:

meman:
I’m trying to control motor of ardrone 2 with an Arduino board, but I am not able to read and write serial data on the same line (Pin 3) to communicate with the controller. because ardrone motor controller use one pin as tx/rx but on my arduino uno it is not possible

Are you saying that the AR Drone controller has a pin that is sometimes a serial input and at other times is a serial output ?

yes:

Pin 1 Battery 11.4V
Pin 2 VCC 5V (ATMega8a VCC Pin4+5)
Pin 3 TX+RX (ATmega8a Pin30+31)
Pin 4 IRQ to main board (ATmega8a PC3 Pin26)
Pin 5 GND

The arduino may have specific uart hardware connected to the tx/rx pins that might interfere with your plans. You might be able to solve your issue by using two small signal diodes to ensure appropriate current flow directions between the arduino tx/rx pins and the combined tx/rx pin of your gizmo.

zoomkat:
The arduino may have specific uart hardware connected to the tx/rx pins that might interfere with your plans. You might be able to solve your issue by using two small signal diodes to ensure appropriate current flow directions between the arduino tx/rx pins and the combined tx/rx pin of your gizmo.

Thank you for your suggestion,
logically with modifying some control codes in SoftwareSerial library it seems to be possible,
as it has been done for RX pin
http://forum.arduino.cc/index.php?topic=112013.0

but if I could not do it, I will try your advice.