Microchip logo
  • All
  • Products
  • Documents
  • Applications Notes

8-Bit MCUs

What is a Comparator?

A comparator simply turns an analog voltage level into a digital low or high output. Microchip offers both standalone and on-chip comparators. PIC® and AVR® microcontrollers have on-chip comparators that are integrated into the microcontroller, which provides flexibility, intelligent control, and lower power consumption to your design.

Why Use a Comparator?

The on-chip comparator is a combination of intelligence and flexibility. It also can work independently from the MCU’s core, which adds low-power options to your design. Here are some benefits of using an on-chip comparator:

  • High Speed Response with Low Power Consumption
    Offering a fast response time along with low power consumption, the on-chip comparators on 8-bit PIC and AVR MCUs provide reliable feedback about the signal input of your design.

  • Easy-to-Use Intelligence
    The comparator provides multiple dynamic voltage references such as the supply voltage (VDD), Fixed Voltage Reference (FVR), and output from the internal Digital-to-Analog Converter (DAC). You can use the DAC to set the voltage reference at any level within the range of your supply voltage and change the value on the fly. If your input signal has a lot of noise, you can configure the Comparator to use hysteresis, or you can choose not to use hysteresis to achieve a more sensitive response.

  • Flexible Outputs
    The comparator’s outputs can be programmed to perform a number of functions. They can be used to trigger an interrupt, as input signals for other peripherals, or to connect to the Configurable Logic Cell (CLC) on a PIC MCU or the Event System on an AVR MCU. They can also output externally to an I/O pin.

  • Core-Indpendent Operation
    The on-chip comparator can operate completely independently from the core for power savings. The core can be in sleep mode when the comparator is operating and be awakened by an interrupt. The internal routing capability provided by the CLC and Event System enables the core to stay in sleep mode all the time, which is a huge benefit for battery-powered applications.

Comparator Videos