Electronic – Best way to connect to UART lines to multiple entities

embeddedftdimicrocontrolleruart

I have a sensor that I'm connecting to MCU through UART for data logging and other purposes. However, I also want to program the Sensor independently and I have configured the same UART lines from the sensor with an FTDI chip and USB port (See Figure) enter image description here.

When this is on breadboard, it is easy to do this as I can disconnect the MCU from the sensor when I'm using the FTDI chip and vice versa. If I'm doing this on a PCB its not possible to disconnect wires. I did think of having jumpers to disconnect the FTDI or MCU when needed so that only one of them is powered on at a time.
Is it a good practice to have jumpers for UART lines? Is there a better alternative?

Best Answer

The MCU Tx can be connected to both Rx pins without any problem.

For the MCU Rx pin there is a problem, because you can't connect two outputs (FTDI and SENSOR Tx) together. Some solutions

  • use a two position (three pin) jumper
  • put a resistor in the line that is to be overrruled by the other, presumably the sensors Tx line. unplug the downloader when you wnat to use the sensor.
  • put a gate (AND port) between the two Tx lines and the Rx. Make sure than an unconnected input (when the downloader is removable) is pulled up to a 1 level.
Related Topic