MPLAB® Harmony v3 Peripheral Libraries on PIC32MZ EF: Step 3

Last modified by Microchip on 2023/11/09 09:07

Configure Pins for Switch and LED

Configure switch button pin with General Purpose Input/Output (GPIO) interrupt handler

The switch button will be configured as per the design schematic of the Curiosity PIC32MZ EF 2.0 Development Board shown below.

button 1 schematic

In the MPLAB® Harmony Configurator (MHC), select the Pin Settings tab and sort (Order) the entries by Ports.

MPLAB Harmony Configurator (MHC),  the Pin Settings tab

Scroll down to GPIO pin RJ4 (Pin Number 131) in the Pin ID column and configure RJ4 as an external interrupt pin for SW1 switch functionality. Internal pull-up is enabled to avoid false edge detection as there is no external pull-up on the Curiosity PIC32MZ EF 2.0 Development Board.

MPLAB Harmony Configurator (MHC),  the Pin Settings tab scrolled down to pin 131

Back to Top


Configure LED pin

The user LED will be configured as per the design schematic of the Curiosity PIC32MZ EF 2.0 Development Board shown below.

LED Schematic

Select the Pin Settings tab and then scroll down to GPIO pin RJ7 (Pin Number 134) in the Pin ID column and configure RJ7 as an output pin for LED1 functionality.

MPLAB Harmony Configurator (MHC),  the Pin Settings tab scrolled down to pin 134

Note: The LED1 on the Curiosity PIC32MZ EF 2.0 Development Board is active low. Configure the LED1 in the default OFF state by configuring the latch value to logic High.

Back to Top


Rename the default main file

Under the Project Graph tab, click on System, and give a name of your liking to the default template main file generated by the MHC.

rename the Main file

Note: The name of the default main.c is changed to main_pic32mz.c to indicate that the referred main.c is for the PIC32MZ EF "Getting Started Training Module".

Back to Top