Author Topic: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)  (Read 17762 times)

0 Members and 1 Guest are viewing this topic.

Offline MartyMacGyverTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
When connecting various 3.3V things (e.g., RPi, sensors) to and from various 5V things (e.g., Arduino, sensors), the following seems to be reasonable from what I've read:

5V logic -> 3.3V logic, use 74LVC245 (this seems to be the most widely used way)

3.3V logic -> 5V logic, use 74(A)HC(T)245. This is where I'm stumped. To TTL or not to TTL? What about AHC(T) vs HC(T)... any practical difference? I'm ordering parts and I have a choice of any of these (in DIP form), and the prices are the same or less for the A-type chips... was thinking of stocking up on a few each of the 74AHC245 and 74AHCT245 chips but if HC(T) is somehow better I would like to know because at some point it'll matter.

Bonus: is the 74AHCT125 just effectively a 74AHCT245 with only half the lines? The titles of the data sheets are throwing me off.

Note: Have tried TXB0108 devices for things. Not terribly effective and they are extra sensitive to... everything. Open the fridge? It acts up. Earth rotates on its axis? Don't expect it to work right.
 

Online wraper

  • Supporter
  • ****
  • Posts: 17160
  • Country: lv
3.3V logic -> 5V logic, use 74(A)HC(T)245. This is where I'm stumped. To TTL or not to TTL? What about AHC(T) vs HC(T)... any practical difference? I'm ordering parts and I have a choice of any of these (in DIP form), and the prices are the same or less for the A-type chips... was thinking of stocking up on a few each of the 74AHC245 and 74AHCT245 chips but if HC(T) is somehow better I would like to know because at some point it'll matter.
You shouldn't use AHC and HC for 3.3V input while IC is powered from 5V, they are wrong part for that. Only AHCT and HCT, there is no difference unless you care about speed, AHC(T) is significantly faster. Faster is not necessarily better as noise immunity against fast transients is lower too. Also faster IC will create faster transients on power rail too.
 

Offline cosmicray

  • Frequent Contributor
  • **
  • Posts: 309
  • Country: us
Pololu makes an interesting logic shifter board. It is based on an Infineon BSD840N (although they do not identify it as such) Dual N-channel MOSFET and a few resistors.

The product description here will give you an idea of what it can do
https://www.pololu.com/product/2595
it's only funny until someone gets hurt, then it's hilarious - R. Rabbit
 

Offline MartyMacGyverTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
You shouldn't use AHC and HC for 3.3V input while IC is powered from 5V, they are wrong part for that. Only AHCT and HCT, there is no difference unless you care about speed, AHC(T) is significantly faster. Faster is not necessarily better as noise immunity against fast transients is lower too. Also faster IC will create faster transients on power rail too.
What if the 5V thing is not a TTL device though? (As I understand it the "T" devices don't drive CMOS loads as well.) As for AHC, I thought perhaps it's just an evolution of HC, but if there are drawbacks then I may forego the "A" parts. If I had to pick one '245 part that would cover the vast majority of situations, which would it be?

Pololu makes an interesting logic shifter board. It is based on an Infineon BSD840N (although they do not identify it as such) Dual N-channel MOSFET and a few resistors.
That looks similar to one I already have: https://www.adafruit.com/products/757

It'd be nice if there was something like the TXB0108 but without the (problematic) direction auto-sensing feature (instead having a manual DIR option). Each side would have its own rail and that'd be that.
 

Offline MartyMacGyverTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
I may be operating under one wrong assumption - that "T" - is it about the inputs or the outputs (or both?) I thought the "T" devices output to TTL more effectively...
 

Offline MartyMacGyverTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
To add to the mix, I stumbled on an external thread on this topic that mentioned the ACT series... perhaps the 74ACT245 would be the best general solution for most common use cases (3.3V -> 5V)? (Edit: along with some 74HCT245's, just in case.... that said, is there any reason I'd both with non "T" versions for this?)
« Last Edit: March 12, 2015, 06:10:32 pm by MartyMacGyver »
 

Online wraper

  • Supporter
  • ****
  • Posts: 17160
  • Country: lv
I may be operating under one wrong assumption - that "T" - is it about the inputs or the outputs (or both?) I thought the "T" devices output to TTL more effectively...
T is for TTL compatible inputs, outputs are the same. That means that they have lower input voltage threshold level. If you use HC or AHC part, they might not detect 3.3V logic 1 at all in worst case. Also as 3.3V (remember that actual voltage on the 3.3V logic IC output can be slightly lower) is on the threshold borderline, that makes noise immunity just awful as slightest spike can make a transition between 0 and 1. READ DATASHEETS, that will remove a lot of not so smart questions and is more accurate than asking some stranger.
« Last Edit: March 12, 2015, 08:26:15 pm by wraper »
 

Online wraper

  • Supporter
  • ****
  • Posts: 17160
  • Country: lv
To add to the mix, I stumbled on an external thread on this topic that mentioned the ACT series... perhaps the 74ACT245 would be the best general solution for most common use cases (3.3V -> 5V)? (Edit: along with some 74HCT245's, just in case.... that said, is there any reason I'd both with non "T" versions for this?)
ACT are very fast series. Go with HCT unless you need very high frequency or can get them cheaper for some reason.
 

Offline cosmicray

  • Frequent Contributor
  • **
  • Posts: 309
  • Country: us
Pololu makes an interesting logic shifter board. It is based on an Infineon BSD840N (although they do not identify it as such) Dual N-channel MOSFET and a few resistors.
That looks similar to one I already have: https://www.adafruit.com/products/757

It'd be nice if there was something like the TXB0108 but without the (problematic) direction auto-sensing feature (instead having a manual DIR option). Each side would have its own rail and that'd be that.
It's basically the same circuit, other than Adafruit are using 4x discreet FETs and Pololu are using 2x FET array chips. Both designs reference the NXP app note (  http://www.nxp.com/documents/application_note/AN10441.pdf ) which may give you some hints. The adafruit board has a ground connection, while the pololu board omits it. Ground is only important in the context of the devices on both sides of the level shifter, not the shifter itself.

The original NXP app note design was for an I2C level shifter, which by definition is bi-directional.

What kind of speed are your sensors going to be clocking ?
it's only funny until someone gets hurt, then it's hilarious - R. Rabbit
 

Offline MartyMacGyverTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
READ DATASHEETS, that will remove a lot of not so smart questions and is more accurate than asking some stranger.
I did read the datasheets, but I clearly didn't read them well enough (I had found some caveats about using TTL with some things so I wasn't sure if I should reconsider it). I was looking for opinions as much as anything else (since preference plays a part).

What kind of speed are your sensors going to be clocking ?
The speeds could end up being in the MHz range for some things - I would rather buy with headroom to spare so it looks like the ACT might be worth getting after all. The chips are cheap enough and I'm only buying a few anyway (and I'm happy to spend a bit more to get something that will cause fewer overall headaches in projects), but I might get some AHCT as well for the toolkit.

Edit: Actually, I'll focus on getting AHC(T) '245s... I will get a few AC(T) as well to try out, but their propensity for adding noise to the system is apparently worse than I thought. Not seeing any real reason to get non-"A" parts for this.

One question though: when would I ever want to use the non-TTL ones? Just for buffering like-to-like voltage levels?
« Last Edit: March 12, 2015, 11:01:49 pm by MartyMacGyver »
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 1854
  • Country: au
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #10 on: March 12, 2015, 11:37:26 pm »
Going from 3.3v -> 5v I would be tempted to use just a 74HC14, 74AHC14 etc as it will successfully trigger from a 3.3v CMOS digital signal.
 

Online wraper

  • Supporter
  • ****
  • Posts: 17160
  • Country: lv
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #11 on: March 13, 2015, 12:25:54 am »
Going from 3.3v -> 5v I would be tempted to use just a 74HC14, 74AHC14 etc as it will successfully trigger from a 3.3v CMOS digital signal.
Yeah, successfully, most of the times... Decrease 3.3V by few hundreds mV and it will stop to work, especially at wider temperature range or if unlucky with particular IC exemplar. Why do you think xxT series were created? TTL actually puts out more voltage than 3.3V.

For few MHz HC(T) series are fine. Most of the ACT series ICs work up to 100 MHz or even more.
 

Offline kjs

  • Regular Contributor
  • *
  • Posts: 97
  • Country: de
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #12 on: March 13, 2015, 01:11:23 am »
If you only need it for a single line the M74LVC1GT50 is the best choice in both directions. For 5V to 3.3V supply is 3.3V and in the other direction it's 5V. The MC74VHC50 is a good choice for up to 6 lines and used the same way. Always 7V tolerant at the inputs.

Naturally there are also real level translators if you want to keep all the noise margins. One example is the TXB0108 for 8-bits which can shift in both directions and from-to all logic levels. If it acts up in your design something else is wrong. We use them on a regular basis and they work well. In a commercial design you most likely have to conserve the noise margins......

you don't want to use the TTL ICs for anything which doesn't have the TTL levels. The noise margin is a LOT lower and the required drive currents higher.
« Last Edit: March 13, 2015, 01:32:30 am by kjs »
 

Online wraper

  • Supporter
  • ****
  • Posts: 17160
  • Country: lv
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #13 on: March 13, 2015, 02:04:57 am »
you don't want to use the TTL ICs for anything which doesn't have the TTL levels. The noise margin is a LOT lower and the required drive currents higher.
TTL ICs were not discussed here at all, therefore talking about drive currents is irrelevant to this situation.
 

Online wraper

  • Supporter
  • ****
  • Posts: 17160
  • Country: lv
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #14 on: March 13, 2015, 02:13:54 am »
If you only need it for a single line the M74LVC1GT50 is the best choice in both directions. For 5V to 3.3V supply is 3.3V and in the other direction it's 5V.
Wrong part number. LVC series will work fine for 5V->3.3V but I don't see how this would be proper choice for 3.3V->5V as they will have too high input voltage threshold for 3.3V if powered from 5V. For example, datasheet for 74LVC1G125. If powered from 5V, high input voltage level must be no less than 0.7 Vcc = 0.7 * 5 = 3.5V what obviously is more than 3.3V even if we don't consider any safe margin needed. Therefore stable operation cannot be guaranteed for 3.3V -> 5V operation.
« Last Edit: March 13, 2015, 02:44:08 am by wraper »
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4516
  • Country: dk
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #15 on: March 13, 2015, 02:37:59 am »
Going from 3.3v -> 5v I would be tempted to use just a 74HC14, 74AHC14 etc as it will successfully trigger from a 3.3v CMOS digital signal.
Yeah, successfully, most of the times... Decrease 3.3V by few hundreds mV and it will stop to work, especially at wider temperature range or if unlucky with particular IC exemplar. Why do you think xxT series were created? TTL actually puts out more voltage than 3.3V.

For few MHz HC(T) series are fine. Most of the ACT series ICs work up to 100 MHz or even more.

yes the T signifies the lower 2.4V threshold so it will work reliably with 3.3V logic and 5V supply

just be sure to check the data sheet, some T version can use several mA when the inputs
are close to the thresholds

 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #16 on: March 13, 2015, 02:52:45 am »
I'm not sure I'm following the conversation correctly, but what is the issue here, exactly?  Some people seem to be throwing out 5.0v-powered buffers as if they'll work in a 3.3v to 5.0v level translation application.  Obviously that's going to be full of problems, buffers aren't intended for level translation, and trying to force them into that role is going to be pushing VIH/VOL thresholds to their limits.  Why wouldn't you just use a dedicated level translation IC, eg: SN74LVC1T45?  Feed 3.3v in on one side, 5.0v on the other side, drive the direction pin, and you're done.  Is there something I'm missing here?
 

Offline MartyMacGyverTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #17 on: March 13, 2015, 05:46:55 am »
I'm not sure I'm following the conversation correctly, but what is the issue here, exactly?  Some people seem to be throwing out 5.0v-powered buffers as if they'll work in a 3.3v to 5.0v level translation application.  Obviously that's going to be full of problems, buffers aren't intended for level translation, and trying to force them into that role is going to be pushing VIH/VOL thresholds to their limits.  Why wouldn't you just use a dedicated level translation IC, eg: SN74LVC1T45?  Feed 3.3v in on one side, 5.0v on the other side, drive the direction pin, and you're done.  Is there something I'm missing here?
That's good to know, and will be handy if I should do a more complicated SMT project, versus a DIP-and-breadboard thing (the data rates I'll be dealing with aren't nearly as high as what the 'T45 is targeted for).
 

Offline MartyMacGyverTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #18 on: March 13, 2015, 05:54:51 am »
Naturally there are also real level translators if you want to keep all the noise margins. One example is the TXB0108 for 8-bits which can shift in both directions and from-to all logic levels. If it acts up in your design something else is wrong. We use them on a regular basis and they work well. In a commercial design you most likely have to conserve the noise margins......
For whatever reason the '0108 is quite tricky to work with, and I'm not the only person saying that out there. I'm not suffering for a lack of them either... and at some point I'd like to understand why they didn't work as expected for me.
 

Offline MyElectronsFellOut

  • Regular Contributor
  • *
  • Posts: 70
  • Country: gb
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #19 on: March 13, 2015, 08:46:15 am »
Having used logic shifters recently, I can atest to the GTL2000 series chips doing the job just dandily. Does everything you need for translation of 3.3 - 5V and back as well as lower voltages.  I've used them with 16MHz micros for data ouput to LCD and bidirectionally to an SD card, and they seem to have good noise immunity.  :-+

datashet --> http://www.nxp.com/documents/data_sheet/GTL2002.pdf 
 

Offline MartyMacGyverTopic starter

  • Regular Contributor
  • *
  • Posts: 70
  • Country: us
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #20 on: March 13, 2015, 09:14:29 am »
Having used logic shifters recently, I can atest to the GTL2000 series chips doing the job just dandily.
I'll keep this in mind as well, for whenever I decide to make SMT breakout boards with such devices. Right now I'm focused on DIP solutions for the sake of breadboarding.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8271
  • Country: fi
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #21 on: March 13, 2015, 09:19:18 am »
I have connected 3V3 outputs directly to 5V CMOS inputs when I'm feeling super cheap - no translation at all. The '1' level is pretty close to the threshold value (typically about 3.0V) so it's on the brink of failing all the time. A CMOS buffer won't do anything differently than the CMOS inputs of the actual chip, so I miss the point of adding one. A TTL compatible (HCT) buffer will of course lower the threshold (to about 2.4V) so there will be more margin for error.

Don't use bidirectional level translator chips that internally decide the direction, without a direction pin.
 

Offline plazma

  • Frequent Contributor
  • **
  • Posts: 474
  • Country: fi
    • Homepage
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #22 on: March 13, 2015, 09:50:11 am »
For whatever reason the '0108 is quite tricky to work with, and I'm not the only person saying that out there. I'm not suffering for a lack of them either... and at some point I'd like to understand why they didn't work as expected for me.

I use TI TXS and TXB level shifters in many designs. They work as designed. TXS for open collertor/drain and TXB for push/pull lines. Check the data sheet for internal schematic. There are pull up and series resistors which may cause issues.
 

Offline kjs

  • Regular Contributor
  • *
  • Posts: 97
  • Country: de
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #23 on: March 13, 2015, 07:25:03 pm »
If you only need it for a single line the M74LVC1GT50 is the best choice in both directions. For 5V to 3.3V supply is 3.3V and in the other direction it's 5V.
Wrong part number. LVC series will work fine for 5V->3.3V but I don't see how this would be proper choice for 3.3V->5V as they will have too high input voltage threshold for 3.3V if powered from 5V. For example, datasheet for 74LVC1G125. If powered from 5V, high input voltage level must be no less than 0.7 Vcc = 0.7 * 5 = 3.5V what obviously is more than 3.3V even if we don't consider any safe margin needed. Therefore stable operation cannot be guaranteed for 3.3V -> 5V operation.

To discuss datasheet values you better use the datasheet of the mentioned device and not some generic other one from a different part even if it's from the same family. The 1GT50 has completely different input logic levels and was specifically designed for exactly that job. At 5.5V supply the worst case high level is 2V and that IS a safe margin..... The LVC125 datasheet is completely irrelevant.
http://www.onsemi.com/pub/Collateral/MC74VHC1GT50-D.PDF page 3....

For whatever reason the '0108 is quite tricky to work with, and I'm not the only person saying that out there. I'm not suffering for a lack of them either... and at some point I'd like to understand why they didn't work as expected for me.

I use TI TXS and TXB level shifters in many designs. They work as designed. TXS for open collertor/drain and TXB for push/pull lines. Check the data sheet for internal schematic. There are pull up and series resistors which may cause issues.

Same here but they are a bit critical with the supply bypass capacitors too. The "typical layout" with a 0.1mm ground and supply line circling 3 times around the part before it's connected won't do the job. We have them on ground planes with 1uF/10V X5R caps (Taiyo Yuden or Murata) and never had any issue.
« Last Edit: March 13, 2015, 07:47:09 pm by kjs »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19667
  • Country: gb
  • 0999
Re: A question about logic level shifting, 74LVC74, and 74HC(T) vs 74AHC(T)
« Reply #24 on: March 13, 2015, 07:55:03 pm »
To discuss datasheet values you better use the datasheet of the mentioned device and not some generic other one from a different part even if it's from the same family. The 1GT50 has completely different input logic levels and was specifically designed for exactly that job. At 5.5V supply the worst case high level is 2V and that IS a safe margin..... The LVC125 datasheet is completely irrelevant.
http://www.onsemi.com/pub/Collateral/MC74VHC1GT50-D.PDF page 3....
To be fair, you made a typographical error in your previous post. You referred to the M74LVC1GT50, which doesn't exist, so he had to guess what you meant.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf