Beginner Lab 8: Universal Asynchronous Receiver Transmitter (UART) Interrupt Mode

Last modified by Microchip on 2026/06/26 07:40

Objective

  1. Understand the principles of Universal Asynchronous Receiver Transmitter (UART) communication and its implementation using interrupt mode on a PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit.
  2. Compare polling-based UART communication with interrupt-driven UART communication by transmitting a received data buffer using UART interrupts.
  3. Gain practical experience in configuring and handling UART interrupts for efficient I/O operations.
  4. Develop a foundational understanding of Nested Vectored Interrupt Controller (NVIC) configuration and interrupt handling concepts in embedded systems.

Overview

This lab is designed to implement UART communication using interrupt mode on the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit. Expanding upon the polling-based UART communication introduced in previous exercises, this lab highlights the differences between polling and interrupt-driven methods. The UART peripheral on the PIC32CM LS00 device will be configured to transmit a received data buffer utilizing UART interrupts. Completion of this lab provides practical experience with interrupt-driven input/output, demonstrates how UART events trigger interrupt service routines, and introduces the basic operation of the NVIC. This lab introduces essential interrupt-handling concepts relevant to real-time embedded systems.

Lab Activities

  • Configure the SERCOM3 peripheral in Universal Synchronous Asynchronous Receiver Transmitter (USART) mode and assign the appropriate USART pins using MPLAB® X IDE.
  • Set up Arm® TrustZone® for Armv8-M by configuring the Serial Communication (SERCOM) peripheral as non-secure and ensure that the SERCOM interrupt is enabled in the NVIC.
  • Generate the project and add the application code to the generated project files, implementing callback functions for SERCOM USART read and write operations to enable interrupt-driven communication.
  • Observe the output by verifying that the data entered is echoed back through USART communication using a terminal application such as Tera Term.

Expected Outcomes

Upon completion of this lab, the following skills will be acquired:

  • Successfully configure the SERCOM peripheral for USART communication and assign the appropriate TX and RX pins.
  • Set up Arm TrustZone for Armv8-M and ensure that the corresponding NVIC interrupt is enabled.
  • Develop and integrate application code to implement interrupt-driven USART communication using SERCOM USART callback functions.
  • Verify the output by confirming that the entered 10 characters are echoed back through USART communication using a terminal application such as Tera Term or PuTTY.

Back to Top

Lab Source Files and Solutions

This ZIP file contains the completed solution project for this lab. It also contains the source files needed to perform the lab as per the following step-by-step instructions (see the "Lab Index" section on this page).

Download the ZIP file for this lab.

Information

The contents of this ZIP file need to be placed in the following folder:

<Any directory of user's choice>/
(example Directory = C:/microchip/harmony/v3)

Note:

  1. The project location of an MPLAB Harmony v3 project is independent of the location of the MPLAB Harmony Framework path (i.e., there is no requirement to create or place an MPLAB Harmony v3 project in a relative path under the Harmony v3 framework folder). The project can be created or placed in any directory of your choice.
  2. The point above is true because when created, an MPLAB Harmony v3 project generates all the referred source and header files and libraries (if any) under the project folder.

Back to Top

Lab Index

Back to Top

  1. PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit
  2. MPLAB X Integrated Development Environment (IDE)
  3. MPLAB XC32 Compiler
  4. PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit: EV41C56A User Guide
  5. Ultra-Low Power, Secure, and Enhanced Touch MCU: PIC32CM LE00/LS00/LS60 Data Sheet

Back to Top