Step 6: Build, Program and Observe the Output
Build, Hardware Setup, and Program
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.

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 the LED1 on the PIC32CM LS00 Curiosity Nano+ Touch Evaluation Kit will toggle.

The LED toggling will not be visible to the naked eye because the 100 μs delay is too short.
Open the Saleae Logic application on the PC from the Windows® Start menu by pressing the Start button.
Rename Channel 0 to PA15. Then, start capturing signals by clicking the Play button in the Logic Analyzer.

Observe the PA15 pin using the Saleae Logic Analyzer. The measured frequency should be approximately 4.798 kHz, with a period of about 104.18 μs.

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

The LED toggling will not be visible to the naked eye because the 100 μs delay is too short.
Open the Salea Logic Analyzer and Observe the PA15 pin using the Saleae Logic Analyzer. The measured frequency should be approximately 4.936 kHz, with a period of about 101.262 μs.
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 frequency of approximately 4.768 kHz (with a period of 104.18 µs).
- 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 frequency of approximately 4.936 kHz (with a period of 101.262 µs).
- 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.