Download Print this page
Atmel AVR128 Application Note

Atmel AVR128 Application Note

On-chip analog comparator

Advertisement

Quick Links

AVR128: Setup and Use of the AVR Analog

Introduction

This application note serves as an example on how to set up and use the
®
®
Atmel
AVR
On-chip Analog Comparator. The following program examples
are given in the assembly file "avr200.asm":
Detect a positive edge on the comparator output by polling the ACO-
bit in the Analog Comparator Control and Status Register – ACSR.
Detect a positive edge on the comparator output by polling the Analog
Comparator Interrupt Flag – ACI in ACSR.
Initialize interrupt on comparator output toggle. An interrupt routine
which increments a 16-bit counter each time it is executed is given as
an example.
Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016
AVR 8-bit Microcontrollers
Comparator
APPLICATION NOTE

Advertisement

loading

Summary of Contents for Atmel AVR128

  • Page 1: Introduction

    AVR 8-bit Microcontrollers AVR128: Setup and Use of the AVR Analog Comparator APPLICATION NOTE Introduction This application note serves as an example on how to set up and use the ® ® Atmel On-chip Analog Comparator. The following program examples are given in the assembly file “avr200.asm”:...
  • Page 2: Table Of Contents

    1. Detecting a Positive Edge By Polling ACO..............3 2. Detecting a Positive Edge by Polling ACI..............4 3. Using the Analog Comparator Interrupt..............6 4. Revision History......................7 Atmel AVR128: Setup and Use of the AVR Analog Comparator [APPLICATION NOTE] Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016...
  • Page 3: Detecting A Positive Edge By Polling Aco

    Response Time (Cycles) 3 - 5 Initialization Time (Cycles) Register Usage Low Registers: None High Registers: None Pointers: None Interrupts Usage None Peripherals Usage Analog Comparator Atmel AVR128: Setup and Use of the AVR Analog Comparator [APPLICATION NOTE] Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016...
  • Page 4: Detecting A Positive Edge By Polling Aci

    Table 2-1. ACI Polling Performance Figures Parameter Value Code Size (Words) Initialization Time (Cycles) Response Time (Cycles) 3 - 5 Register Usage Low Registers: None High Registers: None Pointers: None Atmel AVR128: Setup and Use of the AVR Analog Comparator [APPLICATION NOTE] Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016...
  • Page 5 Parameter Value Interrupts Usage None Peripherals Usage Analog Comparator Atmel AVR128: Setup and Use of the AVR Analog Comparator [APPLICATION NOTE] Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016...
  • Page 6: Using The Analog Comparator Interrupt

    Table 3-1. Analog Comparator Interrupt Enable Performance Figures Parameter Value Code Size (Words) Execution Time (Cycles) Register Usage Low Registers: None High Registers: 1 Pointers: None Interrupts Usage None Peripherals Usage Analog Comparator Atmel AVR128: Setup and Use of the AVR Analog Comparator [APPLICATION NOTE] Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016...
  • Page 7: Revision History

    Revision History Doc. Rev. Date Comments 0934C 07/2016 New template 0934B 05/2002 0934A Initial document release. Atmel AVR128: Setup and Use of the AVR Analog Comparator [APPLICATION NOTE] Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016...
  • Page 8 DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND...