Seeking input: interfacing 3V and 5V devices

For discussing the 65xx hardware itself or electronics projects.
Post Reply
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Seeking input: interfacing 3V and 5V devices

Post by BigEd »

Nearby, I wondered if it would be good to have a sticky thread about the various possible approaches, and the pitfalls, in interfacing 5V devices with modern 3V3 devices.

This thread, then, is seeking input from those in the know, as to what techniques they have used or seen, and what they like or don't like about them. Links to previous discussions, posts, or answers elsewhere on the web would be appreciated!

If we get some good materials together, one or other of us can write a good head post for a new thread, which maybe Garth will feel is worth making sticky. But even if not, it will be easy to search for it. Of course, I'll link to that thread, if and when it exists, from this head post.

This was my thought:
Quote:
It almost feels like we need a sticky thread on 3.3V interoperation. There are very fast bidirectional level shifters available (see OHO's products) and there's at least one 74 series family which can be used to bridge the gap. In a case like this, if the 6502 writes to an octal latch then the Prop will have plenty of time to read the value. Another approach we see is using a CPLD for combination glue and level shifting.
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Seeking input: interfacing 3V and 5V devices

Post by BigEd »

There are some DIP parts specifically for level shifting:
- 74AHCT125 - Quad Level-Shifter (e.g. here.)
- 74LVC245 - Breadboard Friendly 8-bit Logic Level Shifter (e.g. here.)

See also this previous thread:
- How do we handle the loss of 5V CPLDs?
which mentions
Quote:
The FPGA modules from OHO (called GODIL and GOP) include SMD level converters to provide 5V compatibility - might be worth looking into. They are very wide, but not cheap. They are bidirectional - there's an enable input but no direction input.
74CB3T16211, 24-way, about £3, http://www.ti.com/lit/ds/symlink/sn74cb3t16211.pdf
The 16-bit wide 74ALVC164245 might be useful, and is about half the price - it's directional so you need a control to say which direction you're driving in.

Edit to add: Michael has successfully used TI's 4-bit level shifter TXB0104PWR which costs about £1 and has a 7.4ns propagation delay. (SMD)
Also in that thread, pointers to Xilinx' 5V tolerant CPLDs, such as the XC9536XL, and to Altera, Atmel and Lattice parts.
Memblers
Posts: 64
Joined: 16 Jan 2003
Location: Indianapolis
Contact:

Re: Seeking input: interfacing 3V and 5V devices

Post by Memblers »

Still looking for input?

In addition to 74LVC, some other 5V-tolerant families are VHC, AHC, LCX, and LVT.

If you need 5V outputs, there are '8T' parts like 74LVC8T245. It's a '245 but with dual power supplies, so you can output 5V on one side.

There is a type of bidirectional level translator where the direction is automatically sensed by the chip. FXMA108, and NVT2008 are a couple of the 8 bit wide ones.

GreenPAK chips by Silego (now Dialog) are really neat. They can operate at 5V (they have dual-supply ones too). Compared to CPLDs there are very few LUTs, DFFs, or I/Os. But they have additional hardware like a counters, oscillator, analog comparators, etc. The config memory is OTP, they're intended to be factory programmed. But they are RAM based, and on the i2c ones you can reconfigure them in-circuit. I've been having some fun with these.
matthew180
Posts: 20
Joined: 18 Sep 2015

Re: Seeking input: interfacing 3V and 5V devices

Post by matthew180 »

If you are interfacing with legacy 5V TTL and such, I recommend the dual-voltage devices like SN74LVC8T245DGVR and others in that family. I have also used the 245 variant that is a 3.3V device with 5V tolerant I/O, and they can't take any abuse from the 5V side in case of things like glitches and such.

I have also messed with the "auto-sense" level shifters, but for bi-directional buses I'm not sure how well they work. I never got a good feeling from them.
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Seeking input: interfacing 3V and 5V devices

Post by BillO »

If you only need it for 1 or 2 lines and don't need blinding speed, you can make a bidirectional signal level translator with a little MOSFET like a 2N7000. I did a brief write-up on this a while back.
LLT.jpg
Attachments
Signal Level Translation.doc
(198.5 KiB) Downloaded 182 times
Bill
matthew180
Posts: 20
Joined: 18 Sep 2015

Re: Seeking input: interfacing 3V and 5V devices

Post by matthew180 »

Bill, what happens if you tri-state one side of that circuit? What does the output on the other side do?
User avatar
GaBuZoMeu
Posts: 660
Joined: 01 Mar 2017
Location: North-Germany

Re: Seeking input: interfacing 3V and 5V devices

Post by GaBuZoMeu »

There are pullups one either side of the MOSFET. How can you tristate that?
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Seeking input: interfacing 3V and 5V devices

Post by BillO »

Yes, they are only pull-ups, not totem poles. Like any line (/IRQ 0r /NMI for 6502 examples) that is pulled up with a resistor this line can be driven to whatever state you like, so the use of such a circuit is fine on a 3-state line. 3-state is only required for lines that have active (totem pole) pull-ups.

Just think about it for a while.

Here is an example: Lets say one side goes high-z so that the other side can take control of the line, then both sides will be pulled high until the controlling side asserts the line one way or the other. No conflict occurs.
Bill
gbm
Posts: 43
Joined: 23 Jan 2018

Re: Seeking input: interfacing 3V and 5V devices

Post by gbm »

Few remarks on avoiding the active level translators:
1. MOST of inputs of MOST of 5V ICs accept TTL levels, which meand that they are happy to be fed with 3.3V outputs. MOST is the keyword here. Especially in NMOS microprocessors clock inputs may require close-to-5V drive. It's always a good idea to lokk at the datasheet.
2. Some 3.3 V ICs accept 5V input levels at MOST of their inputs - this is the case of STM32 MCUs I use in my SDC_One design.
3. MOST of 3.3V ICs are quite happy with input "level translation" with just series resistors 3k..10k between 5V logic output and 3.3 V logic input. No magic here - most ICs have parasitic diodes and in most of them the allowed current is quite reasonable - form 50 uA to few mA - check the datasheet for Iihmax or "injection current". Not all the vendors specify these parameters.
4. It's possible to produce 5V output from 3.3V microcontroller with 5V-tolerant pins - by setting the 5V-tolerant output to open drain mode and pulling it up externally with 1k5..4k7. That's what I do in SDC to feed the clock signal to NMOS Z80. With 1k5 it works up to approx 5 MHz.
5. Another trick: In a non-noisy environment (like on the desk), no RS232 level transceivers are needed to connect a microcontroller to a PC. If the uC has the option of switching the UART pins polarity, TxD may directly feed the RS232 data input and 47k resistor is enough to "translate" RS232 output levels to uC's RxD input. An important note: with 3.3V - powered uC you can safely do this trick only with NON-5V- tolerant inputs. A 5V-tolerant one may be destroyed, at least in theory. In practice, the trick works equally well with all inputs.
Post Reply