I chose to use an STM8L101F3P6 low power microcontroller for a sensor node. This microcontroller, however, lacks an ADC and instead implements 2 comparator units with a block diagram presented on its reference manual :
I was going to use the comparators and a combination of zeners/voltage-references to implement a basic battery level monitor. However to my surprise, the reference pin (the "-" pin) of comparators are not available on some packages as an IO, and instead, is permanently connected to ground; so basically, as much as I understand, the comparator is reduced to a crude digital pin which activates on a non-zero signal!
And in the register description we can see:
- Is there any option to use this ground-referenced comparators to measure battery level?
- Is there any benefit at all to use a comparator with one leg referenced to ground, and the other leg available only within positive voltage range?