Electronic – How to communicate with 2 devices with 1 UART MCU in AVR

avruart

I am currently looking to integrate GSM SIM900 and GPS Module with Atmega32. As atmega32 has 1 UART option, I was just wondering that can I connect these two devices with single UART. I am making a simple GPS tracker which will send a GPS Lats Longs to user mobile whenever a user ask for it.

Does anyone have any idea about this problem, pls share. Thanks

Best Answer

Assuming you don't need to communicate with both devices simultaneously, why not use an analog switch (such as the NLAS4684) to switch TX / RX between the two devices? Tie the two control inputs together and pass to a spare output on the Atmega32 and you can use one pin to select the device you are communicating with.