In theory, you shouldn't take care of ADCONx too much when using ADCIN as the DEFINEs should take care of it for you. The only one thing you might need to set is the Right-Justified results when you use 10Bits resolution. This said, i'm not an ADCIN user.
try those settings...
Code:
Define OSC 4
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 uSec
CMCON = 7 ' Disable analog comparator
ANSEL = %01000000 ' set AN6 (RB7) as analog, others to digital
ADCON1.7 = 1 ' Right justified results... duh... really needed in 8 bits???
adval VAR BYTE
PAUSE 500 ' lcd settle time
loop:
ADCIN 6, adval ' Read channel 6 (RB7)
Lcdout $fe, 1,"Value: ", DEC adval ' Clear the LCD and show result
Pause 250 ' wait a litlle bit
Goto loop ' Do it forever
Notice that your analog source impedance must be lower than 10K
Bookmarks