3.6.3 Low Power Application on SAM E51 Curiosity Nano Evaluation Kit with OLED C Click Board for Display Using MPLAB Harmony Legato Graphics
Description
In this application demonstration, the SAM E51 MCU is configured to operate in low power standby sleep mode on power-up. The device wakes up from standby mode and enters active mode when the user covers the light sensor (placing a hand over it, for example) on the I/O1 Xplained Pro extension kit.
When the light sensor is covered, the device reads the room temperature using temperature sensor on the I/O1 Xplained Pro extension kit and displays it on the OLED C Click display board. The application periodically prints room temperature on a serial terminal while the light sensor is covered.
The device goes back to standby mode when the user uncovers the light sensor. The temperature read is displayed on the OLED C Click and on the serial console. LED0 in the SAM E51 Curiosity Nano Evaluation Kit is toggled every time the temperature is displayed on the OLED C Click. When the user presses the switch button SW0, the application switches Sleep mode from Standby to Idle mode.
Modules/Technology Used
- Peripheral Modules
- I2C
- RTC
- USART
- DMAC
- ADC0
- PM
- SUPC
- EIC
- EVSYS
- SPI
- SysTick
- Timer
- Legato graphics
- LE External controller
Hardware Used
Software/Tools Used
This project has been verified to work with the following versions of software tools:
Refer Project Manifest present in harmony-manifest-success.yml under the project folder firmware/src/config/sam_e51_cnano.
- Refer the Release Notes to know the MPLAB X IDE and MCC Plugin version.
- Any Serial Terminal application, such as Tera Term terminal application.
Because Microchip regularly updates tools, occasionally issue(s) could be discovered while using the newer versions of the tools. If the project does not seem to work and version incompatibility is suspected. It is recommended to double-check and use the same versions that the project was tested with. To download original version of MPLAB Harmony v3 packages, refer to document How to Use the MPLAB Harmony v3 Project Manifest Feature (DS90003305).
Setup
- Mount SAM E51 Curiosity Nano Evaluation Kit on CNANO56_HOST_CONN (U3) connector of Curiosity Nano Base board.
- Mount OLED C Click board on mikro bus click 1 connector of Curiosity Nano Base board.
- Connect the I/O1 Xplained Pro extension kit to the Extension Header 1 (EXT1) connector of Curiosity Nano Base board.
- Connect a USB cable to the DEBUG USB
port for programming.
Programming Hex File
The pre-built hex file can be programmed by following the below steps.
- Open MPLAB X IDE
- Close all existing projects in IDE, if any project is opened
- Go to File -> Import -> Hex/ELF File.
- In the Import Image File
window,
- Create Prebuilt Project,
- Click the Browse button to select the prebuilt hex file.
- Select Device as ATSAME51J20A.
- Ensure the proper tool is selected under Hardware Tool and click on Next button.
- Select Project Name and Folder,
- Select appropriate project name and folder and click on Finish button
- Create Prebuilt Project,
- In MPLAB X IDE, click on Make and Program Device button to program the device.
- Follow the steps in Running the Demo section below.
Programming/Debugging Application Project
- Open the project (same51n_low_power_with_oled_c_click/firmware/sam_e51_cnano.X) in MPLAB X IDE.
- Ensure SAM E51 Curiosity Nano is selected as hardware tool to program/debug the application.
- Build the code and program the device by clicking on the Make and Program Device button in MPLAB X IDE tool bar.
- Follow the steps in Running the Demo section below.
Running the Demo
- Open Tera Term, connect to serial console. If there is any connection issue on tera terminal, unplug the USB cable connected to Micro-B port, and reconnect it back.
- Change the baud rate to 115200.
- After power up, the application displays the temperature on OLED C Click board.
- Verify the application title message
with the current temperature value displayed on Serial Console.
- Cover the light sensor on the I/O
Xplained Pro board by placing the hand over it (or another element to put the light
sensor in a dark environment) to print the temperature and message on the
terminal.The user should see the following messages (containing the temperature value in °F) on the terminal every 500 milliseconds for the duration the light sensor is covered,
- Press the switch button SW0, the
application switches Sleep mode from Standby mode to Idle mode.Cover the light sensor on the I/O Xplained Pro board by placing the hand over it to wakeup and print the temperature and message on the terminal.
- When the device reads the room temperature and prints it on the serial terminal, the temperature is displayed on the OLED C Click board.
- This application demo does not provide the power consumption values of SAM E51 MCU in standby or idle sleep mode. Interested users could refer Low Power Application on SAM E54 (Cortex M4) MCUs UsingMPLAB Harmony v3 Peripheral Libraries for power consumption numbers presented for an MCU (SAM E54) of the same family as SAM E51.
Comments
- Reference Training Module:
- This application demo builds and
works out of box by following the instructions above in Running the Demo
section. If the user needs to enhance/customize this application demo, should use the
MPLAB Harmony v3 Software framework. Refer links below to setup and build the
applications using MPLAB Harmony.
- How to Setup MPLAB Harmony v3 Software Development Framework (DS90003232).
- How to Build an Application by Adding a New PLIB, Driver, or Middleware to an Existing MPLAB Harmony v3 Project (DS90003253).
- Video - How to Set up the Tools Required to Get Started with MPLAB® Harmony v3 and MCC
- Create a new MPLAB Harmony v3 project using MCC
- Update and Configure an Existing MHC-based MPLAB Harmony v3 Project to MCC-based Project