
Originally Posted by
Darrel Taylor
For 8 bit, you should Left justify the results.
ADCON1.7 = 0
<br>
i have this
Code:
' Define ADCIN parameters
DEFINE ADC_BITS 8 'Set number of bits in result
DEFINE ADC_CLOCK 3 'Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 'Set sampling time in uS
CMCON = 7 'PortA = digital I/O
ANSEL = %00010000 'Will set RA4 as analog and all others as digital
ADCON0 = %11100001 'Configure and turn on A/D Module
ADCON1 = %00000010 'Set PORTA analog and RIGHT justify result
and modify the result:
adval = adval*2/100
and at 0 volt show value: 0 and at 5 volt show value:5
Bookmarks