Step 6: Build, Program, and Observe the Outputs
Results
This application displayed the current room temperature values on the serial terminal every second. In addition, the application retrieved and printed (on the serial terminal) the last five stored temperature values from EEPROM every time a character was entered on the serial terminal. It was also observed that a user LED toggled every time the current temperature was displayed on the serial terminal.
Analysis
Your first application using MPLAB® Harmony v3 on a SAM E54 microcontroller has been successfully created. This application used all the fundamental elements that go into building a real-time application and successfully read temperature sensor values and display them periodically over a serial terminal on a PC. While the temperature values were printed on the serial terminal, the application stored the temperature values into EEPROM. The application retrieved the last five values stored in EEPROM and displayed them on the serial terminal when a user requested them (by entering a character on the serial terminal).
In this application, MPLAB Harmony Configurator (MHC) was used to configure the SAM E54 and to use the MPLAB Harmony v3 Framework. The clock configurator was used to set up the CPU clock and verify the peripheral clocks. SERCOM3, SERCOM2 were configured as I²C, and Universal Synchronous Asynchronous Receiver Transmitter (USART) respectively. The Pin Configurator was used to set up the pins for the LED and peripheral (USART, I²C) pins. The entire application was built using FreeRTOS and configurations for FreeRTOS threads, stack, and heap size for the application threads were done in this application.
Conclusions
This tutorial provides the training for configuring and using all the fundamental components needed to build a real-time application using FreeRTOS on a SAM E54 microcontroller with the MPLAB Harmony v3 Framework. As a next step, developers may customize this application and reconfigure some of the components used in this tutorial as well as add new components (Drivers, etc.), and additional threads to achieve the desired end application.