Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
acc_irq ACC IRQ Example

Purpose

The acc_irq example demonstrates how to use the ACC peripheral to detect comparison event on the input pair.

Requirements

This example can be used on the following boards:

  • SAMV71-Xplained-Ultra
  • SAME70-Xplained-Pro

Description

The acc_irq is aimed to demonstrate the usage of ACC peripheral with interrupt support. The DAC0 and AD0 are selected as two inputs. The user can change the output voltage of DAC0 and change the voltage on AD0.

The output voltage of DAC0 is ranged from (1/6)*ADVREF to (5/6)*ADVREF,and the input voltage of AD0 is ranged from 0 to ADVREF.

The comparison event would be generated if the voltage of one input is changed across the voltage of the other input. Both bigger and less events could be triggered by default.

Usage

  1. Build the program and download it inside the evaluation board.
  2. On the computer, open and configure a terminal application (e.g. HyperTerminal on Microsoft Windows) with these settings:
    • 115200 bauds
    • 8 bits of data
    • No parity
    • 1 stop bit
    • No flow control
  3. In the terminal window, the following text should appear (values depend on the board and chip used):
    * -- ACC IRQ Example xxx --
    * -- xxxxxx-xx
    * -- Compiled: xxx xx xxxx xx:xx:xx --
    * -- Menu Choices for this example--
    * -- s: Set new DAC0 output voltage.--
    * -- v: Get voltage on potentiometer.--
    * -- m: Display this menu again.--
    *
  4. Input command according to the menu.
  5. Change voltage on AD0 to see what comparison event happen.