How to connect 2 devices to single USART

avr

I have GPS receiver connected to ATMega328 USART RX/TX pins. However, I also need to use RX/TX pins for ATMega firmware upgrade through bootloader, so RX/TX is connected to FT232.

How to properly connect both GPS Receiver and FT232 to ATMega RX/TX? I can't use jumper solution, because user doesn't have access to PCB.

Update:

No software UART, please.
The more simple solution, the better. I need to maintain the cost and PCB size.

Best Answer

You may need to do very little. It sounds like the FT232 and the GPS won't be used at the same time, which makes things easier. The micro's TX pin can simply drive both. Some sort of ORing logic can be used so that the RX line can be driven low from either of the two sources. This could a single AND gate, for example.

It looks like the only issue will be to make sure the GPS doesn't babble during a firmware update. Does the GPS only start sending in response to a setup message? Can the processor hold it in reset? Can the processor control the GPS power? In the last case, keep in mind that the GPS's transmit line would need to float high somehow. A outright 2-input mux may be easier then.