If I am setting up a 16F819 chip to read only three of the analog pins on portA how do I select the Channel in (ADCIN channel, var)? In my application, see code below, I am using pins AN0,AN1,and, AN3 as analog and the rest of portA as digital.
Basically my question is does the channel increment as if every pin in portA is analog and thus AN3 would be channel 3? or would it be channel 2 in this application since AN2 is set up as digital?
trisa=%10001011
DEFINE ADC_BITS 16 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (rc = 3)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in microseconds
ADCON1 = %10000100 ' PORTA AN0,AN1,AN3 are analog
ADCIN 3, variable
Thanks for any help
Bookmarks