Step 2: Identifying and Configuring LED Pin
Identifying the LED Pin Using the User Guide
To determine the appropriate pin for the user LED, begin by consulting the user guide. Navigate to the table of contents and select section 4, titled "Hardware", followed by the "Peripherals" subsection. Within this section, refer to 4.2.1, "User LED," where you will find a table listing the pin assignment for the user LED. According to the user guide, the user LED is connected to pin PA15.


In the provided image, the pin assignment for the User LED is indicated as PA15.

Verify the LED Pin Using Data Sheet
Open the "PIC32CM LE00/LS00/LS60 Family Data Sheet." Navigate to the "Pinout and Packaging" section and go to "48-pin VQFN and 48-pin TQFP" packages. Refer to Table 4-2 48-pin VQFN/48-pin TQFP I/O PINMUX. Locate PA15 in the Pin Name column and review the associated functionalities to be used in the demo.

Configure the Identified LED Pin
Create an MPLAB® Harmony v3 project using MPLAB X IDE, and refer to Lab 1 Step 2 for detailed project creation instructions. After the project is created, follow these steps to configure the LED pin.
After launching MCC, access the pin configuration by navigating to Project Graph, open Plugins, and select Pin Configuration.

In MPLAB Code Configurator (MCC), select the Pin Settings tab and sort the entries by Ports, as shown in the accompanying image.

Configure PA15 as a General Purpose Input/Output (GPIO) pin. Assign the appropriate pin name and specify the direction and latch settings required for LED operation.

After completing the LED pin configurations, generate the project as described in Lab 1. This process creates a peripheral library that incorporates the selected settings. Within this library, functions such as LED_Set(), LED_Clear(), and LED_Toggle() can be used for LED control, utilizing the custom name assigned to the pin.
