Comparator Example Project
Last modified by Microchip on 2023/11/09 09:02
Analog Comparator and Voltage Reference Example
This hands-on project demonstrates a simple example of an analog comparator and reference voltage:
Bandgap reference as positive input (1.1V) and AIN1 as negative input. By wiring AIN1 (PD7) to Switch (SW0, PB7), which turns on to high (5 V) and off to GND, and wiring ACO (PE0) to PB5 (LED0), the output of the comparator (ACO, PE0) can be observed by checking the LED’s status.
- Wiring: PD7 (AIN1) | PB7 (SW0; PE0 (ACO) | PB5 (LED0)
Xplained Board:
Select File > New > Atmel Start Project.
Create new project.
Add Software Components and select AC.
Setup AC.
Pin Configurator view.
Setup Clock Configurator.
Generate Project.
View Project.
In Main.c, add keyboard scan and LED driver.
Build and run.