1
\$\begingroup\$

I am using SN74LV4052APW as UART switch with ESP32-S2 SoC Design. I have 3X UART in the design but since ESP32-S2 supports only two UART channels so I had to use this electronic switch to switch between 2 UARTs. One UART is for Firmware upload via USB and 2nd UART is connected to a dispenser. I am attaching my schematic and Channel select diagram from datasheet. Will it work fine? UART Switch Logic Diagram

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

With your circuit, you need to add pull-ups to your TXD1 and TXD2 lines so that they are not floating when they are not connected to the common TX line. Other than that, I don't see anything wrong logic-wise, and the switching speed of your device seems fast enough for typical UART baud rates. If you're using controlled impedance traces, the ON resistance of the analog switches may complicate things.

Instead of an analog switch, you can use a digital 2-line to 1-line data selector such as the 74LVC157, which incorporates 4 selector circuits controlled by the same A/B and enable pins.

Logic Diagram

The 74LVC157 could be wired as follows for your application (DOUBLE-CHECK, NOT TESTED):

IC Pin Connection
1A MCU TX
1B VCC
1Y TXD1
2A VCC
2B MCU TX
2Y TXD2
3A RXD1
3B RXD2
3Y MCU RX
4A GND or VCC
4B GND or VCC
4Y Not connected
nG GND
nA/B MCU A/B select output

The truth table would be:

nA/B MCU RX TXDA TXDB
L RXDA MCU TX H
H RXDB H MCU TX

If supply current is important for your application, the supply current of a TI SN74LVC157A is only 1µA @ 25°C, compared to 20µA for the SN74LV4052A.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks. I will see which of these two will work best for me \$\endgroup\$ Commented Jan 16 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.