> 1. I select the channel. > > 2. Then I am allow for an acquisition time of 22 us (the datasheet > mentions 20 us for a 10 K source) > > 3. Then I start the conversion (set the 'GO' bit) > > 4. Once the conversion is over, I wait _at least_ 11 us (the > datasheet also mentions that a delay of 2 x Tad needs to be > honoured here) There is no need to wait after the conversion is over, since it's over. The best way to wait for the conversion to complete is to monitor the GO/DONE bit in ADCON0, or the ADIF flag in PIR1. When reading multiple channels, I usually switch to the next channel as soon as a conversion completes, then get the ADRES values, etc. > 5. Go back to step 1, but with the next channel. > > > Now my problem is the following: I just set one of the three channels > (let's say RA0) to a 4V source, and leave the other two (RA1 and RA3 > in this example) unused (i.e. just connected to GND through the 10K > resistor). The first channel (4 V) is read OK, but for the next one > I read I get a non-zero value (about $008). Looks like the S & H > capacitor is not completely discharged. > > I've checked the followin: > > - Set RA1 to 4 V instead of RA0. In this case it is RA3 the one > that reads a non-zero value. > > - Replace the 10K resistor with a 1K resistor; in this case I > measure about $004 instead of $008 in the 'next' channel. > > > Does someone have a clue? What's happening here? It seems like you are doing everything right. Could the unused inputs be picking up noise? Are you really sure the 22uS wait is really 22uS? It seems very suspicious that you were still reading 4 with a 1K resistor. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body