2012-01-14 12:56 PM
Hello,
STM8L has 2 comparators: COMP1and COMP2. COMP2 is very useful as it has an ability to get any desired threshold: either internal or external. The only threshold for COMP1 is internal Vref, so I'm wondering what can be it used for ? I'm aware of window comparator ability with both of them, but can somebody here think about application of only COMP1? What COMP1 can do, can do also a digital port, having also Schmitt trigger option.Any idea will be highly appreciated,E.L.2012-02-17 05:36 AM
I am using this internal comparator for low battery detection and it works very well. You can use two external high value resistors to set the threshold and connect the other input of the comparator internally to the vref.
2012-02-25 08:43 AM
Hi Patrick,
IMHO, for battery monitoring it is better to use internal PVD- I/O pin is not required. You have to ''pay'' with current consumption of internal Vref(1.2uA), like in case of COMP1, and of PVD itself (0.2uA).The only possible disadvantage of the method that you have to chose a hysteresys only from among existing 8, i.e., if you have your own,you can't.2012-02-27 06:32 AM
Hi
The method you describe monitors the VDD of the micro. In my system I have a regulator between the battery and the micro so COMP1 monitors the battery voltage. If I use the system you describe the PVD interrupt will occur only when the battery voltage collapses and the regulator comes out of regulation which is not much use in my system. I need to inform the user to change the batteries when the minimum voltage per cell is reached, but with the system still fully operational.2012-03-06 10:32 AM