Input to a PIC which goes outside the supply rails

I have a PIC project, and am wondering how to condition some of the inputs to the PIC. Some of the inputs are well behaved, but others come from sources which have voltages which go outside the PIC's supply rails.

The PIC is a 16HV785 (datasheet at

formatting link
) and the supply is Vdd = 5 volts, and Vss = 0 volts

The inputs in question will be at 5 volts when high, but will be between -4 and -12 volts when low. (they will be read as digital inputs)

My question is how to connect these inputs to the PIC

The easiest solution seems to be just to hook them to the PIC via a somewhat high value resistor and let the protection diodes keep the voltage near enough to Vss This is shown in the first drawing. This is the easiest method, and I would prefer to use this if it is good enough If this would work, what value resistor would you recommend?

The next easiest idea is to parallel the internal protection diode with an additional one. I don't know if this really buys me anything, since the voltage will still be a diode drop below Vss

My third idea was to maybe put a voltage divider after the diodes to raise the low voltage by around .7 volts this is the third drawing.

or rather than a voltage divider using 2 resistors, to use a resistor and a 2nd diode as in drawing four

Or should I do something totally different.

Martin Bakalorz

___ Source -|___|---------- to PIC

___ Source -|___|--+------- to PIC | - ^ | Vss -------+

___ Vdd - -----------|___|---+ | ___ ___ | Source -|___|--+----|___|---+-------+ to PIC | - ^ | Vss --------

___ Vdd - -----------|___|---+ | ___ | Source -|___|--+------|

Reply to
Martin
Loading thread data ...

at

formatting link

  1. The highest value you can use depends on factors like: amount of EMI in the operating environment, capacitance of cabling and the effect of resistance on transitions, and whether the added resistance is working against internal pullup or pulldown resistors or current sources.
  2. Internal protection diodes are Si junction types. Most can safely handle a milliamp or so. However, more protection is available by using external Schottky diodes. Paul Mathews
Reply to
Paul Mathews

"Martin" schreef in bericht news: snipped-for-privacy@e4g2000hsg.googlegroups.com...

The internal protection diodes are not meant to be continuously (mis)used for signal level adaption. So I would advise against drawing 1. Drawing 2 is a good one when you use a Schottky diode. BAT85 for instance. Rate the maximum current through the resistor to a 10mA, which limits the forward voltage across the diode well below 0.6V. Other drawings do not add any value as the input impedance of a PICs input pin is very high. If you have more signals to treat, you may consider the use of a MC1489 or similar RS232 type of line receiver. Four in a package.

petrus bitbyter

Reply to
petrus bitbyter

Its pretty simple just a resistor. The PIC has diodes to the rails so will clip any voltages out of range. Try a 1k resistor....

formatting link

Reply to
Marra

...so long as you find on the data sheet what the allowed currents through those ESD diodes are and size your resistor accordingly.

This is big enough that it's unlikely to blow anything up, but that's about all it is. :-) (Just because something works with particular component values in no way implies you have a good design...)

Reply to
Joel Koltner

It depends on the substrate diode spec. Often it's only 10mA and then Martin would be beyond that with his -12V input. I do this quite often (and Jim regularly chews me out for it) but I keep it at 10% of abs max for the substrate diode. Also, one has to mind cumulative substrate pulling. Running dozens of nodes into the substrate diodes at the same time may not be safe.

Martin: Whenever you do that into the positive rail (input above VCC of the uC) mind that this could lift the rail if there ain't enough load. That can have rather nasty consequences. Here again cumulative effects need to be considered.

--
Regards, Joerg

http://www.analogconsultants.com/
Reply to
Joerg

formatting link

USe a diode on the input and have a pull down R on the input..

--
"I\'d rather have a bottle in front of me than a frontal lobotomy"
http://webpages.charter.net/jamie_5
Reply to
Jamie
1k was just a guess I didnt look up the spec on the diodes.

We have even had mains going through 390K resistors into the PIC for a mains reference.

Reply to
Marra

at

formatting link

lobotomy"

formatting link
Hide quoted text -

2 components when only one is needed !
Reply to
Marra

I came across one where they used the a substrate diode as the rectifier, coming right off mains. They must have balanced the code so it would always provide a somewhat constant current draw to save the zener. I probed the oscillator, the probe capacitance stopped it ... phssst ... BANG!

--
Regards, Joerg

http://www.analogconsultants.com/
Reply to
Joerg

Probably 30 years ago now, for an elevator controls company, I reasoned that I could safely use substrate diodes (bipolar process) as rectifiers for 6VAC/60 Hz.

phssst ... BANG!

Fortunately I was able to work around with conventional 4000-series diodes, so we didn't have to re-do the chip.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
         America: Land of the Free, Because of the Brave
Reply to
Jim Thompson

One wonders how many chips they blew up while debugging...

That sort of system is about as far from "fail safe" as you can get!

Reply to
Joel Koltner

Then all the elevators stopped, dug it's brakes into the shaft walls and nine months later there was an unexplained surge at the maternity wards...

--
Regards, Joerg

http://www.analogconsultants.com/
Reply to
Joerg

Yeah. Sometimes people call me the master of penny pinching when I present at a design review but this module topped it all. I mean, they even skimped on the zener. That takes guts. Those modules were actually quite reliable as long as you didn't stop the oscillator. The bypass cap was not too large and not too small, just enough to tide it through the reset without VCC exceeding the limit. But under no circumstances could it go into reset after power-up, ever. A real case of white-knuckle engineering.

--
Regards, Joerg

http://www.analogconsultants.com/
Reply to
Joerg

Nah, they were just WAY ahead of their time :)

The particular PIC I'm using (and any that have a HV in the part number) are in MICROCHIPs new "high voltage" series. That means that they have an internal shunt regulator built in so that you don't need any external regulator. Just a dropping resistor and a cap for stability.

Same basic idea as in the module above, but approved and with design examples in the datasheet. :)

(P.S. I'm not kidding, really ... read the datasheet)

On a serious note, thanks to all for your advice. Since it seems fairly evenly split as to if I need some diodes or not, I will try it without them, but leave some open pads on the layout incase I need them. I will try using somewhere between 10k to 47k as the input resistor. (probably start with 33k and see if that has noise problems)

Martin

Reply to
Martin

Yes, you should always have the s.e.d folks 'vote' to decide what to do in your design....not.

Reply to
Paul Mathews

On a sunny day (Wed, 12 Dec 2007 13:54:19 -0800 (PST)) it happened Marra wrote in :

Here is an other variant: +5 | R1 10k |------------------- PIC c ----- b NPN Si | e /// | R2 2k | in +5 to -12V -----

The switch point depends on ratio R1 / R2. For example in this case for 2.5V across R1 you need .5 V across R2. The input then switches at -.5 + -.7(Vbe) = -1.2V.

The NPN must be able to handle -5V Vbe. Neg edge is very fast, pos edge is set by R1 and caps of transistor and PIC.

Reply to
Jan Panteltje

values

Lifting the rail often happens when inexperienced engineers test chips for latch-up. It's a sneaky problem that not everyone considers. Good catch.

Forward biasing an internal diode injects current into the substrate. This can alter the behavior of analog portions of the chip. When someone does a latch-up test (which is kind of what is happening here), they merely check for latch-up, not functionality of the chip.

Reply to
miso

Non ST PIC inputs don't typically have a 2.5V threshold- more like TTL levels when operated from 5V.

You may have managed to come up with a circuit that's even worse than using a 1K resistor directly to the PIC.

Best regards, Spehro Pefhany

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

How do you guarantee that the inputs do not violate the absolute maximum ratings?

"Voltage on all other pins with respect to VSS .....................

-0.3V to (VDD + 0.3V)"

Reply to
Richard Henry

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.