MPLAB® Harmony v3 Peripheral Libraries on PIC32MX 470: Step 4

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

Generate Code

Before generating code, click the Save icon in MPLAB® Harmony Configurator (MHC).

Save icon

Save the configuration in its default location when prompted.

Save the configuration in its default location

Click on the Code Generate button to start generating code.

Code Generate button

Click on the Generate button in the Generate Project window, keeping the default settings.

If you are asked whether you want to save the configuration, click Save.

Generate Project window

Generate Project window

As the code is generated, MHC displays the progress as shown below.

Generate Project window

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

Examine the generated code.

Projects tab in MPLAB X IDE

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, CORETIMER, I²C1, UART2, DMAC, and GPIO peripherals. MHC also generates a template main file (main_pic32mx470.c).

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