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?
no
28 ADCON2 = %10000010 ' Set PORTB analog and right justify result
will not set portb analog , and changes adc clock to fosc/32 which contradicts
Define ADC_CLOCK 3 ' Set clock source (3=rc)


ADCIN 0, adval ' Read channel 0 to adval
ano is porta.1 is this what you mean if so then set adcon1 = %00000001