Getting Started Training Module Using MCC: Step 6

Last modified by Microchip on 2023/11/09 09:07

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

Go to File > Project Properties and make sure that the SAM E51 Curiosity Nano is selected as the debugger under Connected Hardware Tool.

Project properties, connected hardware tool

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

Clean and Build icon

Program your application to the device, by clicking on the Make and Program icon. The Lab will build and program successfully.

Make and Program icon

Now, open the Tera Term terminal application on your PC (from the Windows® Start menu by pressing the Start button). Select the Serial radio button. Select COM26: Curiosity Virtual COM Port (COM26) and click OK.

Terra Term serial port

Change the baud rate to 115200.

Terra Term setup 1

Terra Term setup 2

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.

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

Terra Term serial port 1

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

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.

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

Terra Term serial port 3

Back to top


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 pressed the user switch.

Back to top


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


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