Atmel AVR128 Скачать руководство пользователя страница 8

Atmel Corporation

1600 Technology Drive, San Jose, CA 95110 USA

T:

 (+1)(408) 441.0311

F:

 (+1)(408) 436.4200

|

www.atmel.com

©

 2016 Atmel Corporation. / Rev.: Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016

Atmel

®

, Atmel logo and combinations thereof, Enabling Unlimited Possibilities

®

, AVR

®

 and others are registered trademarks or trademarks of Atmel Corporation in

U.S. and other countries. Other terms and product names may be trademarks of others.

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
CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED
OR  STATUTORY  WARRANTY  RELATING  TO  ITS  PRODUCTS  INCLUDING,  BUT  NOT  LIMITED  TO,  THE  IMPLIED  WARRANTY  OF  MERCHANTABILITY,
FITNESS  FOR  A  PARTICULAR  PURPOSE,  OR  NON-INFRINGEMENT.  IN  NO  EVENT  SHALL  ATMEL  BE  LIABLE  FOR  ANY  DIRECT,  INDIRECT,
CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS
INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this
document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to
update  the  information  contained  herein.  Unless  specifically  provided  otherwise,  Atmel  products  are  not  suitable  for,  and  shall  not  be  used  in,  automotive
applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.

SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any
applications where the failure of such products would reasonably be expected to result in significant personal injury or death (“Safety-Critical Applications”) without
an  Atmel  officer's  specific  written  consent.  Safety-Critical  Applications  include,  without  limitation,  life  support  devices  and  systems,  equipment  or  systems  for  the
operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments
unless  specifically  designated  by  Atmel  as  military-grade.  Atmel  products  are  not  designed  nor  intended  for  use  in  automotive  applications  unless  specifically
designated by Atmel as automotive-grade.

Содержание AVR128

Страница 1: ...00 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 Atme...

Страница 2: ...CO 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 2 ...

Страница 3: ...ng a short pulse will increase Such code might be time out if no edge occurs within a specific period The procedure for detection is as follows 1 If output is high wait for output to go low 2 Wait until output goes high Figure 1 1 ACO Polling Flow Chart START N Y DONE ACO 0 N Y ACO 1 Table 1 1 ACO Polling Performance Figures Parameter Value Code Size Words 4 Response Time Cycles 3 5 Initialization...

Страница 4: ...k for has occurred since the last ACI Reset In this application note positive edge detection by polling ACI is implemented according to the following procedure Setup 1 Set ACIS0 and ACIS1 1 Polling 1 Clear the ACI bit by writing a logical 1 to it 2 Wait until ACI goes high Figure 2 1 ACI Polling Flow Chart SETUP DONE N Y ACO 1 ACIS1 ACIS0 11 CLEAR ACI Table 2 1 ACI Polling Performance Figures Para...

Страница 5: ...nterrupts 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 5 ...

Страница 6: ... selects interrupt on toggle 2 Enable Global Interrupts 3 Enable the Analog Comparator Interrupt by setting the ACIE bit in ACSR Note that since the ACSR Register is one of the lower 32 I O registers the SBI instruction can be used to set clear and test bits Table 3 1 Analog Comparator Interrupt Enable Performance Figures Parameter Value Code Size Words 4 Execution Time Cycles 5 Register Usage Low...

Страница 7: ...ents 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 7 ...

Страница 8: ...R INABILITY TO USE THIS DOCUMENT EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice Atmel does not make any commitment to update the information contain...

Отзывы: