2 Overview
Figure 2-1 shows the block diagram of the analog comparator in tinyAVR® 0- and 1-series, megaAVR® 0-series and AVR® Dx devices. It compares the voltage levels on two inputs and gives a digital output based on this comparison.
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 internally generated inputs.
The comparator has one positive input and one negative input. The positive
input may be chosen from a selection of analog input pins. The negative input may be
chosen from a selection of analog input pins or internal inputs, such as a band gap
reference voltage (DACREF). The digital output from the comparator is
‘1
’ when the difference between the positive and the negative
voltage is positive, and ‘0
’ otherwise.
The AC can be configured to generate interrupt requests and/or events upon several different combinations of input change. The AC output can be delivered on an output pin, to be used by external devices.