PDA

View Full Version : 5v Devices - level Shifter Module



Areal Person
09-06-2007, 02:24 AM
Hi,

Can I use this module to provide Bi-Directional level shifting to my propeller
project so that I can interface 5vdc components ?

http://www.futurlec.com/Mini_Logic.shtml

It looks like a good price. http://forums.parallax.com/images/smilies/turn.gif
Thanks,
-Areal

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have a tree growing out of my head, but

what do you expect ? I'm a programmer.

Phil Pilgrim (PhiPi)
09-06-2007, 02:40 AM
Yes, but remember that all eight lines are either inputs or outputs, depending on the state of the T/R pin. And that pin is not brought out to the edge on the Futurelec board, but jumpered. So it's not truly bi-directional: it's either one direction or the other.

-Phil

deSilva
09-06-2007, 02:43 AM
They should be ashamed to offer something like this ..

Gadgetman
09-06-2007, 07:50 PM
Either use the resistor described in other threads in this forum, or use the 74LC245 chip alone.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...

Ken Peterson
09-06-2007, 08:09 PM
Here's a suggestion. Suppose you want to put a byte on outa[0..7], and you want it to be "open collector".

Normal way:
dira[0..7]~~
outa[0..7] := byte

To drive your outputs as "open collector" with pullups:
dira[0..7]~
outa[0..7]~
dira[0..7] := !byte <- notice the inversion

when dira is 1, the output is pulled low. Whenever dira is 0, the output is high impedance.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


The more I know, the more I know I don't know. Is this what they call Wisdom?

Ken Peterson
09-06-2007, 08:11 PM
oops...correction...

dira[7..0] := byte. Otherwise the bits will be reversed, right?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


The more I know, the more I know I don't know. Is this what they call Wisdom?

deSilva
09-07-2007, 01:39 AM
The n-th repetition: To my opinion the cheapest solution is always a pull-up resistor (as Ken suggests) at the 3V3 device in connection with a (Schottky-)diode from the 3V3V device to the 5 device.

The diode will prevent the 5V device driving this line high. It has less draw-backs than a series resistor...

Post Edited (deSilva) : 9/6/2007 9:44:39 PM GMT

Mightor
09-07-2007, 12:59 PM
deSilva said...
The n-th repetition: To my opinion the cheapest solution is always a pull-up resistor (as Ken suggests) at the 3V3 device in connection with a (Schottky-)diode from the 3V3V device to the 5 device.

The diode will prevent the 5V device driving this line high. It has less draw-backs than a series resistor...

Do you have an example of such a small circuit? I've never used anything other than a 1K resistor between my PING)) sensor and the Prop.

Gr,
Mightor

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| To know recursion, you must first know recursion.
| I'm afraid I might be phobophobic.

deSilva
09-07-2007, 01:54 PM
Here are the three "poor man's level shifters"

Reading the complete article www.sparkfun.com/commerce/present.php?p=Sensor-Interfacing (http://www.sparkfun.com/commerce/present.php?p=Sensor-Interfacing) is also instructive http://forums.parallax.com/images/smilies/smile.gif

However: I just see an error in it: The pull-ups must be connected to +5V.
I'll change the original image and download a modification!

Post Edited (deSilva) : 9/7/2007 6:06:19 AM GMT

Peter Jakacki
09-07-2007, 02:43 PM
deSilva said...
The n-th repetition: To my opinion the cheapest solution is always a pull-up resistor (as Ken suggests) at the 3V3 device in connection with a (Schottky-)diode from the 3V3V device to the 5 device.

The diode will prevent the 5V device driving this line high. It has less draw-backs than a series resistor...


deSilva, what wasn't immediately clear from your diagram was the logic direction which you and I may be aware of but the circuit may well be used by somebody going from the 3.3V device as master. Arrows help in this regard. Also if SCK is coupled with a 10K current limit to the 3.3V device then why is CS and MOSI not using the exact same circuit which is all that would be required anyway?

BTW, configuring open-collector/open-drain style outputs by setting the direction register does not give a true OC output as the "collector" will still breakdown (conduct) when the pull-up voltage goes beyond the 3.3V supply. True OC outputs are just that, they don't have any deactivated components connected to the collector. The deactivated pch fet has an intrinsic diode structure from the output pin to VDD that conducts once the output pin is higher than the VDD regardless of whether or not the transistor is active.

*Peter*

Ken Peterson
09-07-2007, 08:45 PM
That's true, Peter. I was thinking about that after I posted. It's only high impedance if it's not pulled higher than Vdd.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


The more I know, the more I know I don't know. Is this what they call Wisdom?

Ken Peterson
09-07-2007, 08:47 PM
Perhaps my code sample might still be useful if one were trying to make a wired-or bus with a pullup at 3.3V.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


The more I know, the more I know I don't know. Is this what they call Wisdom?

deSilva
09-08-2007, 01:12 AM
5V.... This is why I changed the schematic given in the otherwise recommendable Sparkfun tutorial to connect the things to +5V.

Note that three different solutions are given in the schematic , you can use depending on uni- or birectional use. I consider the third solution (pull-up + diode) highly recommendable...