Jesse, Put a bridge rectifier in the power line. The no matter what polarity the supply voltage is that gets plugged in, it will be correct in the unit. Someone could even plug in an AC power source and it will be okay. Hook the AC pins of the bridge to the power source (Polarity don't matter), and connect the plus and minus of the bridge to the anode and cathode respectfully of the circuit you want to power. No matter what the polarity of the source, it will work. The only drawback to this is that the power source need to be about 1.4 volts higher than the unit uses. By this I mean lets say your unit is designed to run off of 9VDC. Using the bridge rectifier means you'll have to have at least 10.4 volts available at the power source. But other than that, it works very nicely. I have used this technique many times when I build a piece of equipment that gets used by many people. This way, basically no matter what they plug into the unit, it'll work. Hope this helps. Regards, Jim > Hello all, > > I have a design whereby I want to sense the presence or absence of a > voltage that is well above +5V; maybe up to 15V, say. This voltage > could be negative as well, at least until the user figures out they > have their DC input backwards... > > I also want to use A4 to switch a pfet, and when the pfet is not being > driven (i.e. A4 set to high, i.e. floating) it will be pulled up to 9V > or so through 100K. > > Now reading the absolute max ratings, of course, you can't do either of > these things. Any pin except A4/MCLR is Vdd+0.3V max; A4 is 8.5V max. > > There is another spec that says input clamp current (IIK (VI < 0 or VI > > VDD)) is +-20mA. (This is the 18F1220/1320 datasheet FWIW.) I > presume this doesn't mean the PIC clamps the current to +-20mA... what > does it mean, exactly? > > So, if I current limit to a milliamp or less, maybe even .1mA, am I ok > here? I don't see the harm in forward-biasing the input protect diodes > with a small current, but then again I don't know much about chip > design norms... > > I can add transistor switches etc. if need be, but if the above is > workable it is definitely preferred. > > This is going to be a commercial product, so unfortunately solutions > that "cheat" and will "normally work at least for awhile" aren't going > to cut it... > > Thanks for any tips... > Jesse > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist