Hello,
I might suggest using a couple of ATD channels. One of the channels could be used to sense the presence of external DC voltage, and the other to measure the battery voltage. The connection details will depend on whether the MC13213 is supplied via a regulator, or not. Suitable input voltage dividers will probably be required.
For the special case where the unregulated battery voltage is directly used as Vdd for the device, you will have to indirectly measure the battery voltage, since Vdd is the reference for the ATD. You will need an external voltage reference device, perhaps 1.2 volts, and measure its voltage (relative to Vdd = battery). Since you will probably need low power, except when a measurement is actually occurring, the external reference would be driven by an additional GP output from the MCU.
Regards,
Mac