This set of projects is designed to go along with the "Getting Started in VS Code®" series for the PIC32CM PL10 family of MCUs - based on the ARM® Cortex®-M0+ processor. There are four projects in this repository, each focusing on a specific peripheral or feature in the device:
- Touch
- ADC
- Event System (EVSYS)
- Sleepwalking
- MPLAB® Tools for VS Code® v1.2.1 or newer
- MPLAB® XC32 v5.0.0 or newer
If not done already, press the header pins into the PIC32CM PL10 Curiosity Nano. Then, insert the Nano into the Curiosity Explorer board.
- Download and decompress the repository on the computer.
- In VS Code, select File>Open Folder...
- Select the folder containing the project of interest (e.g., Part1/part1-touch-sercom)
- Build the project by pressing Ctrl+Shift+P and then MPLAB CMake: Clean Build
In this example, the Peripheral Touch Controller (PTC) is used with the Touch libraries to detect when a person taps on the Microchip logo on the Curiosity Nano. When pressed, the LED on the Curiosity Nano turns on and a message is printed to the debug Universal Asynchronous Receiver and Transmitter (UART).
In this example, the Analog-to-Digital Converter (ADC) is used measure the analog input from the potentiometer. The ADC is triggered in software, and prints the measured value to the debug UART.
In this example, the ADC is used measure the analog input from the potentiometer. The ADC is triggered using the Real Time Clock (RTC) and the Event System (EVSYS), with the CPU waiting for the result to be ready. Once measured, the result is printed to the debug UART.
In this example, the PIC32CM PL10 device demonstrates sleepwalking - the ability of the microcontroller (MCU) to allow peripherals to operate independently of the core while the CPU remains in sleep. The ADC is periodically triggered by the RTC through the EVSYS to measure the analog value of the potientiometer. If the potientiometer changes by more than 5%, the ADC wakes the CPU using the windowed comparsion interrupt. The LED turns ON when the CPU is awake to provide a visual indication of sleepwalking. Additional messages are transmitted through the debug UART.
These projects showcase some of the capabilities of the PIC32CM PL10 MCUs and serve as valuable starting points for experimenting with the Curiosity Nano and Curiosity Nano Explorer boards.