How to safely interface a 5v signal to the propeller? [See Post/Reply #104]
Dave Scanlan
Posts: 160
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
Thanks,
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··
Post Edited (Dave Scanlan) : 5/7/2006 5:29:12 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··
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.
··
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
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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
Post Edited (Chip Gracey (Parallax)) : 5/9/2006 5:49:42 AM GMT
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
·
·· 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
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
Thanks for the information!
James
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/
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
Chip Gracey
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
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 Williams
Applications Engineer, Parallax
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:
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
If that's true, then shouldn't the Prop be on the right and the 5 volt device on the left?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller + Hardware - extra bits for the bit bucket =· 1 Coffeeless KaosKidd
·
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
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
·
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
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
·
'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
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