Beginner Lab 3: LED Toggle With Software Delay

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

Objective

  1. Configure a General Purpose Input/Output (GPIO) pin to control the state of an LED on the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit.
  2. Implement a software-based delay using for-loops to achieve a 500 ms interval for toggling the LED.
  3. Write and test embedded C code to toggle the LED state at regular intervals without using hardware timers.
  4. Demonstrate how software loops can be used for timing control in embedded applications.
  5. Gain practical experience in basic GPIO output programming and software-generated delays.
  6. Establish a foundation for understanding timing and control in embedded systems through hands-on coding and hardware interaction.

Overview

This lab provides a practical introduction to basic embedded programming by focusing on the control of LED indicators through GPIO outputs. Code is written to toggle LEDs with a 500‑ms delay, achieved using for‑loops to create software‑based timing. The exercise is designed as a beginner‑level activity, making it accessible for those new to microcontroller programming. Through this lab, experience is gained in configuring GPIO pins, manipulating digital outputs, and understanding the principles of software‑generated delays. This foundational knowledge supports further exploration of embedded systems and real‑time application development.

Lab Activities

  • Program the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit to toggle LEDs on and off.
  • Implement a 500 ms delay between each toggle using software for-loops.
  • Observe and analyze the behavior of the LEDs in response to the programmed delay.

Expected Outcomes

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

  • Demonstrate the ability to control GPIO outputs.
  • Apply software-based delay techniques in embedded programming.
  • Gain practical experience in basic coding for microcontroller applications.

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 below folder:

<Any directory of the 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

Back to Top