Conecting two different serial Tx pins together to one Rx pin

So I'm working on a project that uses serial output from 2 Arduinos to one Rx pin on a GPS. One of the Tx outputs goes through a level converter which can be put into high impedance when not used while the other Tx is a direct connection to the GPS Rx. My question is since the idle state of the Tx pin is low, would there be any problems leaving the two outputs connected together to one input? Neither Arduino will transmit data at the same time. Obviously I can put the converter into HiZ when the first one is transmitting but I don't have the luxury of the doing the same to the second one when the first one is transmitting. Originally I was going to put the second Tx pin into a "pseudo High Z mode" using pinmode but now I'm not sure if I need to do it or not. What do you guys think?

The idle state of the Tx pin is high, and it would not be a good idea to connect the outputs together without some resistors in series. The good news is that the resistors in series (at each output, before connecting the nodes together and sending off to the Rx pin) should nicely solve the problem.

The idea is to use a "weak" (i.e., high) resistance for the driver that can't be turned off, and a lower resistance for the driver that can go HiZ. When the HiZ driver is enabled it drives the Rx line overriding the high resistance of the non-turn-off driver. When the HiZ driver is disabled the non-turn-off driver has the Rx line all to itself.

The resistor in series with the HiZ driver is probably unnecessary, actually, but I always like to have a little resistance everywhere....just in case :wink:

A 1k resistor for the non-turn-off driver should be safe.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

I wasn't using a series resistors on the HiZ driver side but I am using 330 series resistors on the other one. 99.99% of the time the "other" driver will be doing most of the communicating but I'll play around with some different values and see how the signals look. Thanks again RC.

The idle state of the Tx pin is high,

Aren't the tx pins on the arduino ttl, which would make them low in an idle state?

zoomkat:

The idle state of the Tx pin is high,

Aren't the tx pins on the arduino ttl, which would make them low in an idle state?

With TTL async serial communications the idle state is called the stop state and is the same state as a data bit one (high) state. And it will stay high for as long as there is no data being sent. The start bit is a low bit and starts the bit sampling for the following data bits. So idle state is a HIGH state.

Lefty

So I'm working on a project that uses serial output from 2 Arduinos to one Rx pin on a GPS. One of the Tx outputs goes through a level converter which can be put into high impedance when not used while the other Tx is a direct connection to the GPS Rx. My question is since the idle state of the Tx pin is low, would there be any problems leaving the two outputs connected together to one input?

I'd just put a small signal diode on the tx line of each arduino, then connect the diode outputs together and connect that combined output to the level converter.

I'd just put a small signal diode on the tx line of each arduino, then connect the diode outputs together and connect that combined output to the level converter.

You will then need a pull-down resistor at the input of the level converter.

--
Beat707: MIDI drum machine / sequencer / groove-box for Arduino

You will then need a pull-down resistor at the input of the level converter.

Should be easy to do if it already doesn't have one.

Thanks for all the suggestions. I think though I may fall back on my original plan with just putting the Tx pin into the "pseudo HiZ state" when the other Tx is enabled. I'm hoping the Rx pin will still be functional while the Tx pin is offline because I'd like to be able to use both receive pins at the same time.