Author Topic: Logic Level Shifters?  (Read 1041 times)

0 Members and 1 Guest are viewing this topic.

Offline theatrical scene

  • Contributor
  • Posts: 18
  • Country: au
Logic Level Shifters?
« on: January 22, 2019, 12:05:03 am »
I'm working on a project which uses 3.3V from a Raspberry pi with 5V peripherals. I only need to send/receive data in one way (so the logic level shifter wouldn't have to be bidirectional). I'm choosing between these two parts: http://www.ti.com/lit/ds/symlink/cd4050b.pdf and http://www.ti.com/lit/ds/symlink/txb0108.pdf.

Is the latter component overkill for simple digital IO conversion? I assume a standard buffer like the first component would be able to shift up signals if I supplied 5V to VCC with a 3.3V input signal but the data sheet has no mention of this and rather highlights the 4050B's use as a 'high to low' shifter as opposed to low to high. Is my assumption valid or am I missing something?

Cheers
 

Offline oPossum

  • Frequent Contributor
  • **
  • Posts: 837
  • Country: us
  • The other white meat
Re: Logic Level Shifters?
« Reply #1 on: January 22, 2019, 12:28:22 am »
CD4050 is only for 5V to 3.3V (74AHC series can also be used). For the other direction 74HCT series parts can be used, such as 74HCT244 and 74HCT125.
 
The following users thanked this post: theatrical scene

Offline blueskull

  • Supporter
  • ****
  • Posts: 12433
  • Country: cn
  • Power Electronics Guy
Re: Logic Level Shifters?
« Reply #2 on: January 22, 2019, 12:39:49 am »
Bandwidth? Delay budget? Cost requirement? Bus width?
 

Offline theatrical scene

  • Contributor
  • Posts: 18
  • Country: au
Re: Logic Level Shifters?
« Reply #3 on: January 22, 2019, 01:59:56 am »
Low bandwidth (around 20KHz), delay budget not too critical, no restrictive cost requirements (within reason), bus width of 6-8.
« Last Edit: January 22, 2019, 02:07:04 am by theatrical scene »
 

Offline Mr.B

  • Supporter
  • ****
  • Posts: 1037
  • Country: nz
Re: Logic Level Shifters?
« Reply #4 on: January 22, 2019, 02:04:44 am »
When I am level shifting I2C (bus width = 2) I simply use a couple of cheap FETs and a few resistors.
Dead simple.
Google *FET level shifter*
Time is the overseer of all things.
 
The following users thanked this post: theatrical scene

Offline theatrical scene

  • Contributor
  • Posts: 18
  • Country: au
Re: Logic Level Shifters?
« Reply #5 on: January 22, 2019, 02:06:23 am »
CD4050 is only for 5V to 3.3V (74AHC series can also be used). For the other direction 74HCT series parts can be used, such as 74HCT244 and 74HCT125.


Thanks for that, will have a look. The RPi has uses both inputs and outputs which means I would need to get both the 74HCT and 74AHC parts right (for low-high level shifting and high-low)? Would it make it easier to just use a single bidirectional converter like the TXB0108 even though my signals are unidirectional (i.e. either outputs or inputs)? 
 

Offline blueskull

  • Supporter
  • ****
  • Posts: 12433
  • Country: cn
  • Power Electronics Guy
Re: Logic Level Shifters?
« Reply #6 on: January 22, 2019, 02:07:14 am »
When I am level shifting I2C (bus width = 2) I simply use a couple of cheap FETs and a few resistors.
Dead simple.
Google *FET level shifter*

This. But it only works with open drain signals, so prolonged 0 state will burn more energy.
 

Offline oPossum

  • Frequent Contributor
  • **
  • Posts: 837
  • Country: us
  • The other white meat
Re: Logic Level Shifters?
« Reply #7 on: January 22, 2019, 02:10:26 am »
74LVC1T45 if you don't mind tiny SMD parts. That can go either direction.

I have not used the autosense level shifters, but have read that they can be twitchy.
 

Offline oPossum

  • Frequent Contributor
  • **
  • Posts: 837
  • Country: us
  • The other white meat
Re: Logic Level Shifters?
« Reply #8 on: January 22, 2019, 02:17:18 am »
The RPi has uses both inputs and outputs which means I would need to get both the 74HCT and 74AHC parts right (for low-high level shifting and high-low)?

Yes. Forgot to mention the 74xxx541. That has a pinout that can be easier to work with than the 74xxx244.
 

Offline beanflying

  • Super Contributor
  • ***
  • Posts: 3910
  • Country: au
  • Toys so very many Toys.
Coffee, Food, R/C and electronics nerd in no particular order :)
 

Offline theatrical scene

  • Contributor
  • Posts: 18
  • Country: au
Re: Logic Level Shifters?
« Reply #10 on: January 22, 2019, 02:22:58 am »
The RPi has uses both inputs and outputs which means I would need to get both the 74HCT and 74AHC parts right (for low-high level shifting and high-low)?

Yes. Forgot to mention the 74xxx541. That has a pinout that can be easier to work with than the 74xxx244.

Thanks, is there a version of this (or similar part) with 6-8 buffers built into a single package?
 

Offline mvs

  • Regular Contributor
  • *
  • Posts: 182
  • Country: de
Re: Logic Level Shifters?
« Reply #11 on: January 22, 2019, 08:53:13 am »
Low bandwidth (around 20KHz), delay budget not too critical, no restrictive cost requirements (within reason), bus width of 6-8.
In this case i would not work with GPIOs of raspberry pi directly. Have a look on SPI shift registers, 74hct595 for outputs and 74hct165 + one resistor divider for inputs. You can connect them in a chain to use only one SPI port.

I2C GPIO expanders (PCF8574) may also do the job if you level shift I2C bus.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 13125
  • Country: gb
  • 0999
Re: Logic Level Shifters?
« Reply #12 on: January 22, 2019, 09:39:06 am »
The RPi has uses both inputs and outputs which means I would need to get both the 74HCT and 74AHC parts right (for low-high level shifting and high-low)?

Yes. Forgot to mention the 74xxx541. That has a pinout that can be easier to work with than the 74xxx244.

Thanks, is there a version of this (or similar part) with 6-8 buffers built into a single package?
Replace the xxx in those part numbers with HCT, for low to high and AHC for high to low. The 74xxx14 is a good hex inverting buffer and has Schmitt trigger inputs.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2288
  • Country: de
    • Frank Buss
Re: Logic Level Shifters?
« Reply #13 on: January 22, 2019, 09:51:49 am »
The RPi has uses both inputs and outputs which means I would need to get both the 74HCT and 74AHC parts right (for low-high level shifting and high-low)?

Yes. Forgot to mention the 74xxx541. That has a pinout that can be easier to work with than the 74xxx244.

Thanks, is there a version of this (or similar part) with 6-8 buffers built into a single package?

74LVC8T245 has 8 buffers, and one pin to decide the direction control, which you can just tie to VCC(A) or GND for a fixed direction.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 
The following users thanked this post: oPossum, theatrical scene

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 13125
  • Country: gb
  • 0999
Re: Logic Level Shifters?
« Reply #14 on: January 22, 2019, 02:10:58 pm »
There's also the CD40109B, which is slow but can come in handy, especially for higher voltages.
http://www.ti.com/lit/ds/symlink/cd40109b-q1.pdf
 
The following users thanked this post: theatrical scene

Offline theatrical scene

  • Contributor
  • Posts: 18
  • Country: au
Re: Logic Level Shifters?
« Reply #15 on: January 22, 2019, 10:46:38 pm »
The RPi has uses both inputs and outputs which means I would need to get both the 74HCT and 74AHC parts right (for low-high level shifting and high-low)?

Yes. Forgot to mention the 74xxx541. That has a pinout that can be easier to work with than the 74xxx244.

Thanks, is there a version of this (or similar part) with 6-8 buffers built into a single package?

74LVC8T245 has 8 buffers, and one pin to decide the direction control, which you can just tie to VCC(A) or GND for a fixed direction.

That looks very cool! I like the ability to control the DIR pin. Out of interest, is there a reason why I might use http://www.ti.com/lit/ds/symlink/txb0108.pdf over a 74LVC8T245 or is the TXB more useful in a bidirectional application?
 

Offline Doctorandus_P

  • Frequent Contributor
  • **
  • Posts: 579
  • Country: nl
Re: Logic Level Shifters?
« Reply #16 on: January 23, 2019, 12:29:03 am »
Those TXB0108 are sort of overkill, but you can use them all the same.
Ali / Ebay / China sells breakout boards with them, and the price and size of these breakout boards is about the same as a postage stamp.

Often you can also use the good old 74LSxxxx logic as level converters. Those old transistor outputs can not deliver much current if the output gets above 3V3
 
The following users thanked this post: theatrical scene

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2288
  • Country: de
    • Frank Buss
Re: Logic Level Shifters?
« Reply #17 on: January 23, 2019, 10:57:48 am »
That looks very cool! I like the ability to control the DIR pin. Out of interest, is there a reason why I might use http://www.ti.com/lit/ds/symlink/txb0108.pdf over a 74LVC8T245 or is the TXB more useful in a bidirectional application?

If you know the direction, it is always better to use a chip where you can set it. Look here for details:

https://www.eetimes.com/document.asp?doc_id=1231111

Quote
Another implementation (Figure 4) does not require the direction control signal, but in turn has a restriction on the drive strength of the output transistors. In a DC state, the output drivers can maintain a high or low, but are designed to be weak, so that they can be overdriven by an external driver when data on the bus starts flowing in the opposite direction.

Depends on your application, if this works for you.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 
The following users thanked this post: oPossum


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf