we don't know much about your external analog source but assuming a 10K, the ADC sampling time is way too low. Use my PicMultiCalc to know the right value for your actual setup.
Here if i use 10K, the DEFINEs will be...
Code:
DEFINE ADC_BITS 10 ' ADCIN resolution (Bits)
DEFINE ADC_CLOCK 2 ' ADC clock source (Fosc/32)
DEFINE ADC_SAMPLEUS 11 ' ADC sampling time (uSec)
now...
Code:
MER1=MERITEV1/112
MER1Y=MERITEV1//112
MER1X=(MER1Y*10)/112
MER2=MERITEV2/112
MER2Y=MERITEV2//112
MER2X=(MER1Y*10)/112
to me it's suppose to be MER2Y
i don't see this setting in the datasheet... for now, it make all pins to digital.
i did the test with ADCON1=%10000000
and it works.. well here
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks