See what happens if you change ADCON1 from 11001010 to 00001010.

with bit 7 you're right-justifying in the ADCON1 statement (used for 10-bit word), but your DEFINE is for 8 bits (which by default you'll left-justify)... there might be a clash there... and what does bit 6 do? I've not got the Datasheet for your PIC, but in the 16 series bit 6 is unused (usually left at zero).

What throws a wobbly is that you say the LCD is displaying correctly. I assume the variable B21 is a BYTE otherwise HPWM might get confused.