user16433: Only 2 arduinos can normally be linked via serial port because TX and RX need to be cross-linked, and connecting multiple TXs together would cause conflict.
RS485 allows multiple nodes connected in parallel on a 2 wire differential 'bus', using a TX ENABLE pin to allow one master to transmit while all other slaves listen. 
I suspect it should be possible to similarly connect multiple serial RXs together to give a common listening bus, and be able to use TX ENABLE on any one node at a time to transpose its RX and TX to allow its TX to transmit to the other RXs. This might be physically done using a changeover relay swapping RX with TX, but is it possible to somehow temporarily switch the TX and RX assignments on demand by software?
I doubt the actual pin assignments can be changed in-situ, but perhaps the same results are achievable with some programming wizards sleight-of-hand trickery?

user4143: It sounds to me like you are misunderstanding the purpose of the TX Enable pin and you are trying to come up with some convoluted method to do exactly what TX Enable actually does.
Under normal circumstances, in RS485, the UART's RX pin is connected to the bus.  When TX Enable is asserted the RX pin is disconnected and the TX pin is connected, thus allowing any node on the bus to be a transmitter and all the other nodes a receiver.
The main thing to watch out for though is that only one node is ever a transmitter at a time, otherwise you get a collision which means that the data is completely garbled.
The simplest way of stopping that happening is to have one node nominated as the master and all the other nodes as slaves.  The master first initiates communication by making a request to a slave.  The slave will then respond with data (it becomes the transmitter and the master a receiver) to send data to the master.  That way the only node that is a transmitter is either the master making the request, or the slave that is responding to a request. 
If you want "random" peer-to-peer communication where any node could become a transmitter at any time it becomes a whole lot more complex.  There are things you should implement to try to avoid, or deal with, collisions, including monitoring the bus and only transmitting after a certain amount of idle time has been detected, reading the bus while writing to it (requires more hardware) and confirming that the data you read from the bus is the same as the data you wrote to the bus, and random delays before retrying a failed communication.  That last one is probably the trickiest to get right, since random numbers on Arduinos aren't really random unless you "seed" them from a truly random source. You don't want both ends delaying for the same amount of time to retry otherwise it will never complete.

Since you apparently want to achieve that kind of thing but without using RS485, it all gets much more complex.
No, you cannot "swap" the functionality of the TX and RX pins in the Arduino.  BUT you can do serial communication (albeit somewhat heavyweight) using pure software.  Take a look at the SoftwareSerial library - you will most likely need to make modifications to that to achieve what you want.
To do it externally with hardware is possible, but the end result will most likely be more complex than just using a simple RS485 interface chip which are very inexpensive and easy to get hold of.
Yes, you could use relays (clunky) or buffers, or multiplexers, etc, but why would you when RS485 does what you want?

user7508: On an AVR-based Arduino, you can selectively enable the transmitter and
receiver side of the UART (c.f. the datasheet of your MCU). Thus, you
could in principle just connect all the TX and RX together, and make
sure only one transmitter is enabled at a time, while all the others are
in high impedance. If you do this, I would strongly recommend you put a
current-limiting resistor in series with each TX, just in case.
For example, on an Arduino Uno
(Atmega328P),
you can use the following functions:
static inline void enable_tx()  { UCSR0B |=  _BV(TXEN0); }
static inline void disable_tx() { UCSR0B &= ~_BV(TXEN0); }
static inline void enable_rx()  { UCSR0B |=  _BV(RXEN0); }
static inline void disable_rx() { UCSR0B &= ~_BV(RXEN0); }

Edit: Beware that Serial.begin() enables both the transmitter and
the receiver.

16433: <p>Only 2 arduinos can normally be linked via serial port because TX and RX need to be cross-linked, and connecting multiple TXs together would cause conflict.</p>

<p>RS485 allows multiple nodes connected in parallel on a 2 wire differential 'bus', using a TX ENABLE pin to allow one master to transmit while all other slaves listen. </p>

<p>I suspect it should be possible to similarly connect multiple serial RXs together to give a common listening bus, and be able to use TX ENABLE on any one node at a time to transpose its RX and TX to allow its TX to transmit to the other RXs. This might be physically done using a changeover relay swapping RX with TX, but is it possible to somehow temporarily switch the TX and RX assignments on demand by software?</p>

<p>I doubt the actual pin assignments can be changed in-situ, but perhaps the same results are achievable with some programming wizards sleight-of-hand trickery?</p>
 4143: <p>It sounds to me like you are misunderstanding the purpose of the TX Enable pin and you are trying to come up with some convoluted method to do exactly what TX Enable actually does.</p>

<p>Under normal circumstances, in RS485, the UART's RX pin is connected to the bus.  When TX Enable is asserted the RX pin is disconnected and the TX pin is connected, thus allowing any node on the bus to be a transmitter and all the other nodes a receiver.</p>

<p>The main thing to watch out for though is that only one node is ever a transmitter at a time, otherwise you get a <em>collision</em> which means that the data is completely garbled.</p>

<p>The simplest way of stopping that happening is to have one node nominated as the <em>master</em> and all the other nodes as <em>slaves</em>.  The <em>master</em> first initiates communication by making a request to a <em>slave</em>.  The <em>slave</em> will then respond with data (it becomes the transmitter and the <em>master</em> a receiver) to send data to the master.  That way the only node that is a transmitter is either the <em>master</em> making the request, or the <em>slave</em> that is responding to a request. </p>

<p>If you want "random" peer-to-peer communication where any node could become a transmitter at any time it becomes a whole lot more complex.  There are things you should implement to try to avoid, or deal with, collisions, including monitoring the bus and only transmitting after a certain amount of idle time has been detected, reading the bus while writing to it (requires more hardware) and confirming that the data you read from the bus is the same as the data you wrote to the bus, and random delays before retrying a failed communication.  That last one is probably the trickiest to get right, since random numbers on Arduinos aren't really random unless you "seed" them from a truly random source. You don't want both ends delaying for the same amount of time to retry otherwise it will never complete.</p>

<hr>

<p>Since you apparently want to achieve that kind of thing but <em>without</em> using RS485, it all gets much more complex.</p>

<p>No, you cannot "swap" the functionality of the TX and RX pins in the Arduino.  <strong>BUT</strong> you can do serial communication (albeit somewhat heavyweight) using pure software.  Take a look at the SoftwareSerial library - you will most likely need to make modifications to that to achieve what you want.</p>

<p>To do it externally with hardware is possible, but the end result will most likely be more complex than just using a simple RS485 interface chip which are very inexpensive and easy to get hold of.</p>

<p>Yes, you could use relays (<em>clunky</em>) or buffers, or multiplexers, etc, but why would you when RS485 does what you want?</p>
 7508: <p>On an AVR-based Arduino, you can selectively enable the transmitter and
receiver side of the UART (c.f. the datasheet of your MCU). Thus, you
could in principle just connect all the TX and RX together, and make
sure only one transmitter is enabled at a time, while all the others are
in high impedance. If you do this, I would strongly recommend you put a
current-limiting resistor in series with each TX, just in case.</p>

<p>For example, on an Arduino Uno
(<a href="http://www.atmel.com/images/Atmel-8271-8-bit-AVR-Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-328-328P_datasheet_Complete.pdf" rel="nofollow">Atmega328P</a>),
you can use the following functions:</p>

<pre class="lang-cpp prettyprint-override"><code>static inline void enable_tx()  { UCSR0B |=  _BV(TXEN0); }
static inline void disable_tx() { UCSR0B &amp;= ~_BV(TXEN0); }
static inline void enable_rx()  { UCSR0B |=  _BV(RXEN0); }
static inline void disable_rx() { UCSR0B &amp;= ~_BV(RXEN0); }
</code></pre>

<p><strong>Edit</strong>: Beware that <code>Serial.begin()</code> enables both the transmitter and
the receiver.</p>
