Microchip® Advanced Software Framework

SAM EXTINT Unit Test

Overview:

Introduction

This unit test carries out tests for the External Interrupt driver.

It consists of test cases for the following functionalities:

  • Test for polled mode detection of external interrupt.
  • Test for callback mode detection of external interrupt.

Tests will be performed for rising and falling edges of the external signal.

The following kit is required for carrying out the test:

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

Setup

The following connections has to be made using wires:

  • SAM D21/DA1/D20 Xplained Pro
    • EXT1 Pin 9 (PB04) <--—> Pin 11 (PA08)
  • SAM R21 Xplained Pro
    • EXT1 Pin 3 (PA06) <--—> EXT3 Pin 10 (PA08)
  • SAM L21 Xplained Pro
    • EXT1 Pin 9 (PB04) <--—> EXT3 Pin 5 (PB30)
  • SAM L22 Xplained Pro
    • EXT1 Pin 9 (PC02) <--—> EXT3 Pin 5 (PC16)
  • SAM C21 Xplained Pro
    • EXT1 Pin 9 (PB14) <--—> EXT1 Pin 10 (PB15)
  • SAM R30 Xplained Pro
    • EXT1 Pin 5 (PA13) <--—> EXT1 Pin 8 (PA19)
  • SAM R30 Module Xplained Pro
    • EXT Pin 10 (PA28) <--—> EXT Pin 3 (PA06)
  • SAM R34 Xplained Pro
    • EXT1 Pin 9 (PA22) <--—> EXT3 Pin 10 (PA08)
  • WLR 089 Xplained Pro
    • EXT1 Pin 9 (PA22) <--—> EXT3 Pin 10 (PA08)

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 external interrupt on PB04 pin (channel 4) to detect falling edge.
  • Logic level on PB05 is changed from high to low (falling edge) and the channel is checked for interrupt detection.
  • The test is repeated for rising edge and with callback enabled.

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.