Shop OBEX P1 Docs P2 Docs Learn Events
5v Devices - level Shifter Module — Parallax Forums

5v Devices - level Shifter Module

Areal PersonAreal Person Posts: 197
edited 2007-09-07 17:12 in Propeller 1
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. turn.gif
Thanks,
-Areal

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

what do you expect ? I'm a programmer.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-09-05 18:40
    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
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-05 18:43
    They should be ashamed to offer something like this ..
  • GadgetmanGadgetman Posts: 2,436
    edited 2007-09-06 11:50
    Either use the resistor described in other threads in this forum, or use the 74LC245 chip alone.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-06 12:09
    Here's a suggestion. Suppose you want to put a byte on outa[noparse][[/noparse]0..7], and you want it to be "open collector".

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

    To drive your outputs as "open collector" with pullups:
    dira[noparse][[/noparse]0..7]~
    outa[noparse][[/noparse]0..7]~
    dira[noparse][[/noparse]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 PetersonKen Peterson Posts: 806
    edited 2007-09-06 12:11
    oops...correction...

    dira[noparse][[/noparse]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?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-06 17:39
    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
  • MightorMightor Posts: 338
    edited 2007-09-07 04:59
    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.
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-07 05:54
    Here are the three "poor man's level shifters"

    Reading the complete article www.sparkfun.com/commerce/present.php?p=Sensor-Interfacing is also instructive 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
    600 x 347 - 19K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2007-09-07 06:43
    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 PetersonKen Peterson Posts: 806
    edited 2007-09-07 12:45
    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 PetersonKen Peterson Posts: 806
    edited 2007-09-07 12:47
    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?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-07 17:12
    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...
Sign In or Register to comment.