Shop OBEX P1 Docs P2 Docs Learn Events
Level shifter from 3.3V to 5V — Parallax Forums

Level shifter from 3.3V to 5V

EMHmark7EMHmark7 Posts: 93
edited 2012-11-25 23:40 in Propeller 1
Hi,

I need to drive 5v logic from Propeller's 3.3V,
8 lines, only oneway (3.3V to 5V step-motor driver),
Ideally Through hole.

1) Is Propeller TTL or CMOS?
2) Any known chip for that?

Marc

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-11-24 14:28
    You may not need an interface chip, depending upon the input high level required by the motor driver. Check its datasheet to see if 3.3V is enough to guarantee a logic high. If it isn't, any 74HCT logic gate powered from 5V will do the trick. A 74HCT244 will drive eight lines.

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2012-11-24 14:36
    Most 5V logic can be driven by the Propeller's 3.3V output. The input threshold for CMOS logic is 2.5V (1/2 Vdd) and the Propeller's minimum high voltage (3.0V) exceeds that. The input threshold for TTL logic is even lower.

    If you really want a buffer, use something like a 74HCT device. The 74HCT241 is an octal buffer that might work.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-24 14:46
    EMHmark7 wrote: »
    Hi,

    I need to drive 5v logic from Propeller's 3.3V,
    8 lines, only oneway (3.3V to 5V step-motor driver),
    Ideally Through hole.

    1) Is Propeller TTL or CMOS?
    2) Any known chip for that?

    Marc
    Do you have a part number for 5V logic device? Most CMOS inputs need 0.7Vdd minimum which is 200mv higher than what the Prop can deliver, that's a negative margin for error. There are however some 5V logic inputs which are TTL compatible in that they will accept anything above 2V as a logic high. So for instance 5V character LCD displays you can drive directly from 3.3V logic but for many other 5V inputs I use a single gate 74HCTxx gate as they are very tiny and cheap. BTW, HCT logic normally operates at 5V but accepts anything above 2V as a logic high.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-11-24 15:53
    Do you have a part number for 5V logic device? Most CMOS inputs need 0.7Vdd minimum which is 200mv higher than what the Prop can deliver, that's a negative margin for error. There are however some 5V logic inputs which are TTL compatible in that they will accept anything above 2V as a logic high. So for instance 5V character LCD displays you can drive directly from 3.3V logic but for many other 5V inputs I use a single gate 74HCTxx gate as they are very tiny and cheap. BTW, HCT logic normally operates at 5V but accepts anything above 2V as a logic high.

    Yep, gotta read the data sheets on any specific chips to determine what is Guaranteed. Looking at some of them, the Vih is dependent on the supply voltage. One device family you may want to check out is the TI 74LVCxxx series. This will give you the level shifting you need but will require two supplies into the chip, one 5V and one 3.3V. Which direction you shift to depends on the select logic lines settings. Specifically look at the 74LVC245xx for a single chip solution to what you are looking for.

    Frank/

    Here is a link may be worthwhile....
    http://www.ti.com/lit/sg/sdyu001z/sdyu001z.pdf

    a
    nd for those under 25 with good eyesight and high mag,
    http://www.ti.com/lit/sg/scyt129e/scyt129e.pdf
  • Mark_TMark_T Posts: 1,981
    edited 2012-11-24 16:49
    Some species of 74XX245 is the better choice due to its logical pinout. the 241 or 244 pinouts will drive you crazy! Also since 245's are bidirectional they are more useful to have
    knocking around anyway.
  • EMHmark7EMHmark7 Posts: 93
    edited 2012-11-24 17:59
    Thanks for so many replies (holyday for some of you after all)!

    My Stepmotor driver is the A4975 from Allegro. Logical input says:
    at Vcc 5V: V0max: 1.35V V1min: 2.75
    at Vcc 4.6V: V0max: 1.24V V1min: 2.53

    But Page 26 of rev 1.4 Propeller's specs says:
    at 3.3V: V0max: 0.99V V1min: 1.98 (.3xVdd and .6xVdd)

    and I see a 2.85V. So, if you are telling me that typical is normally 3V, I have no problem at 5V any it might help my chance setting device's Vdd at 4.5V.

    1) Is this 3V found somewhere in Propeller's specsheet?
    I imagine range above is maybe just for input detection, not for values set by the MCU. Anybody can confirm this?

    2) About sn74LVC245A http://www.ti.com/lit/ds/symlink/sn74lvc245a.pdf ,
    Abstract sounds good, but specsheet does not make sense to me:
    It says: support 5V input/output at Vcc 3.3V,
    but, reading the tables, I do not see how It can read the Propeller 100% shure unless I set minimum Vcc (2.3 to 2.7V) or less but then,
    how can it provide the output with some 5V?
    The SN74LVC245A chip has only one supply line, so Frank, I do not catch you: "but will require two supplies into the chip, one 5V and one 3.3V"

    I already have a design with both 5V and 3.3V (6V batteries TO a 5V regulator for LCD display and TO the Propeller's QuickStart board that generates 3.3V).

    So, if somebody can confirm that the Propeller's all the time typical minimum 3V HI, I'll go with it.
    Precisions on the SN74LVC245A are welcome. On Monday, I'll attempt to reach somebody at TI.

    Sorry for using so much this forum these days, but I am woking on a tight schedule for this project part of my business startup.

    Thanks for your help.
    Marc



    Thanks,
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-11-24 18:14
    The A4975 looks like it is designed to interface to 3.3V logic as it's Vih (they say Vin(1) ) is 0.55VCC min so there is no problem driving it directly from the Prop. Don't worry about Voh as that is quoted as the guaranteed minimum at the stated current of 10ma. Unless you load up the line you will find that the level is nominally 3.3V.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-11-24 18:19
    Hi Mark.
    The Prop voltage specs are defined with some level of output current.
    In your case the Alegro chip presents virtually no load current to the prop pin.
    Vout hi is essentially the same as VDD.
    That being said if you power your chip from 5V then the input hi threshold is 5V * 0.55 = 2.75V. Clearly less the the 3.3V the prop outputs.
    Should work fine just by connecting them.

    Duane J
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-11-24 18:36
    Sorry my bad, left an extra c out of the part number. S/been 74lvcc245a-ep. Device is found under interface rather than logic. It is a 24pin dip with two supplies in, vcca and vccb.

    FF
  • EMHmark7EMHmark7 Posts: 93
    edited 2012-11-24 18:38
    Thanks Peter and Duane, My next night will be better...

    But as Duane said, The chip is powered at minimum 4.5V, so, I said 4.6V., giving min 2.53V Vh.

    Thanks Peter, now I catch better the propeller specs.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2012-11-24 18:41
    1) Is this 3V found somewhere in Propeller's specsheet?

    As far as I understand it, if the propeller is powered by a standard 3.3V regulator, and you ask it to output a high, then the output of that pin will be 3.3V.

    Your stepper motor quote 0.55 of the regulated supply (presumably 5V) as a high and 0.27 of the supply as low. 0.55 x 5V is 2.75V which is well under 3.3V. So I'm with Duane et al in saying that you don't need any interface chip. That should save you a part and board space.
  • tonyp12tonyp12 Posts: 1,951
    edited 2012-11-24 20:06
    If you power the Prop from 3.3v, a high pin will output around 3v to 3.2v,
    as you will not induce a current draw, it will probably be closer to 3.2v (referred to as voltage drop under load)

    Your chip says minimum 2.75v for the chip to accept a pin as high, so you are good to go.

    When a chip spec says max 0.8 etc for a low, it means 0 to 0.8v will be considered low guaranteed.
  • macrobeakmacrobeak Posts: 354
    edited 2012-11-25 22:16
    https://www.sparkfun.com/products/8745 Logic Level Converter BOB-08745 RoHS Compliant In Fritzing Library Description: If you've ever tried to connect a 3.3V device to a 5V system, you know what a challenge it can be. The SparkFun logic level converter is a small device that safely steps down 5V signals to 3.3V and steps up 3.3V to 5V. This level converter also works with 2.8V and 1.8V devices. Each level converter has the capability of converting 4 pins on the high side to 4 pins on the low side. Two inputs and two outputs are provided for each side. Bread board friendly! Can be used with normal serial, I2C, SPI, and any other digital signal. Does not work with an analog signal. The level converter is very easy to use. The board needs to be powered from the two voltages sources (high voltage and low voltage) that your system is using. High voltage (5V for example) to the 'HV' pin, low voltage (2.8V for example) to 'LV', and ground from the system to the 'GND' pin. Pins are labeled as Inputs and Outputs. These are relative to the board. A digital one going into the RXI pin on the 5V side will show up on the RXO pin on the 3.3V side as 3.3V. A digital one going into the TXI pin on the 3.3V side will show up on the TXO pin on the 5V side as 5V.
  • MacTuxLinMacTuxLin Posts: 821
    edited 2012-11-25 23:40
    Sometime back, I came across an article in Circuit Cellar written by Chris Savage on this topic. He has this on his web-site too which you might find it helpful.
Sign In or Register to comment.