Shop OBEX P1 Docs P2 Docs Learn Events
How to safely interface a 5v signal to the propeller? [See Post/Reply #104] — Parallax Forums

How to safely interface a 5v signal to the propeller? [See Post/Reply #104]

Dave ScanlanDave Scanlan Posts: 160
edited 2011-05-17 11:49 in Propeller 1
Has anyone solved the·safest way to interface a 5V signal to the Propeller?· So far, it has been suggested that a series resistor be used with values ranging from 1k to 10k.· Also, a voltage divider has been suggested.

Thanks,

Dave



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··

Post Edited (Dave Scanlan) : 5/7/2006 5:29:12 PM GMT
«134

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-07 17:35
    We've found the chip to be 5v tolerant -- using a series resistor will limit the current driven into a pin a provide additional protection. I'm using 1K resistors when taking a 5v signal in.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Dave ScanlanDave Scanlan Posts: 160
    edited 2006-05-07 17:37
    Thanks, Jon.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··
  • cgraceycgracey Posts: 14,133
    edited 2006-05-08 05:29
    The whole chip needs to run on 3.3V, nominally. We've applied 5V to see what would happen, but it didn't improve performance. I think·I remember it just getting a little warm. This should not be done, though, because the Propeller's CMOS process specifies 3.6V as the absolute maximum operating voltage.

    To input from a 5V system, a series resistor in the 1k-100k range is probably·the best approach.·There are parasitic catch diodes on every pin of the device which will clamp incoming out-of-range voltages to within ~0.4V of the VSS and VDD rails. This will force the resistor to drop 1.3V (5.0V-(3.3+0.4)) for an incoming high signal.

    To output to a 5V system might be a simple matter if the threshold voltage is TTL (~1.4V) or CMOS (2.5V). You can connect straight in. For bidirectional pins, just use a series resistor.

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


    Chip Gracey
    Parallax, Inc.
  • Dave ScanlanDave Scanlan Posts: 160
    edited 2006-05-08 06:00
    dave scanlan said...
    thanks, chip.· those are the words many of us needed to read.

    chip gracey said...

    the whole chip needs to run on 3.3v, nominally. We've applied 5v to see what would happen, but it didn't improve performance. I think·i remember it just getting a little warm. This should not be done, though, because the propeller's cmos process specifies 3.6v as the absolute maximum operating voltage.

    To input from a 5v system, a series resistor in the 1k-100k range is probably·the best approach.·there are parasitic catch diodes on every pin of the device which will clamp incoming out-of-range voltages to within ~0.4v of the vss and vdd rails. This will force the resistor to drop 1.3v (5.0v-(3.3+0.4)) for an incoming high signal.

    To output to a 5v system might be a simple matter if the threshold voltage is ttl (~1.4v) or cmos (2.5v). You can connect straight in. For bidirectional pins, just use a series resistor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-05-08 06:59
    Thanks Chip for the clarity.
    I too was concerned that BOTH directions were not discussed.

    I asked another forum for a definition of '5 volt tolerant' to try to get a generally accepted understanding. Their reply was simply that ICs which are powered at a lower voltage [noparse][[/noparse]in this case 3.3volts], but which can operate with input and output logic at +5 volt levels.

    I suppose that makes another distinction necessary. I would call 'FULLY +5 Volt tolerant when no resistor is required, and PARTIAL +5 Volt tolerant when some protection is required.

    The reasoning behnid making such a find distinction is that many of the EEPROMs and even the MAX3232 appear to be FULLY +5 tolerant.

    Of course I suspect edge detection is a whole different subject. It seems that the Propeller doesn't have it - so it would be moot.
    So much for pedantics.

    BTW, you are indicating that the Propeller is +5 FAULT TOLERANT, too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • cgraceycgracey Posts: 14,133
    edited 2006-05-08 15:38
    Kramer,
    I'm not sure what you're asking here, but I'll elaborate on the 5V issue.
    5V signals should not be applied to the Propeller's pins without some kind of current-limiting, at least. If you were to apply a high-current 5V signal to·a Propeller's I/O pin, it would have the effect of sourcing current into VDD through the pin's parasitic clamp diode. If the clamp diode dropped 0.4V then VDD would be at 4.6V. This is not a good thing, as the chip would at least run warm and too much current might be going through the clamp diode, especially if a 3.3V regulator attached to VDD was pulling VDD downward to not let it go above 3.3V. Hundreds of milliamps could flow through the diode in that case, and eventually burn it out. That would not be good for the chip.
    Kramer said...


    BTW, you are indicating that the Propeller is +5 FAULT TOLERANT, too.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.

    Post Edited (Chip Gracey (Parallax)) : 5/9/2006 5:49:42 AM GMT
  • JavalinJavalin Posts: 892
    edited 2006-05-12 21:54
    Hi Chip, all,

    I've been working on i2c for the propeller (posted i2c object & examples).· I've been using 3.3v and 5v parts.· It is connected as follows:

    SDA ---- 1k ---- 3.3v parts
    1k ---- 5v parts
    SCL ---- 1k· ---- 3.3v parts
    1k ---- 5v parts

    Both lines pulled up to 3.3v via 4.7k resistors.

    It works, and works well - i have 8 devices on the bus.· The current into each pin is miniminal 0.0003 amps·(micro?) or so, but the voltage is approx 3.7v

    Is this a problem, or is the extreme low current within tollerance of the pin diodes?

    Thanks,

    James
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-05-13 03:40
    Javalin,

    ·· This should be fine at low current.· I monitored the signals from the PING))) Object I was working on and the return pulse from the PING))) reads 5V from its signal pin, but on the Propeller side of the 10K resistor I read almost 4V but again, very low current.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 5/14/2006 3:22:01 AM GMT
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-05-13 07:16
    I apologize if my discussion above is confusing.· I was just trying to clarify what '+5 volt tolerant' means to different people.· [noparse][[/noparse]It seems a bit too wordy now.]·

    As for '+5 volt FAULT tolerant', TO ME that means that if you accidently connect the Propeller to a 5volt supply for a moment damage is unlikely.· There has been mention of accidentally running Propellers on a +5 supply without serious short-term harm [noparse][[/noparse]though they do get hot].·

    The dilemma of resistor size [noparse][[/noparse]1k or 10k]·appears to be that there is a bit of Calculus involved [noparse][[/noparse]we are averaging (or integrating) the actual stress on the I/O pin].

    The general fix is a 1k resistor, and this will protect all but the slowest of·INPUT frequency.· [noparse][[/noparse]OUTPUT is not an issue.]

    For a continuous High Input condition, I·have read·that 10k ohms was said to be much better in another thread. As Chip points out, this is due to the durability of some 'parasitic clamp diodes' on each pin.

    And typically of semiconductors, the issue is indirectly related to voltage as what is really needed for the diodes to survive is current limiting. This affect only input, not output [noparse][[/noparse]which merely requires normal techical caution and nothing fancy].

    I suppose this is more than many of us want to know or understand, so the rule of thumb is 1K for communications and 10k if you really want to leave some input on (in a High state) it would really be better to use a 3.3volt scheme to do so.

    BTW, it seems the I/O of the Propeller is rated at 50ma!!!· So if you take BasicStamp precautions, you are very much on the safe side.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 5/13/2006 11:10:32 AM GMT
  • JavalinJavalin Posts: 892
    edited 2006-05-13 11:00
    Chris,

    Thanks for the information!

    James
  • Brian RileyBrian Riley Posts: 626
    edited 2006-05-14 06:00
    Chip Gracey (Parallax) said...
    To input from a 5V system, a series resistor in the 1k-100k range is probably the best approach. There are parasitic catch diodes on every pin of the device which will clamp incoming out-of-range voltages to within ~0.4V of the VSS and VDD rails. This will force the resistor to drop 1.3V (5.0V-(3.3+0.4)) for an incoming high signal.

    To output to a 5V system might be a simple matter if the threshold voltage is TTL (~1.4V) or CMOS (2.5V). You can connect straight in. For bidirectional pins, just use a series resistor.

    So, if I were to set up a Propeller chip appropriately on my PDB and wished to use the onboard RS232 DCE circuit, I would want a 1K or 10K resistor from the RS232 DCE port input /TTL output to the Propeller on the pin I select as input and direct wire the Propeller pin I select as output to the TTL input for RS232 Output ?

    Thanks for your time.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cheers ... brian riley, n1bq, underhill center, vermont
    See the K107 Serial LCD Controller at
    www.wulfden.org/k107/
  • cgraceycgracey Posts: 14,133
    edited 2006-05-14 06:03
    This is fine. Those diodes can handle probably 50ma, but·that much current could have the unintended consequence of lifting VDD above 3.3V. What you've done is fine.


    Javalin said...
    Hi Chip, all,

    I've been working on i2c for the propeller (posted i2c object & examples).· I've been using 3.3v and 5v parts.· It is connected as follows:

    SDA ---- 1k ---- 3.3v parts
    1k ---- 5v parts
    SCL ---- 1k· ---- 3.3v parts
    1k ---- 5v parts

    Both lines pulled up to 3.3v via 4.7k resistors.

    It works, and works well - i have 8 devices on the bus.· The current into each pin is miniminal 0.0003 amps·(micro?) or so, but the voltage is approx 3.7v

    Is this a problem, or is the extreme low current within tollerance of the pin diodes?

    Thanks,

    James
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • cgraceycgracey Posts: 14,133
    edited 2006-05-14 06:06
    I believe so. I'm not too familiar with the PDB, but that sounds logical.
    Brian Riley said...
    Chip Gracey (Parallax) said...
    To input from a 5V system, a series resistor in the 1k-100k range is probably the best approach. There are parasitic catch diodes on every pin of the device which will clamp incoming out-of-range voltages to within ~0.4V of the VSS and VDD rails. This will force the resistor to drop 1.3V (5.0V-(3.3+0.4)) for an incoming high signal.

    To output to a 5V system might be a simple matter if the threshold voltage is TTL (~1.4V) or CMOS (2.5V). You can connect straight in. For bidirectional pins, just use a series resistor.

    So, if I were to set up a Propeller chip appropriately on my PDB and wished to use the onboard RS232 DCE circuit, I would want a 1K or 10K resistor from the RS232 DCE port input /TTL output to the Propeller on the pin I select as input and direct wire the Propeller pin I select as output to the TTL input for RS232 Output ?

    Thanks for your time.

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


    Chip Gracey
    Parallax, Inc.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-14 14:58
    The I2C specification actually shows how to connect 5v parts to a 3.3v buss.· The circuit attached is right out of that document.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Mike GreenMike Green Posts: 23,101
    edited 2006-05-14 15:29
    Any suggestions for an appropriate device for the level shifter?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-14 15:57
    Here's more information, though I don't see any part numbers listed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • JavalinJavalin Posts: 892
    edited 2006-05-14 16:51
    Hi Jon,

    I'd seen this, I think i've seen some IC's which do similar - but I was trying to avoid complications!

    I did think of running two bus's as an intermim - but this works enough for now!

    Hows you I2C object(s) comming on?

    Cheers,

    James
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-14 16:54
    I juggling a lot of plates right now so it isn't finish -- this week I've got a trade-show to deal with; when I'm done with that I will get back to Propeller object development.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2006-05-15 00:45
    The Philips doc suggests a BSN10 for the mosfet in that interesting circuit. The important thing is the threshold voltage, which should be 2 volts or less. There are usually called "logic level" or "low Vgs" mosftets. One of my favorites for high side switching at low Vgs is the Supertex LP0701 (Mouser) Another is the VN10 (zetex and others).

    An interface with resistors is quite acceptable for most purposes, I think. The I2C interface requires the pullup resistor, and the pullup resistance should be about 10 times the value of the current limiting resistor. Here is a possible circuit:

    attachment.php?attachmentid=42241

    With the arrangement in the attached image, the 10kohm pullup is on the 3.3 volt side, and there is a 1kohm protection resistor to the external i/o to a 5 volt part. The voltage on the left on the Prop side swings from 0.3 to 3.9 volts, and the voltage on the right (5 volt external device) swings from 0 to 3.3 volts as an input, adequate for TTL or CMOS. The zener diode (3.3 volt low power) is optional-- to shunt away the 1.1 ma current from the Propeller substrate diode and as extra fault protection. That happens if the 5 volt device is a 5 volt output. In the resting state of I2C, both devices will be inputs, so the I2C line rests at 3.3 volts with no current in the substrate diode, well above the TTL switching level of 1.4 volts.

    If the 5 volt device really needs a 5 volt swing, then the 10k pullup resistor could be moved to the right-hand side and pull up to 5 volts. In that case there would be a small current of around 100 microamps in the input state to the Propeller substrate diode.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 6/26/2006 5:49:31 PM GMT
    543 x 176 - 9K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-25 03:22
    By request, this thread has been made sticky.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • LarryLarry Posts: 212
    edited 2006-06-25 03:36
    Tracy said...
    With the arrangement in the attached image, the pullup is on the 3.3 volt side, and the voltage on the left (propeller as input) swings from 0.3 to 3.9 volts, and the voltage on the right (5 volt device) swings from 0 to 3.3 volts, adequate for TTL or CMOS. The zener diode (3.3 volt low power) is optional-- to shunt away the 1.1 ma current from the Propeller substrate diode and as extra fault protection. In the resting state, both devices will be inputs, so the I2C line rests at 3.3 volts with no current in the substrate diode.

    If that's true, then shouldn't the Prop be on the right and the 5 volt device on the left?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Tracy AllenTracy Allen Posts: 6,656
    edited 2006-06-26 17:51
    Hi Larry, Thanks for the heads-up. The resistors R1 and R2 labels were reversed. The 10k resistor should be the pullup and the 1k should connect between the Prop and the external device. I edited the post and corrected the labels. Does that look okay now?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-07-20 20:36
    Can I use an opti coupler ?

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

    Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd

    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-20 20:40
    You can if they're fast enough or your speed needs are modest. Most opticouplers are pretty slow (microseconds).
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-07-20 21:12
    KK,

    For something faster than most phototransistor optocouplers and still relatively cheap, try an H11L1. It boasts a 1MHz data rate and should run from 3.3V on the Propeller side. If not, the output is open collector and can be pulled up to a lower voltage than its logic supply. You can download a datasheet here: www.fairchildsemi.com/ds/H1/H11L1-M.pdf

    -Phil
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-07-21 13:55
    Phil and Mike:
    THanks. The idea is to use the diode in either the H11L1M or opticouplier to charlie-plex SSR's. The issue is the cheaper SSR's with the switching load I need all require 5V signal. Only the more expensive ones have 3.3V triggering. SO I was thinking of the opticouplier (and now the H11L1m) because it's only a 1 way triger (3.3 to 5V). THe only thing I can see now is the poticoupliers come in a 4 channel package package, and all I'v found so far for the H11L1M is 1 channel.
    Once I get a basic schmatic drawn, I'll post it, in case my inexpierence has led to costly errors.
    Thanks again!

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

    Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd

    ·
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-07-21 16:33
    KK,

    If you go the four-channel route (e.g. Panasonic), beware the switching times! Most are phototransistor types. To get the switching times advertised, you'll probably have to add a common base amplifier to each section to keep the phototransistor's C-E voltage constant. Otherwise, the Miller capacitance will slow any voltage excursions to a crawl. Especially avoid the Darlington types. They're the slowest of all.

    -Phil
  • Kaos KiddKaos Kidd Posts: 614
    edited 2006-07-21 17:12
    Phil, while I only understand about 1/8 of what you said, the jist is don't use the darlington type.
    After that I get lost. My thought was to tie all the + on the out put side to the +5v rail, and the output side to the input of the SSR, from which go to the GND.
    ... the one you point to, the H11L1M, is somewhat along thoes lines. I take it that maybe, the cost difference is worth the simplicty of connection?

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

    Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd

    ·
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-07-21 17:26
    KK,

    'Just thought of an alternative to the common base amp. Since the Propeller's input trip point is Vdd/2, you could bias any input fed by the phototransistor to just below that, using a very stiff divider. Then connect the phototransistor emitter to the pin, and the collector to Vdd. The idea is that when the phototransistor conducts, it raises the pin just enough (plus some margin) to change the input state. That way the C-E voltage won't vary by much, and the Miller capacitance will have less of an effect. You'll want to be sure to test this over temp.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2006-07-21 17:32
    KK,

    Oops! I see you're going out with them instead of coming in. I misunderstood that. Could you post a schematic of what you're trying to do? You can just put a "black box" where the optoisolator goes for now. But I'd like to see how the SSR is being used. Also, if you're driving a SSR, do you really need the speed -- or the additional isolation? Maybe just an open collector transistor would suffice to drive the SSR.

    -Phil
Sign In or Register to comment.