That's because you forgot about initialising the ANSEL register. see Bruce's example.