28.2 Overview
The Analog Comparator (AC) compares the voltage levels on two inputs and gives a digital output based on this comparison. The AC can be configured to generate interrupt requests and/or events upon several different combinations of input change.
The dynamic behavior of the AC can be adjusted by a hysteresis feature. The hysteresis can be customized to optimize the operation for each application.
The input selection includes analog port pins and internal reference voltage. The analog comparator output state can also be output on a pin for use by external devices.
An AC has one positive input and one negative input. The positive input source is one of the analog input pins. The negative input is chosen either from analog input pins or from internal inputs, such as an internal voltage reference.
The digital output from the comparator is ‘1
’ when the
difference between the positive and the negative input voltage is positive, and
‘0
’ otherwise.