M. Adam Davis wrote: > > Use a resistor, cap, and zener (no a/d): > > 0-30vdc+-----/\/\/---+----------+-------PIC I/O > | | > | | > +--|>|--+ +--||--+ > | | > | | > | | > Gnd----------+-----------+ > > To take a reading, drop the pin to gnd for a few ms, then float the pin > and check it to see when it goes high. Put it on an interrupt pin or > interrupt on change and you can just use a timer. Put it on the CCP pin > in capture mode and you'll get the interrupt and the exact time when the > pin changes. > > If the voltage is over 5 volts then there will be some current draw, but > only very little (much less than a regular voltage divider) Sorry no prize! ;o) It doesn't totally switch off. And the current draw will be identical to the 2R voltage divider, as at 30v the top resistor will still drop 30v-5v and I =E/R I do agree that at lower voltages approaching 5v it will draw a bit less current though. -Roman -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads