0

I've been designing a circuit which requires a microcontroller to read a voltage above its current VDD or below its current VSS. I've done this once or twice before by putting a large-ish resistor in series between the high voltage source and the microcontroller pin. My understanding is that this works by limiting the current through some protection diodes on the input pins.

I could use a voltage divider, but it looks ugly and prone to mishaps with the way my circuit works (the ground reference of the microcontroller shifts around...I really don't like it, but that's how things are wired...I'm kinda stuffing this microcontroller in where another part used to go). I'm also trying to reduce my part count.

The voltage that would be read is either high or low and could go as high as 0.7V above VDD or 0.7V below VSS. Does anyone know a way to calculate a size for a series resistor for this situation? I'd like to avoid relying on the guess and check since I have a limited supply of microcontrollers.

Los Frijoles
  • 2,252
  • 13
  • 21
  • It will be on the datasheet as to how much current the pin diodes can handle. I know it is for PIC 8 bit processors anyway. (On the PIC, some pins handle more than others) – Jodes Apr 07 '15 at 22:50
  • It shows the diodes on the datasheet, but I've been unable to find anything but the current rating of the pin, which I'm pretty sure isn't the current rating of the diodes. The microcontroller in question is an ATTiny13A. – Los Frijoles Apr 07 '15 at 22:52
  • what is the signal like? fast? slow? analog? VDD/VSS max ratings for Atmel microcontroller pins like that are usually +-1V, so you may already be within the "safe" range anyway. – KyranF Apr 07 '15 at 23:08
  • If it's a slow digital signal a simple 10K resistor will work fine - remember digital inputs are already very high impedance op-amp inputs, it's only the protection diode clamps you are trying to protect with the series limiting resistor. – KyranF Apr 07 '15 at 23:09
  • It's relatively slow, based on the 1-wire protocol except on the ground wire instead of the power wire (I feel really uncomfortable with that, but it's the way it is for the moment), so a larger resistor wouldn't be a big issue. Looking around some more, I've managed to find one application note stating offhandedly that they are rated to 1mA (and without good grammar either). I'm now looking around for some confirmation of that, but I'm not sure where to find it – Los Frijoles Apr 07 '15 at 23:12
  • This is one of those using something in a way it's not intended, and YMMV things. – Matt Young Apr 07 '15 at 23:35
  • What did the IC manufacturer say? Sometimes they will respond to questions like this, and I always recommend that you try asking them. – user57037 Apr 08 '15 at 00:00

1 Answers1

5

Cutting corners in this area is well summed up by a metaphor based on a long ago Bell Helmets ad - "If you have a $10 head then buy a $10 helmet"

Specifications that allow body diode conduction ALWAYS relate to worst case specifications - ie will not DIE but are not guaranteed to WORK.

Allowing body diodes to conduct during NORMAL operation violates ALL products' data sheet specs* and even a tiny current MAY cause some sort of maloperation SOMETIMES.

Some people will argue strenuously that it does not matter if the current is small enough.
They are just plain wrong.
Once forward biased, body diodes inject current into the substrate and it MAY turn up anywhere and do anything.
*-Manufacturers CAN design to make this not so and some do, but if they do not specify they have done so there are no guarantees. A few microamps injected into an insulated node can turn n a floating gate for a parasitic MOSFET that causes xxx to happen when yyy, with Murphy in charge of both xxx and yyy. Do it at your peril.

_________________________________________________

Using ICs correctly:

From the TI wiki.
Similar advice is included in all reputable data sheets.
Failure to understand this advice and to apply it in all "designs" leads to them not being 'designed' in the sense that that term is usually intended.

enter image description here

From here


The International Electrotechnical Commission (IEC) weigh in:

Absolute Maximum Ratings

The absolute maximum rating (AMR) section in the datasheet includes limits on operational and environmental parameters, including power, power derating, supply and input voltages, operating temperature, junction temperature, and storage temperature.

The International Electrotechnical Commission (IEC) [5] defines absolute maximum ratings as “limiting values of operating and environmental conditions applicable to any electronic device of a specific type as defined by its published data, which should not be exceeded under the worst possible conditions. These values are chosen by the device manufacturer to provide acceptable serviceability of the device, taking no responsibility for equipment variations, and the effects of changes in operating conditions due to variations in the characteristics of the device under consideration and all other electronic devices in the equipment. The equipment manufacturer should design so that, initially and throughout life, no absolute-maximum value for the intended service is exceeded with any device under the worst probable operating conditions with respect to supply voltage variation, equipment component variation, equipment control adjustment, load variations, signal variation, environmental conditions, and variation in characteristics of the device under consideration and of all other electronic devices in the equipment.” In other words, the part manufacturers select the AMR values, and the companies, which integrate electronic parts into products and systems, are responsible for assuring that the AMR conditions are not exceeded.

Zilog & Philips (in this case) then add:

Recommended Operating Conditions (ROC)

Recommended operating conditions provided by part manufacturers include voltage, temperature ranges, input rise and fall time. Part manufacturers guarantee the electrical parameters (typical, minimum, and maximum) of the parts only when they are used within the recommended operating conditions and standard operating conditions. Philips notes, “The recommended operating conditions table [in the Philips datasheet] lists the operating ambient temperature and the conditions under which the limits in the “DC characteristics” and “AC characteristics” will be met” [6]. Philips also states that “The table (of recommended operating conditions) should not be seen as a set of limits guaranteed by the manufacturer, but the conditions used to test the devices and guarantee that they will then meet the limits in the DC and AC characteristics table.”

ZiLOG [7] states, “Recommended operating conditions are given so customers know the maximum and minimum conditions where normal performance is still available from the device. Once the normal operating conditions are exceeded, the performance of the device may suffer.”

From here

Allegro concur - of course

Cypress

Oracle

___________________________

Further reading [tm].

Russell McMahon
  • 150,303
  • 18
  • 213
  • 391
  • 1
    I totally agree with Russell's answer. You should never exceed the manufacturers Absolute Maximum ratings. The very common specification is that inputs should not go more than 0.3V above Vdd or 0.3V below GND. The worst case of over / under biased inputs is that the charge injection can cause unexpected junction stacks of PN PN layers to act like an SCR and latch into an ON state. Latch-up like this can lead to non-functionality until all power is completely removed from the chip. In a worst case a latchup can cause extreme amounts of current to pass through parts of the chip that (continued) – Michael Karas Apr 08 '15 at 05:14
  • 1
    (continued from above) were never intended to carry such current. In this case there is often catastrophic failure of the silicon chip. Note that chips are very often most susceptable to latchup behavior when there is bias on I.O pins while the chip is powering up or down. Also with today's technology containing gazillions of transistors and circuits on one chip at modern fine line geometry this problem is even more of an issue than ever!! Be very careful. Don't cheat in the name of simplicity and saving a few cents on your BOM thinking you can get away with it. – Michael Karas Apr 08 '15 at 05:20
  • I do agree. I wouldn't normally do this and the point about the current into the die substrate was something I hadn't considered. I'll likely go with the voltage divider route instead, but I did find this atmel application note wherein they use an AVR with an input pin connected directly to mains (it's a zero cross detector): http://www.atmel.com/images/doc2508.pdf – Los Frijoles Apr 08 '15 at 05:42
  • –1 for the moment; could you provide some examples of data sheets saying "body diodes conducting violates specifications", especially for the ATtiny13 in question (or similar processors, 8-bit Freescales, Microchips)? Let me know and I'll flip the vote. This should be extremely easy to provide because you mention this is the case for "ALL" products. – Nick T Oct 21 '16 at 16:11
  • @NickT - I go out of my way not to be rude to people on sites like this (and in life generally). I don'y ALWAYS manage :-). | Numerically your downvote matters not a whit to me. BUT inasmuch as such votes & unthought-through comments help mislead others who seek with open minds, votes that are based on wilful ignorance annoy me. If you are going to claim that "I know my electrical engineering though", then you need to take more care in reading answers AND with the "rep" you have you should REALLY be aware already of the crucial point here or you will delude yourself as well as others... – Russell McMahon Oct 21 '16 at 23:20
  • @NickT To use electronic devices correctly you absolutely must know and observe the difference between what are usually termed "typical operating" specifications and "absolute maximum specifications. The former are the ONLY ones valid for use during proper device operation. Whereas absolute maximum specifications relate to "dec\vice will not emit magic smoke but may well walk and talk funny until powered down and given a nice cup of tea". – Russell McMahon Oct 21 '16 at 23:21
  • As cheeky as I was with my comment, I did not attack you inasmuch as your answer. Instead of making attacks towards me for being "deluded" and "willfully ignorant", how about addressing my point of contention? – Nick T Oct 21 '16 at 23:27
  • @NickT Some ICs will take seconds to minutes to come right after > typical and <= abs max conditions are applied, often for the reasons I give above and elsewhere (eg charge injected into isolated nodes by illegal paths activated by > typical voltages then act as floating gates to parasitic FETs). I have seen a number of ICs that do this. One such was the ISD2590 speech IC. Under certain power down conditions the IC can be glitched into a mode where unless Vdd is hard grounded the IC locks up for several minutes until charge in isolated nodes dissipates. (ISD asked for my workaround :-)). – Russell McMahon Oct 21 '16 at 23:30
  • @NickT Just saw your response. My comments are actually objective. Really. Parse them carefully. Note that I did address your points please rereread and understand the key aspect. Abs max <> typical spec. |See above (1) Specifications that allow body diode conduction ALWAYS relate to worst case specifications - ie will not DIE but are not guaranteed to WORK. [[ie NON-operating spec]]. (2) Allowing body diodes to conduct during NORMAL operation violates ALL products' data sheet specs | It says so IN each spec sheet. Abs max ratings are NOT operating ratings. Read all above carefully. – Russell McMahon Oct 21 '16 at 23:38
  • @NickT I have added to my answer. If that slew of references and material does not convince you that there has been a fatal flaw in your understanding of how devices can and should be operated and that this is clearly spelled out in numerous places (data sheets etc) then I don't think I can add anything that will. I've spent the time and effort not primarily to answer you - as I had already stated more than enough for you to understand and follow up on, but for others who may otherwise be mislead by incorrect adumbrations or assertions that a number of people make on an ongoing basis. – Russell McMahon Oct 22 '16 at 00:04
  • @RussellMcMahon you cited many instances saying absolute maximum limits are indeed absolute; I agree just as before. That is not my dispute with your answer, rather that "body diodes conducting violates specifications". – Nick T Oct 22 '16 at 00:21
  • @NickT You MUST read what people (I and the spec sheet writers) write and then think about how it applies to your situation. What makes a body diode conduct (in the forward direction)? ie not reverse bias leakage. – Russell McMahon Oct 22 '16 at 00:28
  • @NickT ATtiny13 absolute maximum input voltage rating is 0.5V beyond the power rails. This voltage is chosen specifically to avoid protection diode conduction. So you could use external Schottky diodes to limit input voltage, but if you rely on the internal protection diodes then you are operating the chip outside its specifications and Bad Things could happen . – Bruce Abbott Oct 22 '16 at 06:32
  • @BruceAbbott While I'm of the impression that YOU understand that your above statement applies to protection from magic smoke and NOT to processor operation, NickT has so far failed to show that he appreciates this important core point. It may be wise to make it clear that you statement relates to processor not being fatally damaged but does not mean it is guaranteed to operate correctly with external clamp Schottkys operating. – Russell McMahon Oct 22 '16 at 11:46
  • @BruceAbbott ... However , extremely unusually, the ATtiny13 data sheet specifies allowable operating Vin also as up to +/- 0.5 V outside the supply rails. I wonder if Microchip will change this ? :-) – Russell McMahon Oct 22 '16 at 11:47
  • @RussellMcMahon - perhaps Microchip are just more cautious, or perhaps their chips are more sensitive to current injection. I had the misfortune to own a commercial product that violated the spec (I2C pullups to +5V with Vdd = 3.3V) and the PIC did misoperate, and then it blew up! – Bruce Abbott Oct 22 '16 at 14:16
  • @BruceAbbott Perhaps the engoneers at Atmel had a really bad day and wrote a spec that should have sent them screaming in terror :-). ie it doesn't matter if the stray current is say around 1 uA. Whie this will not usually cause problems (based on reported and personal experience), it is able to, so it might. Easiest greeblie to visualise at such low currents if a node which accepts charge and acts as an isolated FET gate. | As noted, I had an IC that used to lockup pedictably due, apparently, to charg injection. – Russell McMahon Oct 23 '16 at 11:37