The output pins were floating, and I used my dMM to get the readings from them since I don't have a logic probe. And the Input Pin wasn't the pin that was fluctuating, the output ones were, just for clarification. But I had a lot of other devices on my board at the time, so what I did was I cleared out everything but the 16f877 and then it seemed to work ok. I guess the problem was noise (not too sure how it works)??? Anyway, thanks for all your help. Jai Quoting Olin Lathrop : > > Have a question about the A/D on the 16f877. I gave my first shot on > coding a > > simple converter that uses a divider from a pot as an input to one of > the > > pins. Now I'm pretty sure I have my code set right, because when I read > the > > results (I did about 5 test cases), they all seem pretty accurate, > except with > > a few problems. > > > > Some of the pins had constantly a constantly changing voltage that was > > registering on my DMM. Most of the pins would be stable, either ~0 or > 5.2V, > > but some of them, each on different tests, would be fluctuating, > sometimes > > from 2.5-2.9V, and sometimes other values. Is this normal? Does the fact > that > > my program keeps going in a loop affect this (even though I'm reading > the Go/! > > Done flag to check when it's done)? And it seems to be different pins > each > > time, so there doesn't appear to be a definite pattern. On some > readings, all > > the pins are perfect. Any ideas? > > This depends on your external circuit. How are the pins being driven? If > they are floating, then you could get the symptom you describe. Microchip > specifies the source impedence driving an A/D pin should not exceed > 10Kohms. > > Note that as the A/D is switched between channels, you actually have a > charge pump from one channel to the next. A newly selected channel is > connected to the same internal capacitor that the previous channel was > connected to. This actually creates an equivalent resistance from the > previous channel voltage to the current channel pin. This equivalent > resistance is proportional to the period between selections of the same > channel. None of this should matter, however, if each channel's source > impedence is 10Kohms or less and you are waiting the proper acquisition > time. > > > ***************************************************************** > 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 > ---------------------------------------- This mail sent through www.mywaterloo.ca -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body