1
\$\begingroup\$

I've read plenty of advice on how to deal with 5v <-> 3v logic translation and there seems to be a ton of methods, some of which I'm clear on and some I'm not. Most of the material is geared around things like Arduino, etc... one-off hobbiest solutions that don't necessarily translate well to volume production for cost, pcb real-estate or reliability reasons.

So specifically for production at volume, what would be the best way to handle a single unidirectional 3.3v microprocessor output (this case it is a STM32F205) to a 5v device (this case it is an RGB LED driver with one-wire control) without inversion? My guess is a dedicated buffer IC, but I don't really know.

My 5V device requires 0.7*5=3.5V for logic high and 0.3*5=1.5V for logic low.

My options appear to be:

  1. Just chance a direct connection. I put this here for completeness sake, because I think it would not be wise for production. There is anecdotal evidence (forum posts) suggesting the particular device can operate at 3.3V despite the datasheet info.
  2. I've been told a "simple pull-up resistor of 4.7k" should do the trick, however I've not found any discussions showing a single-resistor solution, so if anyone could explain this (preferably with a schematic) I'd appreciate it. This solution is somewhat vaguely mentioned in an answer here.
  3. That same answer also mentions a couple of diodes and a resistor, although this method is discussed here too with the article's author later stating in comments that he's not thrilled with the results.
  4. A MC74VHC1GT125, which is a dedicated IC built for the job. At a volume cost of roughly $0.06 to $0.07 it certainly isn't a cost issue (although % wise that is far above the other methods) but I wonder... is it the right way to go? With this options, I have a couple "sub-questions":
    • I'm a little unclear on what purpose OE service. When would you want it in Hi-Z? I just tie that to GND, right?
    • I've been unable to find any alternatives to this piece which specifically mention 5v to 3.3v translation, but any non-inverting buffer should do the trick, correct? Diodes Inc 74AHCT1G125, for example?
\$\endgroup\$
6
\$\begingroup\$

Because your microprocessor uses 5-volt tolerant IO pins, the simplest interface is simply to configure your pin as an open-drain, then use a pull-up to +5. From the data sheet, the pins have an absolute max rating of Vdd + 4 volts, or 7.3, so pulling up to 5 volts should be no problem. And, since the pins are rated for 8 mA/ per pin, you'll get best speed with a 1K pullup resistor, while dissipating a maximum of 25 mW.

Using a 125 is also perfectly acceptable, and if you do, just tie the OE to GND, as you suspect.

\$\endgroup\$
  • 1
    \$\begingroup\$ Any time you have more than one power rail, you need to be concerned about power sequencing. If there is a case where 5V is high when the processor IO is not powered up, you might not want to have a pullup to 5V directly. There are other simple ways around this. \$\endgroup\$ – mkeith Jun 14 '15 at 4:31
  • \$\begingroup\$ @mkeith - Good point. Assuming both devices are on the same board, I wouldn't expect sequencing to be a problem, but you never know. \$\endgroup\$ – WhatRoughBeast Jun 14 '15 at 11:48
  • \$\begingroup\$ Occasionally I run into sleep current problems if one of the rails is alive while another is de-powered. Your answer is good, I was just commenting for the OP. \$\endgroup\$ – mkeith Jun 14 '15 at 17:29
  • 2
    \$\begingroup\$ For what it's worth, I've had experience with unpowered FPGAs being driven by active logic, where the FPGAs were "almost" operating correctly, due to input currents being distributed through the chip. Really weird results. \$\endgroup\$ – WhatRoughBeast Jun 14 '15 at 17:52
  • 1
    \$\begingroup\$ I had a microprocessor board where SPI flash worked intermittently. Firmware guy was testing it prior to giving it to me. It turns out that the power pin was completely broken off of the SPI flash. Flash was powering up and partially working strictly due to clamp diode forward bias on IO. \$\endgroup\$ – mkeith Jun 14 '15 at 18:28
3
\$\begingroup\$
  1. The datasheet tells you what input level are guaranteed. The behaviour with any levels between the low maximum and the high minimum is undefined, and anecdotes about particular chips cannot reliably predict the behviour of other chips.

  2. You need 3.5 V, but a pull-up to 3.3 V cannot raise the level above 3.3 V.

  3. This diode circuit shifts both the low and high levels of the input signal by the same amount. Even if the levels are then within spec, going near the boundaries reduces the safety margins and makes the result less reliable.

  4. A dedicated IC will work easily and reliably.

    • The purpose of the OE input is to disable the output. If you do not need that, you should consider replacing the *125 with *34, which is a buffer without OE.

    • You can use any non-inverting buffer that accepts the correct signal levels at its inputs. There are specialized level-translating chips with two power supplies (such as NLSV1T34), but in your case, the 3.3 V levels are the same as TTL levels, so you can also use any logic gates that have TTL compatible inputs (such as the NLU1GT50).

      *34 logic gates are made by many other vendors. For example, TI's is SN74LV1T34.

  5. Using an open-drain output with a pull-up to 5 V (see WhatRoughBeast's answer) is the simplest solution. The only disadvantage compared to a dedicated IC is slightly larger power consumption when the signal is low (if your LED already eats much power, this might not matter), or slower switching if you give the resistor a larger value.

\$\endgroup\$
  • \$\begingroup\$ 1=5. Sorry for not being specific, but I meant pulled up to 5v. Can you explain please more about your power consumption comment? \$\endgroup\$ – bcsteeve Jun 14 '15 at 14:36
  • \$\begingroup\$ When the microprocessor forces the signal line low, a current flows from 5V through the pull-up (e.g., 5 V / 1 kΩ = 5 mA). \$\endgroup\$ – CL. Jun 14 '15 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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