>This is a slightly different topic, >but one I had run into before: > >How would you use a PIC's A/D to >measure its own supply voltage? There is a sneaky way to do this. Set the ADC to use the internal reference (i.e. the PIC supply) as the ADC reference voltage. Now have one of the normal input pins connected to a suitable reference diode, such as one of the 2.5V ones available from many sources. Now read the ADC channel connected to the reference diode. The resulting value you get is an inverse ratio between the supply voltage and the reference diode - i.e. as the supply voltage falls the diode will read a higher value. You can then use some form of math, probably a table lookup, or you could calculate it depending on how much spare processor time you have, to get the true supply voltage value. There is another trick to this as well, you could use another pin on the pic to turn the supply to the diode off and on if you need a really miserly current draw from batteries for example. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist