I am going to use a single comparator from the PIC18f. One of the inputs is also used for the ADC external reference. Does that mean I cannot set the reference of the ADC?
You could use mode 011 (see figure 22-1) and ignore what C1 does, put your pot on C2. You loose the RA0 pin in digital mode, but it still works fine as an analog pin. You'll need to as analog to use the D2A anyway.