Skip to content

microchip-pic-avr-examples/pic32cm-pl10-getting-started-vscode-mplab

Repository files navigation

Microchip Technologies Inc.

Getting Started With the PIC32CM PL10 Family of MCUs

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

Related Documentation

Software Used

Hardware Used

Hardware Setup

If not done already, press the header pins into the PIC32CM PL10 Curiosity Nano. Then, insert the Nano into the Curiosity Explorer board.

Opening Projects in Visual Studio Code (VS Code®)

  1. Download and decompress the repository on the computer.
  2. In VS Code, select File>Open Folder...
  3. Select the folder containing the project of interest (e.g., Part1/part1-touch-sercom)
  4. Build the project by pressing Ctrl+Shift+P and then MPLAB CMake: Clean Build

Project Description and Operation

Part 1 — Touch

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).

Part 2 — ADC

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.

Part 3 — EVSYS

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.

Part 4 — Sleepwalking

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.

Conclusion

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.

About

Demo applications for getting started series on PIC32CM-PL10.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages