SAM3S8/SD8 Software Package: ACC IRQ Example

SAM3S8/SD8 Software Package 1.2

# 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 package can be used with sam3s-ek2. The DAC0 uses 3.3v as reference voltage so that make sure to close JP2 on ADVREF and 3V3 on the board.

## Description

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

The output voltage of DAC0 is ranged from (1/6)*ADVREF to (5/6)*ADVREF,and the input voltage of AD5 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. Please refer to the SAM-BA User Guide, the GNU-Based Software Development application note or to the IAR EWARM User and reference guides, depending on your chosen solution.
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 AD5 by adjusting VR1 to see what comparison event happen.

## References

- acc_irq/main.c
- dacc.h
- acc.h
- adc.h

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines