AVR Tutorials
The Best AVR Microcontroller Tutorials on the Web

AVR Microcontroller Analog Comparator

What is an analog comparator?


An analog comparator is a device that compares two (2) analog values and indicate which is greater. In electronics it is basically an amplifier without feedback and thus very high gain, as shown below. When the positive input (+) is greater the output voltage is saturated to its positive supply (logic 1), otherwise the output is saturated to is negative supply ( logic 0).

That is: "Vout = logic 1" when "Vin0 > Vin1" and "Vout = logic 0" when "Vin0 < Vin1".


Analog Comparator Microcontroller


The AVR ATMega8515 Analog Comparator


The figure below gives the block diagram for the Analog Comparator of the AVR ATMega8515 Microcontroller. For an explanation of the operation of this device consult the Analog Comparator section of the microconroller's datasheet.



ATMega8515 Analog Comparator



ACSR - Analog Comparator Control and Status Register
ACSR Register

The ACSR for the ATMega8515 micocontroller is an 8-bit regiser which contains configuration bits for the microcontroller Analog Comparator. For an explanation of each bit contained in the ACSR consult the the Analog Comparator section of the microconroller's datasheet.