Microchip® Advanced Software Framework

SAM USART Unit Test

Overview:

Introduction

This unit test carries out tests for SERCOM USART driver.

It consists of test cases for the following functionalities:

  • Test for driver initialization.
  • Test for single 8-bit write and read by polling.
  • Test for single 9-bit write and read by polling.
  • Test for multiple 8-bit write by polling and read by interrupts.
  • Test for multiple 8-bit write and read by interrupts.

    The following kit is required for carrying out the test:

    • SAM D20 Xplained Pro board
    • SAM D21 Xplained Pro board
    • SAM R21 Xplained Pro board
    • SAM L21 Xplained Pro board
    • SAM L22 Xplained Pro board
    • SAM DA1 Xplained Pro board
    • SAM HA1G16A Xplained Pro board
    • SAM C21 Xplained Pro board
    • SAM R30 Xplained Pro board
    • SAM R30 Module Xplained Pro board
    • SAM R34 Xplained Pro board
    • WLR 089 Xplained Pro board

Setup

The following connections has to be made using wires:

  • SAM D21/DA1/D20 Xplained Pro board
    • TX/RX: EXT2 PIN17 (PA16) <–> EXT3 PIN17 (PB16)
  • SAM HA1G16A Xplained Pro board
    • TX/RX: EXT1 PIN14 (PB10) <–> EXT1 PIN12 (PA09)
  • SAM R21 Xplained Pro board
    • TX/RX: EXT1 PIN11 (PA16) <–> EXT1 PIN17 (PB02)
  • SAM L21 Xplained Pro board
    • TX/RX: EXT2 PIN3 (PA10) <–> EXT2 PIN8 (PB13)
  • SAM L22 Xplained Pro board
    • TX/RX: EXT1 PIN13 (PA23) <–> EXT3 PIN3 (PA06)
  • SAM C21 Xplained Pro board
    • TX/RX: EXT1 PIN11 (PA12) <–> EXT2 PIN4 (PA09)
  • SAM R30 Xplained Pro board
    • TX/RX: EXT1 PIN7 (PA18) <–> EXT1 PIN12 (PA17) <<<<<<< HEAD
  • SAM R30 Module Xplained Pro board

    - TX/RX: EXT PIN13 (PA14) <–> EXT PIN15 (PA17)

  • SAM R34 Xplained Pro board
    • TX/RX: EXT1 PIN11 (PA16) <–> EXT1 PIN17 (PB02)
  • WLR 089 Xplained Pro board
    • TX/RX: EXT1 PIN11 (PA16) <–> EXT1 PIN17 (PB02)

      3518a2958ff4695a84f9222901de2da524b4520d

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 with one SERCOM on EXT1 as the USART transmitter and another SERCOM on EXT1 as the SERCOM USART receiver.
  • Data is transmitted from transmitter to receiver in lengths of a single byte as well as multiple bytes.

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.