First - if you read the datasheet, the 16F877A is not rated to run below 4.0V unless you choose the "LF" version.
Second, why do you need a voltage regulator at all? If you are running off batteries, and the battery voltage doesn't go above 5.5V, then using a voltage regulator will DECREASE battery life.
If you want to have the longest battery life AND be able to measure battery voltage, then connect VDD directly to the battery. No voltage regulator.
Connect your 2.8V signal to AN0 and ADCON1 to %01001110 . Read AN0. If it is above 716, then your battery is below 4V.




Bookmarks