Issue on Comparators inputs on STM32L031xx
Hello,
On a low power application, using STM32L031x, I want to monitor a 3-level signal (24V, 5V, 0V) using COMP1 and COMP2.
- COMP1IN+ and COMP2IN+ connected to a voltage divider with two resistors (2M-220K)
- COMP1IN- connected to internal VREF, so COMP1 capture 24V-5V transition (rising and falling edges)
- COMP2IN- connected to internal VREF/4, so COMP2 capture 5V-0V transition (rising and falling edges)
Comparator positive input are configured by software on analog input mode, No pull-up, pull-down
When the 3-level signal under test goes to 0V, I measure about 400mV instead of 0V on COMPxIN+ (so COMP2 never toggle): is there a leakage current (it's about 400mV/200K=2uA) from comparator inputs that alter the external voltage divider? Maybe from internal pullup?
Or there is a mistake/inaccuracy on comparator and/or GPIO software configuration?
Thanks for your support!
Massimo
