My understanding of an analog comparator is that you have a fixed reference voltage applied to one input and an AC signal to the other input, when the signal's voltage > reference voltage, the output of the comparator will be logic high, else logic low.
I was looking at the input stage of one of the MCU's analog comparators. Signal applied at AIN0, reference is applied at AIN1, pin5 toggles between Vcc and 0 to shift AIN1 by +- ~0.04V.
But what I don't understand is it has a 100k resistor (R2) connecting both inputs. What's the purpose of that? Wouldn't that make the reference vary as well?
Any suggestions are greatly appreciated, thanks.