Using 74LVC1T45 for UART Level Shifting to a Board with Unknown Pull-Ups - Page 1
Forum section: electronics / projects

author: kaevee
author_rank: Regular Contributor
timestamp: November 26, 2024, 11:18:22 pm
content: I’m designing a UART interface between an ESP32-S3 (3.3V logic) and an external board operating at 5V logic. The communication speed will not exceed 115.2 kbps.Currently, in my prototype, I’m using an off-the-shelf level shifter board designed around discrete transistors/MOSFETs. While it works, I’m concerned about its reliability, especially given the lack of detailed specifications and the potential presence of unknown pull-up or pull-down resistors on the external board.To address these concerns, I’m considering switching to the 74LVC1T45, a single-bit, bidirectional level shifter with direction control.Why 74LVC1T45?I selected this IC because:It supports manual direction control, which makes it more reliable than auto-sensing ICs (e.g., TXB/TXS series) in the presence of strong pull-ups or pull-downs.It handles wide voltage ranges (1.65V–5.5V), making it suitable for my 3.3V ↔ 5V level shifting needs.It is compact and inexpensive, making it a practical choice for multiple UART lines.Concerns:Given the limited speed requirement (115.2 kbps), is the 74LVC1T45 a reliable option for this use case?Compared to my current discrete transistor/MOSFET-based level shifter, will it offer improved robustness and reliability, especially with unknown pull-ups or pull-downs on the external board?Am I overengineering this solution? Could it be that I’m building a fortress to guard a sandbox?Request for Feedback:Is the 74LVC1T45 robust enough for this scenario, especially with unknown external board characteristics?Are there better alternatives for level shifting in such cases?Any other considerations I should keep in mind?Thanks in advance for your advice!

author: Peabody
author_rank: Super Contributor
timestamp: November 26, 2024, 11:29:59 pm
content: If it's only UART, there are no bidirectional lines, so there would be no need for bidrectional translators. And I don't think there should be any pullup resistors since as far as I know UART lines are push/pull.How about a 74LV1T34 on each of Rx and Tx, one powered by 3.3V and the other by 5V.

author: kaevee
author_rank: Regular Contributor
timestamp: November 26, 2024, 11:56:12 pm
content: Thank you for the suggestion! You're absolutely right—UART lines are indeed push-pull, and there are no bidirectional signals in a standard UART interface. Your point about the absence of pull-up resistors on UART lines is reassuring, though I can’t completely rule out the external board having some unexpected characteristics due to its unknown design.The 74LV1T34 is an excellent alternative as a single-bit unidirectional level translator, especially since it simplifies the setup by removing the need for a direction control signal. Using one IC for TX and another for RX (powered by 3.3V and 5V, respectively) seems like a clean solution. It’s compact, reliable, and would work perfectly for the defined voltage levels and communication speed.That said, I had initially selected the 74LVC1T45 because:It is the lowest-cost level shifter I found on LCSC, making it highly cost-effective for my design.For my current use case, however, I agree that bidirectional capability isn’t strictly necessary. I’ll take a closer look at the 74LV1T34 to weigh its advantages for this specific design.Thanks again for the insight—this really helps clarify the design choices!Edit: Fixed formatting

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 26, 2024, 11:57:24 pm
content: I've successfully used 74LVC1T45 for UART and SPI level translation, but switched to TI TXU0102 (RX+TX only) and TXU0204 (RX+CTS+TX+RTS) and TXU0304 (SPI) with 100nF = 0.1µF supply bypass capacitor between VCC and GND on each side of each TXU0n0m.

author: kaevee
author_rank: Regular Contributor
timestamp: November 27, 2024, 12:14:54 am
content: Quote from: Nominal Animal on November 26, 2024, 11:57:24 pmI'm curious to know why you decided to switch from the 74LVC1T45 to the TI TXU0102, TXU0204, and TXU0304.Were there any specific performance or feature advantages that led you to make the switch? Any particular issues you encountered with the 74LVC1T45 that prompted the change?

author: Nominal Animal
author_rank: Super Contributor
timestamp: November 27, 2024, 02:11:54 am
content: Quote from: kaevee on November 27, 2024, 12:14:54 amTXU0n0mhave Schmitt trigger inputs, an Output Enable instead of direction pin, and a single IC suffices for each bus. (In comparison, 74LVC2T45, 74LVC8T245 and so on transfer data in the same direction.) If you want to isolate a set of LVC1T45/2T45/8T245 from the bus, you'll need to switch off (one side of) their supplies using e.g. a P-channel logic-level MOSFET.I also use isolators (ISO6721 for RX+TX, ISO7731 for SPI) that do level translation, but other members here consider me silly for doing so. I do it because I interface a properly grounded computer to Linux-based appliances with class I isolated supplies (no-ground wall warts) whose GND/0V tends to be a hundred volts or so above true ground; we have unpolarized mains wall sockets here, both are "live". I've been told I should use a properly grounded lab supply instead, but I don't want to, because some problems are due to problems with the power supply itself, and I want to change as few things as possible when diagnosing problems and exploring hardware.Quote from: kaevee on November 27, 2024, 12:14:54 amNo, these are just better suited for my needs (UART and SPI). I like the Schmitt trigger inputs, though; without them, intermediate voltages between the valid logic levels can cause excess current draw, and heat up the translator IC.I do still keep 74LVC1T45 in SOT23-6 at hand, because while they're small, the pitch (0.95mm) is large enough to solder by hand even directly to wires, dead-bug style, without a PCB at all, especially when tying DIR to GND (middle pins are then ground). Just use heatshrink around the legs, and then around the entire bulge. Excellent for testing, especially because they're so cheap. (Mouser will sell you ten Diodes Inc. 74LVC1T45W6-7 for0.163€ apiece, for example.)If I already have a 74LVC1T45 -based translator that works, I'll happily use that, and not replace it with a TXU0n0mone. But, when planning/designing/implementing one for UART or SPI, I do prefer TXU0n0mover 74LVC1T45.Also, for other stuff like 8080-style parallel buses, 74LVC8T245 and others are still useful, so it's not like I "completely" switched. I only found that for UART and SPI voltage level translation, the TXU0n0mwere better suited for my use cases than 74LVC1T45. They are more expensive, though, but since I mostly do just my own hobbyist one-offs, the price difference isn'tthatimportant to me.

author: macboy
author_rank: Super Contributor
timestamp: November 27, 2024, 02:49:57 am
content: You said 5 V logic but not the type of input: CMOS or TTL. This makes a difference. In particular, standard 5 V TTL inputs are perfectly happy to accept signals from 3.3 V CMOS outputs. So you wouldn't need level translation in that direction at all. But if it is 5 V CMOS inputs, you do need level translation, since a high must be over 4.0 V.

author: kaevee
author_rank: Regular Contributor
timestamp: November 27, 2024, 04:31:12 am
content: Quote from: macboy on November 27, 2024, 02:49:57 amThank you for pointing that out! To clarify, I do have some details about the external board, but I don’t have control over whether it uses TTL or CMOS logic levels. This uncertainty is why I’m proceeding under the assumption that it could be 5V CMOS, which would require level translation since its high level needs to exceed 4.0V to be reliably recognized.On the other hand, the ESP32-S3 RX pin absolutely requires level shifting, as it is not 5V tolerant. Without level translation, the 5V logic levels from the external board’s TX line could potentially damage the ESP32-S3.Given these constraints, I am currently exploring the use of the 74LVC1T45DW-7 for level shifting in both directions. It seems like a safe, flexible, and cost-effective solution, especially since I don’t have control over the external board’s input logic type.Thanks again for your insights—they’re helping me think through all the edge cases!