Microchip® Advanced Software Framework

SAM TCC Unit Test

Overview:

Introduction

This unit test carries out tests for TCC driver.

It consists of test cases for the following functionalities:

  • Test for driver initialization.
  • Test for TCC start/stop
  • Test for TCC callback generation
  • Test for 24-bit TCC operation
  • Test for compare and capture TCC operation

The following kit is required for carrying out the test:

  • SAM D21/R21/L21/DA1/C21/R30/R34 Xplained Pro board

Setup

The following connections has to be made using wires:

  • SAM D21/DA1 Xplained Pro:
    • EXTINT 4 (PB04, EXT1 pin 9 ) <--—> TCC0 WO0 (PA08, EXT2 pin 11)
  • SAM R21 Xplained Pro:
    • EXTINT 6 (PA06, EXT1 pin 3 ) <--—> TCC0 WO0 (PA08, EXT3 pin 10)
  • SAM L21 Xplained Pro:
    • EXTINT 4 (PB04, EXT1 pin 9 ) <--—> TCC0 WO0 (PB30, EXT3 pin 5)
  • SAM C21 Xplained Pro:
    • EXTINT 4 (PA20, EXT1 pin 5 ) <--—> TCC0 WO0 (PA08, EXT2 pin 3)
  • SAM R30 Xplained Pro:
    • EXTINT 3 (PB03, EXT1 pin 15 ) <--—> TCC0 WO0 (PA08, EXT3 pin 10)
  • SAM R30 Module Xplained Pro:
    • EXTINT 8 (PA28, EXT pin 10 ) <--—> TCC0 WO0 (PA08, EXT pin 11)
  • SAM R34 Xplained Pro:
    • EXTINT 7 (PA28, EXT1 pin 6 ) <--—> TCC0 WO0 (PA08, EXT1 pin 5)
  • WLR 089 Xplained Pro:
    • EXTINT 7 (PA28, EXT1 pin 6 ) <--—> TCC0 WO0 (PA08, EXT1 pin 5)

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 TCC modules internally for internal checks.
  • The EXTINT module is connected to a TCC module so that it can detect the correct TCC 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.