multiplexing UART on arduino

I have got 2 IrDA En/Decoders that I need to connect to Arduino(lilypad).
IrDA <—> En/Decoder <--------v
IrDA <—> En/Decoder <—> Lilypad

The problem is Lilypad only has 1 UART port(Rx/Tx). What’s the easiest way to use connect 2 IrDA? It’s okay if I can only recv/send data from one at a time.

Thanks!

Find an analog switch.
Go to maxim-inc.com and search for spdt analog switch.
Something like MAX333a, but you only need 2 channel.

Any reason you can't use a software uart for either or both your IrDA devices? It can use any pins you tell it to use.

http://arduiniana.org/libraries/newsoftserial/

Lefty

CrossRoads:
Something like MAX333a, but you only need 2 channel.

Eek! I did a quick check with Octopart, and those are like $9-10 a pop.

A peanut part like the CD4066 should do the job for under a buck: it's relatively-slow digital data.

Try requesting a sample from Maxim.

Being slow digital data, you could do it with just a couple of transistors too.
Let both devices listen at the same time.
Give both an open collector transistor to drive with an 3rd to re-invert the signal to you.

input_mux.jpg