In this step, we will extend the MHC project by configuring a GPIO pin for the SW3 switch and user LED (LED3).
Step 3.1: Configure the Switch Button Pin
Configure the switch button, BTN3 pin, with a General Purpose Input/Output (GPIO) interrupt handler.
The switch button, BTN3, will be configured as per the design schematic of the Curiosity PIC32MZ EF 2.0 Development Board shown in Figure 1.
1
Open Pin Configuration under Plugins: to verify the pin configuration. Select the Pin Settings tab and sort (Order) the entries by Ports.
Scroll down to GPIO pin RJ6 (Pin #133) in the Pin ID column and configure RJ6 as a GPIO pin for SW3 switch functionality. An 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.
Step 3.2: Configure the LED Pin
The user LED3 will be configured as per the design schematic of the Curiosity PIC32MZ EF 2.0 Development Board shown in Figure 4.
1
Select the Pin Settings tab and then scroll down to GPIO pin RJ3 (Pin #117) in the Pin ID column and configure RJ3 as an output pin for LED3 functionality.
Note: The LED3 on the Curiosity PIC32MZ EF 2.0 Development Board is active low. Configure the LED3 in the default OFF state by configuring the latch value to logic High.