Your battery positive will be connected thru a 1K resistor to the adc, you may need a divider if v battery is greater than VDD? Then you take a normal acin reading and determine what number between 0 - 1024
equals a low battery. If an < x then low_bat. else..
To start
Fixed voltage reference FVR page 137
ADCIN will take care of the ADCON0 register
FVRCON = %10000001 ' vref enabled 1.024v
ADCON1 = %11110011 'Right just,FRC,+vref connected to FVR
Bookmarks