Beginner Lab 7: Universal Asynchronous Receiver Transmitter (UART) Polling Mode

Last modified by Microchip on 2026/06/26 08:27

Objective

  1. Configure Universal Asynchronous Receiver Transmitter (UART) via Serial Communication Module (SERCOM) peripheral on the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit for serial communication.
  2. Implement UART communication in polling mode without using interrupts.
  3. Develop embedded C code to transmit and receive characters through the UART interface.
  4. Implement an echo-back mechanism to send received characters back to the terminal.
Information

Note: 

SERCOM is a flexible communication peripheral available in many microcontrollers. It is designed to support multiple serial communication protocols using the same hardware block. Each SERCOM module can be independently configured to operate in different modes based on application requirements.

SERCOM can be configured to function as UART/Universal Synchronous Asynchronous Receiver Transmitter (USART), Serial Peripheral Interface (SPI), or Inter-Integrated Circuit (I²C). In UART/USART mode, it is used for serial data transmission and reception, either in asynchronous (UART) or synchronous (USART) communication. In SPI mode, it supports high-speed, full-duplex data communication between master and slave devices. In I²C mode, it enables two-wire communication suitable for interfacing sensors and low-speed peripherals.

Multiple SERCOM instances are usually available in a single microcontroller, allowing different communication protocols to be used simultaneously. This flexibility helps reduce hardware complexity and makes SERCOM a versatile and widely used module in embedded systems.

Overview

This lab introduces fundamental UART communication using the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit. The UART peripheral is configured to operate at 9600 bps, with data transmission and reception implemented using a polling‑based approach. The lab emphasizes direct interaction with UART registers, reinforcing the importance of data sheet interpretation and low‑level peripheral configuration. Character echo‑back is used to observe real‑time UART communication behavior. This moderate‑difficulty exercise builds essential skills required for debugging, communication, and interface development in embedded applications.

Lab Activities

  • Configure the UART peripheral on the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit for operation at 9600 bps.
  • Implement polling-based UART transmit and receive functions.
  • Receive characters from a serial terminal and echo them back to the sender.
  • Verify UART communication functionality using a serial console.

Expected Outcomes

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

  • Configure UART peripherals using MPLAB® Code Configurator (MCC).
  • Implement polling-based UART communication without interrupts.
  • Calculate and apply baud rate settings for serial communication.
  • Demonstrate successful transmission, reception, and echo-back of UART data.

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 the user's choice>/
(example Directory = C:/microchip/harmony/v3)

Note:

  1. An MPLAB Harmony v3 project can be created in any directory. Its location does not depend on the MPLAB Harmony Framework path, so it does not need to be placed under the Harmony v3 framework folder or in any relative path beneath it.
  2. This is possible because the project generates its required files locally. When an MPLAB Harmony v3 project is created, all referenced source files, header files, and libraries, if applicable, are generated within the project folder.

Back to Top

Lab Index

Back to Top

Back to Top