You have all the inputs as digital inputs ANSEL = $00 Shouldn't A0 be an analogue input?

Adrian