Migrating ASF SAM C21 Application to MPLAB® Harmony v3 PIC32CM MC: Step 6

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

Build and Program the Application

Go to File > Project Properties(getting_started_pic32cm_mc00_curiosity_pro) and make sure that the EDBG is selected as the debugger under the Hardware Tools and XC32 (v4.30) is selected as the Compiler Toolchain for XC32.

Compiler setup

Back to Top


Clean and build your application by clicking on the Clean and Build button.

Clean and Build Icon

In case of compilation errors, recheck the steps and build the project again.

Back to Top


Program your application to the device by clicking on the Make and Program button.

Make and Program button

Back to Top


Open the Tera Term application (or another terminal console) on your PC and navigate to File > New connection.

tera term new connection menu

Back to Top


Navigate to the Serial box in the opened window and select the port number that corresponds to the Embedded Debugger (EDGB) Virtual COM Port of your connected SAM L10 Xplained Pro.

Then, press OK to open a serial connection.

tera term new connection window

Back to Top


Open the Serial port configuration of Tera Term by navigating to Setup > Serial port….

Setup > Serial port… menu

Back to Top


In the Serial port setup window, verify that the Baud rate is set to 9600 and other elements are set as shown in the image, then press OK.

Tera Term Serial Port setup window

Back to Top


Now that the serial console is configured, reset the board and verify the application printing temperature and light sensor values continuously.

console message after reset

Back to Top


Cover the light sensor on the I/O Xplained Pro board by placing your hand over it (or another element to put the light sensor in a dark environment) to vary the light value.

Place a finger on the temperature sensor to vary the temperature.

console message after covering lightsensor

Back to top

Results

You successfully created an MPLAB Harmony v3 project from scratch. You configured and generated Harmony v3 peripheral library code for the I²C, USART, SUPC and ADC peripherals by considering the SAMC21 ASF example application. You also successfully migrated the application from ASF to Harmony v3.

Back to top

Analysis

In this lab, you have successfully created a project from scratch, added Peripheral Libraries (PLIBs), and migrated the application from ASF to MPLAB Harmony v3.

Back to top

Conclusions

In this tutorial, you discovered how to use MPLAB Harmony framework v3 and successfully created a project from scratch, added Peripheral Libraries (PLIBs), and migrated the application from ASF to MPLAB Harmony v3.

Back to top