PDA

View Full Version : +/- 12V Input



hippy
09-09-2007, 11:02 AM
The PICmicro and others can tolerate connection of high voltages to input pins providing the signal is current limited; is this the same for the Propeller or is it a "do not do it" ? Having only just got my Propeller hardware I'd prefer to not destroy it in the first few days.

For example, +/-12V through a 47K would be just 260uA if the 47K were dropping the entire voltage. I'd have no problem going to a higher R as long as it worked.

I've read the "5V interfacing" sticky, but there wasn't anything I saw which really said how far the input voltage could be pushed at low current. I could buffer the signal through a 74HCxx which I know does work for other micros, but it seems over-kill if a single resistor will do the job.

rjo_
09-09-2007, 12:29 PM
At the end of the day...you are going to want it isolated as much as possible. That always seems to be the answer.
I don't know why... but these discussions always seem to vector toward that common answer.

Skogsgurra
09-09-2007, 01:02 PM
Hippy,

There's nothing more to it than good old Ohm's law.

As long as your resistor limits current to acceptable values, you will be fine.

The Prop has no idea if you input 1, 10 or 100 volts as long as the resistor drops it. As you increase the voltage, you will find that power dissipation in the resistor becomes an issue. I am currently inputting an "unknown" voltage to a couple of pins. This voltage may be up to a few hundred hundred volts and I need to find out how many times per second it goes to zero V (it is about counting breakdowns in a thin layer of insulating liquid).

For this, I use a 100 kohm series resistor. At 300 V, the power dissipation is 900 mW, so I have put in 3 times 33 kohm to keep temperature down (the tiny resistors can only take a few hundred milliwatts). It also helps keep flash-over voltage up (it is usually around 250 V for 1/2 W resistors).

Why not 1 Mohm? Simply because the low-pass filter created from 1 Mohm and the pin and stray capacitance (about 10 pF) cuts off fast pulses. At 100 kohm, the corner frequency is around 150 kHz. With 1 Mohm, it would be 15 kHz, which would make the counting very unreliable.

The Prop and its counters are just perfect for this application. As it is for any application I have seen so far.

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

rjo_
09-09-2007, 01:11 PM
sorry to be so negative... but just when you think you got it all covered... isolated inductive and capacitance will get in your way.
Isolate everything... and keep it all as far apart as the design will allow... keep your big stinking wires co-axial with the pins;>)

Rich

Skogsgurra
09-09-2007, 01:28 PM
I can understand your concern rjo_. But there is a difference between myths and engineering reality.

I have been doing this since dawn of time (when the 4004 appeared).

I have done consumer goods where we connect the micro (no, not the 4004!) directly to the mains with a series capacitor, a diode and a zener/electrolytic for power supply, not even knowing if Vss was at hot or neutral wire. And connecting micro output directly to the triac gate. Of course, you have to be careful and know about electricity. But the question was about how much voltage an input pin can take if there is a series resistor. The answer is; unlimited, as long as the resistor is properly sized.

And +/- 12 V is not a problem in any case.

The SELV (Safe Extra Low Voltage) limit is 50 volts. If you go beyond that, you need to contact a certified electrician. I do not need to, since I am a registered EE.

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

deSilva
09-09-2007, 03:57 PM
Skogsgurra put it very well, especially the often ignored low-pass effect of series resistors!
As I am drawing pictures for my afternoon class next week anyhow, I can as well post it here. I think Skogsgurra's explainations could become even more obvious - if that would be possible.

BTW: I am not so confident with high negative voltage...

Skogsgurra
09-09-2007, 04:04 PM
Thanks deSilva (BTW, my wife collects ash-trays, little sculptures, post-cards and such things with the Hamburger Rathaus on it. She is perfectly normal in every other sense).

There are substrate diodes from input to Vss as well. That takes care of the negative part.



Edit: I found this paper. http://www.csit-sun.pub.ro/courses/vlsi/Carte_VLSI/bookch14.pdf·Have a look at pictures on page 14-15. It shows very well what is happening. Although at GHz speed. Not that the Prop is far behind...

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


Post Edited (Skogsgurra) : 9/9/2007 8:37:01 AM GMT

hippy
09-09-2007, 07:15 PM
@ Skogsgurra : It is good to hear from someone who has done it and can report 'the world did not end'. 300V via 100K is 3mA, and I'm looking at less than that. This will be a static / slow-speed signal so capacitance will not be a problem. Thanks.

@ rjo_ : I appreciate you comments and especially from a 'solid engineering' perspective. In an ideal world, or when advising others, I would also take the "do it properly" approach. For home-hobby use I'm prepared to take quick and dirty as long as it comes with acceptable risk.

hippy
09-09-2007, 10:45 PM
Putting on my 'bold as brass' T-Shirt, I took the leap of faith and it all worked okay for me. The circuit I used is shown in the attachment -

hippy
09-10-2007, 12:22 AM
Skogsgurra said...
As long as your resistor limits current to acceptable values, you will be fine.

Probably worth noting that the Propeller Preliminary Datasheet ( www.parallax.com/dl/docs/prod/prop/PropellerDSv0.3.pdf (http://www.parallax.com/dl/docs/prod/prop/PropellerDSv0.3.pdf) ) specifies that as "Max. DC current into an input pin with internal protection diode forward biased +/-500uA"

Loopy Byteloose
09-10-2007, 12:51 AM
So I am guessing the concern for +/-12v is to directly connect reception to conventionally driven RS232 lines.

Is that right?

I cannot seem to think of another reason to use a higher than +5volts or a need to run both the plus and the minus.

Are their other uses, like samplling an audio input?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········


···················· Tropically,····· G. Herzog [·黃鶴 ]·in Taiwan

Phil Pilgrim (PhiPi)
09-10-2007, 01:01 AM
One thing to factor into the design is the chance for shorts or component failure. Two resistors in series is cheap insurance. For a few pennies more, Schottky diodes to Vdd and Vss will take any remaining load off the Propeller's input diodes.

-Phil

hippy
09-10-2007, 01:31 AM
@ Kramer : +/-12V is convenient for direct coupled RS232, but also for automotive interfacing ( where I am aware that a lot more filtering and robustness is needed ), and in battery charging applications, especially where reverse connection may need to be determined. It's also handy, as Skogsgurra notes, for direct mains interfacing ( zero-crossover detection ) plus any interfacing to an incoming voltage which is above the 3.3V level.

@ Phil Pilgrim (PhiPi) : Agreed; for a more robust solution I'd go with both. For hobby-home use I'd personally consider such failure to fall under acceptable risk, except for mains and higher voltage interfacing.

My primary, but not only, interest was indeed direct RS232 interfacing, but I wanted to avoid explicitly saying that because I've seen too many discussions elsewhere quickly collapse into "use a MAX232, they are only a few dollars" and then off at a tangent for alternative transistor interfaces etc, and the "can I or can't I, if I'm prepared to take the risks" question rarely gets satisfactorily answered.

What's recommended for a robust, well designed, commercial product is not necessarily what a hobby-home user wants or even needs. "A few dollars" can equate to many dollars for people who do not have component stock rooms and have to buy one offs as and when needed. That's not to say that I think "doing it properly" is wrong or unnecessary, or even that kludging it is recommended. Everything gets designed to a criteria, and every circuit builder has to decide their criteria.

Skogsgurra
09-10-2007, 03:05 AM
Yes Hippy,

I noticed that +/- 500 uA limit. It is (at least to me) a very conservative limit. I am used to a lot more in CMOS circuits.

It is not a question of thermal load (500 uA does not produce more than 300 - 400 uW in the diode). Instead it is about the risk of turning on parasitic thyristors that exist in the silicon. Once turned on, they short the power supply and develop a lot of heat that destroys the chip.

Question for Parallax: Is the +/- 500 uA limit a "prudent" limit? Or is the Propeller able to sink, let's say, 5 mA through its diodes without turning that SCR on? I mean, if it can take an 8 kV Human Model discharge, it should laugh at 5 mA. (Yes, I am aware of the time scales involved)

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

Paul Baker
09-12-2007, 01:52 AM
The 500uA is a conservative limit, comprehensive MTBF tests are very time consuming (therefore expensive), Since interfacing with higher steady state voltages is not the primary reason for their inclusion (they are for ESD), the max allowable S-S current is set so that the ESD function is preserved and no significant die heating occurs.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker (mailto:pbaker@parallax.com)
Propeller Applications Engineer
[/url][url=http://www.parallax.com] (http://www.parallax.com)
Parallax, Inc. (http://www.parallax.com)

Skogsgurra
09-12-2007, 05:12 AM
Thanks Paul. That is what I thought.

I have done some teasting in practical applications. Three mA seems to be OK so far. I have since been using higher resistance values, but then I need to compensate with around 5 pF to keep frequency response up. The Prop is fast - never needed to compensate resistors in a microprocessor application before http://forums.parallax.com/images/smilies/smile.gif love it!

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