Step 6: Build, Program and Observe the Output
Hardware Setup and Programming
Build the project by clicking the Clean and Build drop-down arrow, then select Clean and Build Main Project.
At this point, you are ready to start implementing your application on the hardware. Check whether the lab builds and programs successfully, and verify the build results in the output dialog box.
Connect the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit to the host PC using a USB cable attached to the debug USB port. This provides power to the board and enables debugging through the embedded debugger (nEDBG). Connect the Saleae® Logic Analyzer to the host PC and configure Channel 0 to PA15 to monitor the LED toggling rate.
In MPLAB® X IDE, navigate to File > Project Properties, and ensure that PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit EDBG is chosen under Connected Hardware Tools, and XC32 is selected as the Compiler Toolchain for XC32.

Then click Apply and Ok.
Program your application to the device by clicking on the Make and Program button, as shown in the accompanying image. Check whether the lab builds and programs successfully, and verify the build results in the output dialog box.

Observe the Output for Internal Clock
Observe that the LED1 on the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit will toggle.

Open the Saleae Logic application on the PC from the Windows® Start menu by pressing the Start button.
Start capturing signals by clicking the Play button in the Saleae Logic Analyzer.

Observe the PA15 pin using the Saleae Logic Analyzer. The measured period should be approximately 248.8902 ms.

Observe the Output for External Clock
Observe the LED1 on the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit will toggle.

Open the Saleae Logic Analyzer application and observe the PA15 pin. The measured period should be approximately 250.0023 ms.
Differential Behavior
This lab evaluates the performance of internal and external clock sources by measuring the SysTick timer delay, indicated by toggling an LED on the PA15 pin. The internal clock source used is OSCULP32K, and the external clock source is XOSC32K.
Internal Clock OSCULP32K:
- The internal clock source, OSCULP32K, is an on-chip ultra-low-power oscillator. When configured as the SysTick timer’s clock source, it generates an LED toggling period of approximately 248.8902 ms.
- However, since OSCULP32K is an RC-based internal oscillator, it is less accurate and more prone to frequency variations due to changes in process, voltage, and temperature.
External Clock XOSC32K:
- The external clock source, XOSC32K, utilizes a 32.768 kHz crystal oscillator. When configured as the clock source for the SysTick timer, it generates an LED toggling period of approximately 250.0023 ms.
- External crystal oscillators provide high stability and precision, resulting in superior accuracy and minimal frequency drift over time and temperature variations.
Conclusion
By measuring the LED toggle rate with the SysTick timer, the external clock source (XOSC32K) offers better timing accuracy than the internal clock source (OSCULP32K). For applications requiring precise and stable timing, the use of an external crystal oscillator is recommended.