3.10.3 Low Power Application on SAM E54 Xplained Pro Evaluation Kit
Description
The application demonstrates, on power-up, the device is set to Standby Sleep mode. The device wakes up from Standby mode and enters Active mode when the user covers the light sensor (by placing a hand over it, for example) on the I/O1 Xplained Pro extension kit. 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. LED0 in the SAM E54 evaluation kit is toggled every time the temperature is displayed on the serial console. When the user presses the switch button SW0, the application switches Sleep mode from Standby mode to Idle mode.
Modules/Technology Used
- Peripheral Modules:
- I2C
- RTC
- USART
- DMAC
- ADC1
- PM
- SUPC
- EIC
- EVSYS
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_e54_xpro.
- Refer the Release Notes to know the MPLAB X IDE and MCC Plugin version.
- Any Serial Terminal application, such as Tera Term terminal application.
- MPLAB Data Visualizer.
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
- Connect the I/O1 Xplained Pro extension kit to the Extension Header 1 (EXT1) of the SAM E54 Xplained Pro evaluation kit.
- 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 ATSAME54P20A.
- 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 (same54_low_power\firmware\sam_e54_xpro.X) in MPLAB X IDE
- Ensure SAM E54 Xplained Pro 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.
- Perform reset by pressing the RESET switch.
- Verify the application title message is
displayed.
- 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.
- Observe Current Consumption on MPLAB
Data Visualizer.Note: The MPLAB Data Visualizer is a program to process and visualize data. The MPLAB Data Visualizer can receive data from various sources, such as the Embedded Debugger Data Gateway Interface (EDBG DGI) and COM ports. It is possible to track an application in run-time using a terminal graph or oscilloscope. It analyzes the power consumption of an application through correlation of code execution and power consumption when used together with a supported probe or board.
- Open the Data Visualizer application
from the MPLAB X IDE and the PIC32CM LE00 Curiosity Pro is visible on the connection
Control Panel.
- In the MPLAB Data Visualizer tab,
different interfaces will appear under the SAM E54 Xplained Pro. Select the Power
interface and click on the Power Settings button. Then, click on Calibrate. After
calibration is complete, click on the Start Capturing Power button. A window will pop
up; select Plot Raw and then click Close
- Ensure that the jumpers for Current
Measurement on the SAM E54 Xplained Pro are set to MEASURE for the MCU and BYPASS for
the I/Os.
- The Power Analysis window will appear
on the MPLAB Data Visualizer tool interface.
- The step image shows the device in
Standby mode with its measured power consumption. The user can observe small peaks that
illustrate the 500 milliseconds Real-Time Clock (RTC) timer expiry.Note: The average value is considered when measuring the power consumption of the device because the instant value is not stable. Then, the power consumption of the device in Standby mode is 130.0 µA.
- Cover the light sensor on the I/O
Xplained Pro board by placing the hand over it (or another element) to print the
temperature on the terminal and observe the power consumption of the device.
- Press the SW0 button to switch from
Standby mode to Idle mode. The following image shows the transition of the power
consumption from Standby mode to Idle mode.
- The following image shows the device in
Idle mode with a measured power consumption of 1.6mA.Note: The user can observe that the small peaks coming from RTC timer expiry disappeared because the power consumption in Idle mode is higher than the power required to start ADC conversion.
- Place the hand over the light sensor.
The device will wake up on the next ADC window monitor interrupt, read and print data on
serial and then re-enter Standby mode. The following image shows the transition of the
power consumption by switching from Idle mode to Standby mode.Note: The above results highlight the power consumption is lower in Standby mode than in Idle mode.
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