Getting Started Training Module Using MPLAB® Code Configurator (MCC): Step 6

Last modified by Microchip on 2023/11/15 13:00

Build, Program, and Observe the Outputs

The SAM E51 Curiosity Nano Evaluation Kit allows using the onboard debugger for debugging. Connect the Type-A male to Micro-B USB cable to the Micro-B DEBUG USB port to power and debug the SAM E51 Curiosity Nano Evaluation Kit.

SAM E51 Curiosity Nano Evaluation Kit

Back to top


Go to File > Project Properties and make sure that the SAM E51 Curiosity Nano is selected as the debugger under Connected Hardware Tool. Check that XC32 (v4.30) is selected as the Compiler Toolchain for XC32.

Project properties, connected hardware tool

Back to top


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

Clean and Build icon

Back to top


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

Make and Program icon

The Lab will build and program successfully.

Back to top


Now, open the Tera Term terminal application on your PC (from the Windows® Start menu by pressing the Start button). Select the Serial Port.

Terra Term serial port

Back to top


Select Setup > Serial port and change the Baud rate to 115200.

Terra Term setup 1

Terra Term setup 2

Back to top


You will see an LED (LED0) on the SAM E51 Curiosity Nano Evaluation Kit toggles on every timeout basis and the default periodicity of the timeout is 500 milliseconds.

Terra Term serial port 1

Also, notice the LED0 blinking at a 500 milliseconds rate.

Back to top


Press the switch SW0 on SAM E51 Curiosity Nano Evaluation Kit to change the default sampling rate to 1 second.

SAM E51 Curiosity Nano Evaluation Kit

Terra Term serial port 2

Back to top


Every subsequent pressing of switch SW0 on the SAM E51 Curiosity Nano Evaluation Kit changes the default sampling rate to 2 seconds, 4 seconds, 500 milliseconds, and back to 1 second in cyclic order.

Terra Term serial port 3

While the temperature sampling rate changes on every switch SW0 press, notice the LED0 toggling at the same sampling rate.

Back to top


Results

You observed that the application displayed the LED toggling rate on the serial terminal every 500 milliseconds. You could change the LED toggling rate dynamically by pressing a user switch on the development kit. You could exercise sampling changes to 1 second, 2 seconds, 4 seconds, and cycle back to 500 milliseconds every time you press the user switch.

Back to top

Analysis

You have successfully created your first application using MPLAB® Code Configurator (MCC) on MPLAB Harmony v3 on SAM D5x/E5x microcontroller. Your application used all the fundamental elements that go into building a real-time application. Your application successfully toggled the LED and displayed the LED toggling rate periodically over a serial terminal on a PC. The application also took user input by pressing a switch on the development board.

In this application, you used MCC to configure SAM D5x/E5x and use the MPLAB Harmony v3 Framework. You used the clock configurator to set up the CPU clock and timer (RTC) clock. You configured SERCOM 5 (as USART), RTC, and EIC peripheral libraries. You also configured DMA using the DMA configurator. Finally, you used Pin Configurator to set up the pins for LED and switch functions.

Back to top

Conclusions

This tutorial provided you with training for configuring and using all the fundamental components needed to build a real-time application on a SAM D5x/E5x microcontroller using MCC with MPLAB Harmony v3 Framework. As a next step, you may customize this application and reconfigure some of the components used in this tutorial. You could also add new features (PLIBs, etc.) to enhance this application to realize your end application.

Back to top