What I've done is power a LP2980-4.5 LDO regulator from a PIC pin and read its output with an ADC pin. As long as the PIC supply is >4.5 the ADC reading is less than MAX. Once the PIC supply drops to 4.5 or lower the ADC reading is MAX.

I use this with BR type coin cells, which have a fairly flat discharge curve and then drop rapidly, to signal when the batteries need replacing.