Hi all!
Okay so before some one tells me to read the manual the manual only gives a few "guidelines" and nothing in depth. For example it says the ADC_CLOCK can be a value of 2-5 bits and the default value is 3. It does not say what values 2, 4, and 5 are for. Now I have an 18F1320 and wish to use port b.0 as the input from a sensor putting out 0-5 volts. My best guess is this is what the code should look like?

21 Define ADC_BITS 10 ' Set number of bits in result
22 Define ADC_CLOCK 3 ' Set clock source (3=rc)
23 Define ADC_SAMPLEUS 50 ' Set sampling time in uS
24
25 adval Var word ' Create adval to store result
26
27 TRISB = %11111111 ' Set PORTB to all input
28 ADCON2 = %10000010 ' Set PORTB analog and right justify result
30 mainloop:
31
32
33 ADCIN 0, adval ' Read channel 0 to adval

The other part of this is that the ICD uses port b.1 and port b.4 so would the TRISB statement mess up the IDC?

Thanks in advance for any and all who wish to help educate me.

Best, Ed