Microchip® Advanced Software Framework

SAM AC Unit Test

Overview:

Introduction

This unit test carries out tests for the AC driver.

It consists of test cases for the following functionalities:

  • Test for AC initialization.
  • Test for AC single shot comparison.
  • Test for AC callback mode comparison.
  • Test for AC continuous window mode comparison.

Input to the AC is provided with the DAC module.

The following kit is required for carrying out the test:

  • SAM D20 Xplained Pro board
  • SAM D21 Xplained Pro board
  • SAM L21 Xplained Pro board
  • SAM DA1 Xplained Pro board
  • SAM C21 Xplained Pro board

Setup

The following connections has to be made using wires:

  • DAC VOUT (PA02) <--—> AIN0 (PA04)

To run the test:

  • Connect the SAM Xplained Pro board to the computer using a micro USB cable.
  • Open the virtual COM port in a terminal application.
    Note
    The USB composite firmware running on the Embedded Debugger (EDBG) will enumerate as debugger, virtual COM port and EDBG data gateway.
  • Build the project, program the target and run the application. The terminal shows the results of the unit test.

Usage

  • The unit test configures DAC module to provide voltage to the AC positive input.
  • AC negative input is given from internal voltage scaler.
  • DAC output is adjusted to generate various voltages which are compared by the AC.
  • Different modes of the AC are tested.

Compilation Info

This software was written for the GNU GCC and IAR for ARM. Other compilers may or may not work.

Contact Information

For further information, visit http://www.microchip.com.