OK Usual disclaimer, this is an untested circuit but... Take an N-type logic level FET. Connect the gate to PIC VDD and the source to the measuring pin. Put the capacitor between the pin and ground, the resistor between the drain and the voltage. Drive the input pin high and the FET turns off. No drain at all. Drive the pin low then float it and measure the charge time. Obviously the pin will not rise above the Vdd-FET Vth but this should not be a problem. Oliver. ----- Original Message ----- From: "Roman Black" To: Sent: 12 January 2001 15:00 Subject: Re: [PIC]: Unknown Voltage on PIC pin. > 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 > > > -- 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