Your ANSEL setting is wrong... RB7 is AN6 and must be set to 1 in ANSEL bit 6.

Seems you revert bit order or something like that.

ANSEL=%76543210