MPLAB® Harmony v3 Peripheral Libraries on SAMC2x: Step 4

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

Generate Code

When done, before generating the code, click Save MHC State as shown in the accompanying image.

Save MHC State button


Save the configuration in its default location when prompted.

Save Database Sate As window

Back to Top


Generate the code as shown in the accompanying image.

Generate button

Back to Top


Click on the Generate button in the Generate Project window, keeping the default settings as shown in the accompanying image. If prompted for saving the configuration, click Save.

Modified Configuration window

Generate Project window

Back to Top


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

Generating Project status window

Back to Top


Examine the generated code as shown in the accompanying image.

MPLAB Harmony library files and generate the code

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

Among the generated code, notice the peripheral library files generated for RTC, SERCOM5 (as I²C), SERCOM4 (as USART), DMA, and PORT peripherals. MHC also generates the template main file (main_c21n.c).

Back to Top


Navigate to the Projects tab to view the project tree structure.

Back to Top


Build the code 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