1. Could you send us the settings of the ADCONx registers? 2. Did you feed the AN0 with a voltage between 0 and 5 V from a source with an internal resistance not higher than 10k? 3. Did you consider both ADRESH and ADRESL during evaluation of the result? 4. Did you provide enough sampling time? 5. Did you check the GO_DONE bit to establish the conversion is done? By my opinion the A/D modul works correctly. However, external parts can be responsible for a portion of nonlinearity. Regards, Imre On Sat, 10 Mar 2001, Jeethu Rao wrote: > I just wanted to test the accuracy of the PIC16f877 ADC. So, I wrote a simple routine to perform a A/D convertion and to read the ADRESH and ADRESL regs, convert them to ASCII and then transmit them through the UART to a terminal Program on a PC. I used only the AN0 input. And I did'nt opt for external voltage refs.And Finally te results were right justified > > But I was getting readings between 00 and 12 (Decimal). Is this normal or Is it because I'm not using External Refs ? I connected the AN0 pin to Ground and I get a perfect 00 on the ADRESL Reg. The track connected to the AN0 pin is quite long. So is it because of some stray capacitance or RF Interferance ? > > Can someone suggest a fix for this problem ? > > Jeethu Rao > > -- > 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 > > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.