I've looked around and found a bit of information regarding attaching a 3.7V lithium battery to the BBB (Beaglebone Black) but I haven't found an exact answer to what I am looking for. I understand that the battery voltage, when connected, can't be monitored to determine how much life is left that's fine. However, I would like to be able to tell when the system switches from 5V barrel jack connector to the 3.7V battery backup.
I want to implement some emergency shutdown features on my system in the event that communications and/or power are lost. I was going to trigger this based on when the Beaglebone switched over to battery, with some timer giving the main power time to come back online, but I can't find information on how to determine when the system makes the switch. Is there an I/O pin or an internal reading that I can check to determine when the BBB switched to battery power?
If I can't check it internally does anyone know what pin I could tap for a voltage divider into the ADC to measure this? My guess would be VDD_5V (P9-5) as the system would no longer be able to attain 5V and would dip to whatever the battery voltage is.