Edit: Ignore all the following. You're already using the ADC. Just set GP1 as analog and read it too with the ADC.
If you want to trigger the aux power supply at 17.5V, you know you'll have 1.59V.
The ADC will read 325 with 5V VDD, that's your threshold!
The best would be to use the internal comparator, as ledtester suggested.
The comparator can use the internal reference, which has 2 range modes (Excel table attached), and can be adjusted in 16 steps.
Then you only need to read the comparator output flag. 1=input is lowerthan reference, 0= input is higher, that simple!
It's been a lot since I last played with PICs, but PIC16 peripherals are very easy to set up.
config:
BSF GPIO,1 Set GPIO1 as input
BCF ANSEL,1 Set GPIO1 as analog
MOVLW B'10000010' Enable Vref, set high range, internal vref, 1.56V
MOVFW VRCON
MOVLW B'00000100' Cin- to GPIO1, Cin+ to Vref, Cout pin unused
MOVWF CMCON
scan:
BTFSC CMCON,COUT Test COUT bit
GOTO low_detected If 1, vin is lower than reference (Voltage is dropping)
GOTO scan If 0, vin is higher (All ok), do other checks or keep scanning
Then use a resistor divider R1(10K)+R2(1K) and connect it to RA1.
Over 17.2V, the voltage will exceed 1.56V, and the comparator output will be 0.
When it falls below that, it will trigger the comparator and read 1.
You only need to swap GPIO1 and GPIO3 in your code.