I think I got it working. I swapped to another 16F877 and made sure the connection to AN0 was correct and it started to work properly. It gives repeatable results that match my calculated values. I'd like to thank everyone for your help, learned a couple of new things. David -- 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