Quote Originally Posted by lerameur View Post
HI,
I dont have to use more then one for this project, But I had this problem before and did not persue into it, so I asked the question just on the way. I read on a site, just like you said, adding a capacitor to the output of the sensor or battery will help. The thing I dont know why it works, I tried these two program they both works, just dont know why the program with just one ADCON0 works

Two Adcon
ADCON0 = %10000001 ' Configure and turn on A/D Module
ADCIN porta.0, input1
pause 50

ADCON0 = %10001001 ' Configure and turn on A/D Module
ADCIN porta.1, input2
pause 50


One ADCON0
ADCON0 = %10000001 ' Configure and turn on A/D Module
ADCIN porta.0, input1
ADCIN porta.1, input2
pause 50

See they both work, but I did not configure port A.1.. why ?
You're using the ADCIN command. Ya think maybe PBP sets it up for ya?
I know the PBP manual doesn't explicitly say it that it sets it up for you, but it does say that ADCIN reads the 'channel' and also says all you have to do is set the required pins to inputs, it doesn't really say to select the channel you want to sample... I suppose the manual could be a little more informative in this respect.
I just looked at the ADC section of the 'F88. It's a bit different than some of the other PICs. Not only do you have to TRIS the pins you want to inputs, but you also have to enable the A/D in the ANSEL register. I don't know if PBP does this for you or not.
You can easily check for that in your .lst file after compiling the program. Just put a comment around the line you're wanting to check and search for that comment in the .lst file. Should make it a bit easier for ya...