I am building a system that operates on batteries. The system is a low power RF device with a 8051 (With ADC and GPIO) that uses a 3V battery to give it power.
The problem is that I need to have a way to inform the base that the battery is lower then a specified value say 2.1V.
I was thinking in using the ADC but the reference is the VCC. So there goes the idea.
Is there a way with external circuit to generate a interruption on the micro or to have another reference for the ADC?
Is there any chip that does the battery management and when the batery voltage is lower then a value it activates a digital output?
I saw this post but I was lokking for a solution based on the microcontroler or on a external chip that does it all.
you can use any voltage reference ics from Microchip/Analog/TI. Or you can use on chip ADC (If available on your IC) itself very easily to detect low voltage. You can google "Voltage Reference IC".
- - - Updated - - -
I was thinking in using the ADC but the reference is the VCC
You can use voltage divider and connect it to any Analog Pin as a reference. Also, There may be 2 to 3 fixed voltage reference available. But, I don't know about your controller IC. See the datasheet under the heading Fixed Voltage Reference (FVR). But, if you require very accurate voltage (as you said 2.1v) reference it will only be better to use external voltage ICs.
comparator is ur best and cost effective bet. U can use zener with some 1V reference and voltage divider at + input. Then if input goes above 1V, the output will be high, else low.