Beginner Lab 10: SysTick

Last modified by Microchip on 2026/06/29 10:46

Objective

  1. Understand the working principle of the SysTick periodic timer in Arm® Cortex®-M microcontrollers.
  2. Measure the number of CPU cycles required to assign 250 values to an array.
  3. Evaluate the execution time for multiplication and division operations performed on 250 array elements.
  4. Analyze the performance differences between various arithmetic operations using the SysTick counter.
  5. Print and verify the measured execution times on the serial console via Universal Asynchronous Receiver Transmitter (UART) communication.
  6. Enable lab users to understand the significance of SysTick as a system timer in microcontrollers.

Overview

The SysTick timer of the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit microcontroller is utilized as a cycle counter to measure the execution time of various arithmetic operations. In this experiment, 250 values are assigned to an array, followed by multiplication and division operations performed on the array elements. The SysTick counter is monitored before and after each operation to determine the number of clock cycles consumed. The calculated execution time is transmitted to the console using UART printf. This lab aims to analyze processor performance, instruction execution timing, and the impact of arithmetic operations on CPU cycle consumption.

Lab Activities

  • Configure the SysTick system timer to count the execution cycles of CPU operations.
  • Enable SERCOM3 as a USART interface to print the measured execution cycles to a terminal.
  • Implement application code that utilizes the SysTick counter to measure execution time for assignment and arithmetic operations.
  • Observe and verify the execution time of each operation on the terminal using the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit.

Expected Outcomes

Upon completing this lab, you will be able to:

  • Configure the SysTick timer for accurate cycle counting in Arm Cortex-M-based microcontrollers.
  • Configure SERCOM3 as a USART interface to enable reliable serial communication.
  • Implement embedded C code for measuring and analyzing the execution time of assignment and arithmetic operations.
  • Validate and interpret execution cycle measurements using the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit.

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 user's 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