Getting Started Training Module Using MCC: Step 6

Step 6: Build, Program and Observe the Outputs

1

The SAM E51 Curiosity Nano Evaluation Kit allows using the on-board 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.

hardware_setup.jpg
Click image to enlarge.

2

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

compiler_setup.png

3

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

clean_and_build_icon.png

5

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

make_and_program.png

The Lab will build and program successfully.

6

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.

com_port_setup1.png

7

Change the baud rate to 115200

com_port_setup2.png
baud_rate_setup.png

8

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.

result1.png

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

9

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

user_button_placement.png
result2.png

10

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.

result3.png

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

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

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.

Conclusions

This tutorial provided you 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.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.