> -----Original Message----- > From: Simon Nield [SMTP:simon.nield@QUANTEL.COM] > Sent: Wednesday, November 29, 2000 2:49 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: Low Battery Sensing > > mike: > >You'd still need a micropower reference though, you couldn't use Vcc as a > >reference! > > the reference need not be micropower... if you are not too bothered with > the absolute accuracy then > a standard diode & resistor in series may do the trick - you do need > another pin to switch power to > the cheapo reference, but it does have the advantage of not needing any > fancy components. > > connect a resistor to an output pin. > connect the other end of that resistor to one of the analog inputs. > connect a diode from the analog input to ground (anode to input) > > pull the output pin high to enable the reference. > if the analog reading > some number then the power rail is getting low. > > an led might make a good choice of diode, and you might just have one > hooked up exactly how you > would like already, in which case it's only cost you the analog input > pin... > > > Regards, > Simon > Good idea. Maybe you could even use the classic single slope software ADC. An R-C network from Vcc to 0v, with the midpoint going to a pin. Ground the pin for a couple of ms, tristate the pin and count how long it takes for the pin to toggle. Although, the switching point of the port pin is related to supply voltage, it's definately not linear* so this may be workable. Once the cap is fully charged the only current will be cap leakage and the input current of the port pin. Regards Mike * just been playing with an AN512 circuit, and tried it without a reference resistor. The resulting circuit was horribly sensitive to supply changes. -- 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