Electrical – 2 UART connected on the same port

uart

I am curently working on a project where a MCU got only one UART port available, however I need to run two peripherals with UART interface (not simultaneously) so I was wondering if I can connect two peripherals UARTs on the same UART of the MCU while playing with enabling and disabling the peripherals one by one for communicating with the MCU?

Your feedbacks and recommendation are appreciated about this situation

Regards

Best Answer

Since you need to be connected to only one device at a time, you could use a multiplexer to switch between the two chips, like the NX3L2467:

enter image description here

You only need a DPDT switch; this is a 4PDT one so you're only using half of the circuit. But all of the DPDT switches I found had very unfriendly packages to work with such as VQFN, BGA etc. This part comes in a 16-pin TSSOP package; not as nice as a DIP to work with but doable. You can get TSSOP16 to DIP adapters. It also has a very low on-resistance (0.5Ω). It will work off of 3.3V which I assume is your supply voltage.