Low Power Application on SAMC2x Using MPLAB® Harmony v3 Peripheral Libraries: Step 5

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

Generate Code

When done, before generating the code, click the Save icon as shown below.
Clicking the Save icon
Save the configuration in its default location when prompted.
Saving the configuration

Click on the Generate icon to generate the code as shown below.

Clicking on the Generate icon

Click on the Generate button in the Generate Project window, keeping the default settings as shown below. If prompted to save the configuration, click Save.

Clicking on the Generate button in the Generate Project windowSaving Modified Configuration

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

MHC displaying progress

Examine the generated code as shown below.

Examining the generated codeMHC 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, SERCOM 2 (as I²C), SERCOM 4 (as USART), DMA, PM, EIC, EVSYS, SUPC, ADC and PORT peripherals. MHC also generates template main file (main.c).

Navigate to the Projects tab to view the project tree structure.
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.