May be the ADCON1=6 must be =7 ?

I am not familiar with the A version of the 877. Steve?

Ioannis