Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Best 3.3v to 5v Bidirectional Logic Translator

Status
Not open for further replies.

MrAl

Well-Known Member
Most Helpful Member
Hi,

I am looking for a good design for a bidirectional logic translator. I want a super safe design because the 3.3v board is much more expensive than the 5v board which will typically just be a display or something.

The usual way of doing this is to use a MOSFET with the drain and source in series with the 3.3v input/output and the 5v input/output, along with some pullup resistors. But with that design if the MOSFET drain to source blows short (for ANY reason under the sun) the 3.3v logic input/output is subject to the full potential of the 5v logic high, which would, of course, be 5v. 5v will easily blow out the entire 3.3v board which is typically (but not limited to) a microcontroller board.

I thought about using a regular design like with the MOSFET, but using instead a bipolar and a small series resistor like 330 ohms, along with a Schottky protection diode from the 3.3v input to the 3.3v supply line, but am looking for any other idea too. The main idea here is that the bipolar will be less susceptible to shorting collector to emitter than the MOSFET shorting from drain to source, as well as having a current limiting resistor in case of shorting anyway, and the diode clamp to +3.3v for the input with a low voltage drop Schottky.

Any other ideas?
 
"Bidirectional" do you really need bidirectional? How fast is fast? How wide?
 

Attachments

  • sn74lvc1t45.pdf
    1.3 MB · Views: 248
"Bidirectional" do you really need bidirectional? How fast is fast? How wide?

Hello,

Well i said bidirectional because that's what i needed. Fast would be maybe 1MHz i guess. 2 bits would be nice.

The main issue was not really about finding a chip, it was about being able to analyze the failure mode of any design, chip or discrete.

I also realize now that maybe a little add on would help make it safe for any failure mode...maybe just a resistor and Schottky...but that's probably not the only way.

The ones they sell on the web have four channels and are made with MOSFETs, so you can see how it might fail. The chip type are obviously inside the chip so you cant tell how it might fail, without adding additional components.

I also forgot to mention that it has to be "self sensing", so that there is no 'direction' input pin that changes the direction of the logic. For example, for input A and output B, if the dir pin is 1 then the logic goes from A to B, but if the dir pin is 0 then the logic goes from B to A (A is not the output, B the input). But with the self sensing type you dont need a 'dir' input, it self senses which way the logic is flowing: from A to B or from B to A, without any extra pin.
Also, it is in fact for an IC2 connection, which has one input for clock and one for data, but the clock does not have to be bidirectional only the data.
It would not hurt though to make them both bidirectional as long as the logic got translated properly.
 
If you had started of with the idea of I2C then I would have given you a different part.
For I2C the 1mhz is fast, but for TTL that is very slow.
The second part mentioned in post #3 is what you are looking for. There are more like it.
 
TXB0101 https://www.ti.com/product/txb0101

TXB0101 1-Bit Bidirectional Level-Shifting and Voltage Translator
With Auto Direction-Sensing and ±15-kv ESD Protection
1 1 Features
• Available in the Texas Instruments NanoFree™ 3 Description
Package
This 1-bit noninverting translator uses two separate
• 1.2 V to 3.6 V on A Port and configurable power-supply rails. The A port is
1.65 V to 5.5 V on B Port (VCCA ≤ VCCB) designed to track VCCA. VCCA accepts any supply
• V voltage from 1.2 V to 3.6 V. The B port is designed to CC Isolation Feature – If Either VCC Input is at track VCCB. VCCB accepts any supply voltage from
GND, All Outputs are in the High-Impedance State 1.65 V to 5.5 V. This allows for universal low-voltage
• OE Input Circuit Referenced to VCCA bidirectional translation between any of the 1.2-V,
• Low Power Consumption, 5 μA Maximum ICC 1.5-V, 1.8-V, 2.5-V, 3.3-V, and 5-V voltage nodes. • I VCCA should not exceed VCCB. off Supports Partial-Power-Down Mode Operation
• Latch-Up Performance Exceeds 100 mA Per When the output-enable (OE) input is low, all outputs
JESD 78, Class II are placed in the high-impedance state.
• ESD Protection Exceeds JESD 22 This device is fully specified for partial-power-down
– A Port applications using Ioff. The Ioff circuitry disables the outputs, preventing damaging current backflow
– 2000 V Human Body Model (A114-B) through the device when it is powered down.
– 250 V Machine Model (A115-A) To ensure the high-impedance state during power up
– 1500 V Charged-Device Model (C101) or power down, OE should be tied to GND through a
– B Port pulldown resistor; the minimum value of the resistor is
– 15 kV Human Body Model (A114-B) determined by the current-sourcing capability of the driver.
– 250 V Machine Model (A115-A)
– 1500 V Charged-Device Model (C101)

**broken link removed**
 
If you had started of with the idea of I2C then I would have given you a different part.
For I2C the 1mhz is fast, but for TTL that is very slow.
The second part mentioned in post #3 is what you are looking for. There are more like it.

Hi,

Yeah that looks good i think, with a little extra protection added.

I am looking at various options, and knowing that ordering something is going to take at least a few days to get here and with the weekend maybe not till next week. So i've considered building one from raw transistor(s) for the time being. It's interesting to try to do this because of the bidirectional requirement, which is more of a challenge than just a one-way logic step up or step down.
Try throwing together a simple circuit to do bidirectional and see what you can come up with, using bipolar(s) if possible.
 
I should have mentioned the TXB family goes up to 8 bit wide. TXB0101-0108.

https://www.ti.com/product/txb0108

**broken link removed**

Hi Mike,

What i didnt like about the TI part was that the enable has to be held low at power up. That means a pulldown on that pin, then later a uC pin to pull it back up to allow proper operation. Maybe a resistor/capacitor combo almost like a power-on-reset circuit as I'd hate to have to use a uC pin just for that.
 
3v logic can drive 5v logic, so know worry in 1 direction. Some 3v logic is 5v tolerant on its input. You may be able to just wire directly. I would check the 3v part data sheet.
 
You just need to keep OE low at power up, a cap and resistor should do it. :)
 
3v logic can drive 5v logic, so know worry in 1 direction. Some 3v logic is 5v tolerant on its input. You may be able to just wire directly. I would check the 3v part data sheet.

Hi Mike,

Yes i did that, hence this thread :)

3.3v logic will run a 5v logic input but only when that 5v logic input is spec'd low, like 2.2v for a logical 'high' (1). Unfortunately, some logic is spec'd at 0.7*Vdd which is 3.5v for a 5v part. So the 5v side requires 3.5v to be sure it is a logic high signal. Unfortunately again, that includes the 8574 chip which is the usual piggy back part for the I2C display interface, which right now is what i would like to interface.
Going the other way, 5v to 3.3v, the 3.3v can only tolerate about 3.6 to 4.0 volts max on any of it's inputs or it blows some serious chip.
The bidirectional requirement comes from the I2C data line, but the clock may not need the bidirectional functionality just step up from 3.3v to 5v, which means the 3.3v side has to be able to produce a 3.5 to 5v logic high signal, and a 0v to maybe 1v logic low signal.
There are three types of level conversion:
1. 3.3v to 5v
2. 5v to 3.3v
3. bidirectional (both above)

I need 1 and 3 above, but will probably go with just 3 because that works for both 1 and 2 and 3 as well.

I cant stress enough how bad it would be to connect them directly because the 3.3v side would blow out. I also considered using a 1k series resistor and clamping Schottky on the 3.3v side, but not sure if i want to take that chance either. The current, should there be a bus conflict, has to be limited to 3ma.
 
I cant stress enough how bad it would be to connect them directly because the 3.3v side would blow out.
You worry too much. The I2C level translator work well.
You connect the VCCa to the micro and the pull up resistor goes to VCCa which is the micro supply.
You connect the VCCb to the other device's supply, and there is a pull up resistor to that supply.
At the micro end low=0V and high is VCCa via the pull up resistor. (3.3V)
At the other end low=0V and high is VCCb via the pull up resistor. (5.0V) but could be almost anything.
Ground (0V) connects between the two boards.
VCCa does not connect to the other board. ALSO VCCb does not connect to the micro. There is no VCCa to VCCb connection.
Because this is a I2C project there is no active pull up! The pull up function is the two resistors. One pulling to A and the other to B.

I2C does not have bus clash problems. It is "open collector" so the ICs can only pull down. If there are multiple parts some pulling down and some pulling up there is no problem (no current) because no IC pulls up.
 
I can't tell if your being sarcastic, I was only trying to help, and since you had left out the parts you were using, I only had to guess or make assumptions. Since I see that the I/O expander V range is 2.5v - 6v, I assume this is some pre-purchased PCB set at 5V power (I am sure you looked into changing the voltage on that board, probably more trouble).
Anyways, yes I know you wanted bi-directional I2C hence why I posted the TXB part link. Still not sure why you don't like that part since the OE issue seems easy to work around using a power on reset.
In the past (late 90's, I have driven 5v parts from 3.3 logic and met the VIH/VIL requirements, unlucky for you the part you have is less forgiving.
Sorry I did not have any better ideas to offer :sorry:
 
Hi Mike and Ron,

Mike:
No the ideas were good, i am just worried about my 3.3v board i dont want it to blow out. I like hearing other ideas too, and other people reading this thread might like hearing them too and use one of them. "It's all good" :)

Ron:
That sounds good. What i was worried about was not only during normal operation, but what happens during start up. What happens if the 3.3v supply comes up before the 5v supply, what happens if the 5v supply comes up before the 3.3v supply, what happens if the external circuit becomes out of sync and decides to become the 'master' , etc. In other words, failure mode analysis. This has to include what happens if the internal circuit transistor shorts out, stuff like that.
 

Hi there,

Yes those type do look interesting. That is the type that has the MOSFET drain and source in series with the connection. I am considering that type also although i might add a little extra protection circuitry to it :)

Have you used these with the displays like the 1602 for example, or other I2C things?

BTW, Readers beware:
They also make the type that go from 5v to 3.3v in one direction only, which will not work for I2c neither clock nor data lines. The clock line can sometimes have a unidirectional translator, but it must go from 3.3v to 5v if the uC board is 3.3v not 5v.
 
Hi Al . I bought a couple for I2C but then found the particular PIC24 had 5v tollerant pins on data and clock so pulled up with 2k2 to 5v however I did use a module on Uart TX RX serial to a TTL thermal printer, did not need the bidirectional just level shift.
 
I designed a I2C test machine. (part of its functions) On my end the I2C (buffer/level shifter) had VCCa connected to 3.3V because the ARM computer was built with 3.3V IO. On the test side the VCCb is connected to the supply of the device under test or could be connected to a variable supply. It worked from 0.8V to 5.5V. (slow at low voltage) These devices are in many factories. Most runs 24/7. They get plugged into a new board every couple of seconds.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top