Step 3: Generate Code

Last modified by Microchip on 2026/06/29 11:04

Note: This step (Step 3: Generate Code) applies to both CPU-driven and Direct Memory Access (DMA)-driven data transfers.

Generate Code

Generate the code by navigating to the Project Resource tab on the left side of the Project Graph and clicking the Generate button.

Project Resource tab                      

As code is generated, MPLAB® Code Configurator (MCC) displays the progress as shown in the accompanying image.

MCC Loading window                                    

Once project generation is complete, the Peripheral Library (PLIB), .c and .h files are updated with the configured settings. The added configurations can be verified by navigating to the Projects panel on the left side of the IDE and viewing the project tree structure containing the generated code.

The project tree structure shown in the image represents the generated code for the CPU-driven transfer project.

Projects tab

In the following image, the generated code corresponds to the DMA-driven transfer project.

Projects tab   

MCC will include all the MPLAB Harmony v3 library files and generate the code based on the MCC selections. The generated code would add files and folders to the MPLAB Harmony v3 project as shown.

Among the generated code, notice the PLIB files generated for External Interrupt Controller (EIC), and PORT peripherals. MCC also generates the template main file (main.c).

Back to Top