Harmony v3 Peripheral Libraries on PIC32MZ EF: Step 3

Step 3.1: 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.

user_button_schematic.png

1

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

pins_sorting.png

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.

switch_pin_configuration.png

Step 3.2: 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.

user_led_schematic.png

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.

led_pin_configuration.png

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.

Step 3.3: 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.

main_file_name_setup.png

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".



Next Step >

© 2019 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.