Microchip® Advanced Software Framework

SAM TC Unit Test

Overview:

Introduction

This unit test carries out tests for TC driver.

It consists of test cases for the following functionalities:

  • Test for driver initialization.
  • Test for TC start/stop
  • Test for TC callback generation
  • Test for 32-bit (chained) TC operation
  • Test for compare and capture TC operation

The following kit is required for carrying out the test:

  • SAM D20/D21/R21/L21/L22/DA1/C21/R30/HA1G16A Xplained Pro board

Setup

The following connections has to be made using wires:

  • SAM D21/D20 Xplained Pro:EXTINT 0 (PB00, EXT1 pin 3) <--—> TC4 WO1 (PB09, EXT1 pin 13)
  • SAM R21 Xplained Pro:EXTINT 0 (PA16, EXT2 pin 11) <--—> TC4 WO1 (PA23, EXT1 pin 10)
  • SAM L21 Xplained Pro:EXTINT 0 (PB00, EXT3 pin 3) <--—> TC0 WO1 (PB09, EXT1 pin 13)
  • SAM L22 Xplained Pro:EXTINT 2 (PB16, EXT3 pin 7) <--—> TC0 WO1 (PB09, EXT1 pin 8)
  • SAM DA1 Xplained Pro:EXTINT 0 (PA16, EXT2 pin 17) <--—> TC4 WO1 (PB09, EXT1 pin 13)
  • SAM HA1G16A Xplained Pro:EXTINT 0 (PA16, EXT1 pin 10) <--—> TC3 WO1 (PA19, EXT1 pin 8)
  • SAM C21 Xplained Pro:EXTINT 0 (PB16, EXT2 pin 9) <--—> TC0 WO1 (PB09, EXT1 pin 3)
  • SAM R30 Xplained Pro:EXTINT 0 (PA16, EXT1 pin 11) <--—> TC0 WO1 (PA23, EXT1 pin 10)
  • SAM R30 Module Xplained Pro:EXTINT 0 (PA16, EXT1 pin 11) <--—> TC4 WO1 (PA19, EXT pin 17)
  • SAM R34 Xplained Pro:EXTINT 1 (PA17, EXT1 pin 12) <--—> TC0 WO1 (PA23, EXT1 pin 15)
  • WLR 089 Xplained Pro:EXTINT 1 (PA17, EXT1 pin 12) <--—> TC0 WO1 (PA23, EXT1 pin 15)

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 tests are carried out using the several TC modules internally for internal checks.
  • The EXTINT module is connected to a TC module so that it can detect the correct TC waveform output.

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.