> Also, note that many of the circuits offered for more extensive (expensive) > clamping are little better than the single resistor at modest voltages. > > A typical circuit uses two resistors in series and adds silicon diodes to > clamp the junction of the resistors to Gnd and Vdd, thus limiting that > junction to the range Vss-0.6 to Vdd+0.6 or so. This is _still_ out of > specification for the PIC pin! Saying that 0.6 volts above the rail is only > a little bit out of spec is like a woman saying she is just a little bit > pregnant. You either live strictly within the spec or you accept the fact > that you are not a virgin. > > Using a 5.1V 5% zener to clamp the high side is another fallacy. The actual > zener voltage could be as high as 5.36 and Vdd (if also 5%) could be as low > as 4.75. The differece is 0.6V, again well above the specified 0.3V. > > As yet another example: imagine a typical keypad interface circuit > consisting of a pullup resistor (or the built in weak pullup) and a series R > to the keypad button. In many cases the voltage waveform induced at the pin > would well exceed the clamping limits if it were not for the clamping > diodes. This particular application is almost always considered acceptable. > > Finally, I am sure there is some safe clamping current that will work in > normal operation. I'd love to see mChip document it (even if just as a > 'design guidance' type of number). > > When I started this discussion I mentioned that talking about depending on > the internal clamping diode would restart a religious war. It looks like I > was at least partly right. :-) It's not a matter of religious war - it's a matter of whether one is stupid enough to exceed the operating specification for ANY reason and expect it not to cost you at some unknown future time. (There, that should help get a Jihad going ;-) ) As noted, the 20 mA current limit is a stress rating under absolute maximum ratings and doesn't say anything about whether the IC will function as intended. I can assure you that, in SOME cases, using a simple series resistor and a higher input voltage into a PC pin will definitely cause indeterminate occasional program malfunction in a 16F84-04P. Guess how I know. (It was a simple "RS232" receive application). I can be fairly certain that it will also happen on most other PICs as well. Injecting clamping current into the PIC substrate using the protection diodes produces voltages and currents in the PIC where they may not be expected during normal operation and any operating failures should not be unexpected. I can also report that using a series string of 2 x 10k resistors from an input voltage to a PIC pin and clamping the middle point of the two resistors to ground and Vcc with 2 reverse biased small signal (1N9148) diodes results in good operation for the applications I have tried it in :-). I suspect that JUST raising the PIC pin voltage to 0.6 volts this way is liable to be safe in almost every case but, of course, it also risks exceeding spec by a small margin and one could not complain if this sometimes caused problems. As noted, use of a 5.1v zener is not a guaranteed method - but not just because the zener is 5.1v. A zener has a very "soft" knee and its voltage will rise substantially with increasing current A zener is typically rated at 10 mA and will have a higher voltage at higher current. The "ideal" safe clamp is a pair of normally reverse biased schottky diodes from PIC pin to Vcc and ground. These are relatively expensive compared to other solutions but cheap compared to malfunction in most cases. Be aware that an external voltage clamped to supply with diodes (whether external Schottky, silicon or PIC internal clamp diodes can "pump up" the PIC Vcc rail if the PIC and associated circuitry draws less than the clamped current and the power supply has no provision for clamping over-voltage. This would be an unusual situation but in some cases could lead to circuit destruction. . Russell McMahon apptech@clear.net.nz -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics