OK. So I went back to the breadboard and started trying different pins. By a fluke (actually by mistake) I got it working when I used "ADCIN 1, adcVal" with the voltage input attached to PORTA.0 (NOT PORTA.1!!!). So what's going on here? Almost all of the examples of ADCIN I have seen use channel 0 and connect input to PORTA.0. Also, the first use of ADCIN always gives a 0. After that it seems to work fine. Does this make sense to anybody?