Hi,
The way you have CMCON configured the comparators are set up like this:
Name:  CMCON_101.JPG
Views: 1309
Size:  38.0 KB

You have your inputs connected to RA0 and RA2. CMCON.7, which you've aliased is the output of comparator 2...

In order to use the internal reference voltage module you must set the comparator mode to 110 instead of 101. Further on, you seem to think that RA2 is the reference input but it's not. It can optionally be the reference output. From the datasheet:
The output of the reference generator may be connected to the RA2/AN2/VREF-/CVREF pin. This can be used as a simple D/A function by the user if a very highimpedance load is used. The primary purpose of this function is to provide a test path for testing the reference generator function.
Finally, I can't seem to find a register called VRCON in the datasheet, it's CVRCON.

You need to decide what to actually do, either use the internal reference and set it up correctly or use external "reference" and connect it to correct pins.

/Henrik.