Step 6: Build, Program and Observe the Outputs
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.
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.
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.
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.