Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Analog-to-Digital Converter Interface Example

Purpose

The adcife_example demonstrates how to set up the module and perform conversions.

Requirements

This example can be used on the following boards:

  • SAM4L-EK
  • SAM4L Xplained Pro
  • SAM4L8 Xplained Pro

We select the internal DAC = 826mv and scaled VCC(VCC/10 = 330mv) as positive input to ADCIFE.

Description

This application shows how to use ADCIFE using the several modes: with/without PDC, several types of trigger (Software, Continuous, Internal Timer, etc.),gain selection. The SAM4L controller initialize the ADCIFE and display the converted value in the terminal. Users can also select different modes by configuration menu in the terminal.

Usage

  1. 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
  2. In the terminal window, the following text should appear (values depend on the board and chip used):
    -- ADCIFE Example xxx --
    -- xxxxxx-xx
    -- Compiled: xxx xx xxxx xx:xx:xx --
    =========================================================
    Menu: press a key to change the configuration.
    ---------------------------------------------------------
    [X] 0: Set ADCIFE trigger mode: Software.
    [ ] 1: Set ADCIFE trigger mode: Internal Timer.
    [ ] 2: Set ADCIFE trigger mode: Continuous.
    [D] T: Enable/Disable to transfer with PDCA in multichannel mode.
    [D] G: Enable/Disable to set gain=2 for channel.
    Q: Quit configuration and start ADCIFE.
    =========================================================
  3. The application will output converted value to HyperTerminal and display a menu for users to set different modes..