Step 2: Identifying and Configuring LED Pin

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

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.

                      User LED Table
                                                                       LED Diagram

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

Pinout

Note: It is important to note that the PA15 pin is also depicted in the hardware pinout diagram. A single pin can be assigned to only one function at a time. Therefore, if PA15 is configured for the User LED, you must consult the pinout diagram in the user guide before assigning additional peripherals. Always verify whether a pin is already in use, as some pins support multiple functions but can only be dedicated to one purpose within a given configuration.


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.

Datasheet


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.

                                              Project Graph

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

                             Pin Settings

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.

Pin Settings

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.

Projects Tab

Back to Top