Getting Started with MPLAB® Harmony v3 Peripheral Libraries on PIC32MK GP MCUs: Step 4

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

Generate Code

When done, before generating code, click the Save icon in MPLAB® Harmony Configurator (MHC) as shown in the accompanying image.

The Save icon in MPLAB Harmony Configurator


Save the configuration in its default location when prompted.

Save the configuration in its default location


Click on the Generate Code button as shown in the accompanying image to start generating code.

Click on the Generate Code button

Back to Top


Click on the Generate Code button in the Generate Project window, keeping the default settings as shown below.

If prompted for saving the configuration, click Save.

Save the configuration if prompted

Click on the Generate Code button in the Generate Project window

Back to Top


As the code is generated, the MHC displays the progress as shown in the accompanying image.

The MHC displays the progress

Back to Top


Navigate to the Projects tab in MPLAB X IDE to view the project tree structure.

Back to Top


Examine the generated code as shown in the accompanying image.

The generated code will add files and folders to your Harmony project

MHC will include all the MPLAB Harmony library files and generate the code based on the MHC selections. The generated code will add files and folders to your Harmony project.

Among the generated code, notice the Peripheral Library (PLIB) files generated for TMR2, CORE TIMER, Serial Peripheral Interface 6 (SPI6), Universal Asynchronous Receiver Transmitter 6 (UART6), Direct Memory Access Controller (DMAC), and General Purpose Input/Output (GPIO) peripherals. MHC also generates template main file (main_pic32mk.c).

Back to Top


Build the project by clicking on the Clean and Build icon build icon and verify that the project builds successfully. At this point, you are ready to start implementing your application code.

Back to Top