Low Power Application on SAMC2x using Harmony v3 Peripheral Libraries: Step 7

Step 7.1: Build and program the application

1

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

In case of compilation errors, recheck the steps and build the project again.

2

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

3

Open the Tera Term application on your PC. Navigate to File > New connection > Serial. Select COM PORT (Embedded Debugger (EDGB) Virtual COM Port) and press OK to make a serial connection open. Go to Setup > Serial port… and make sure the baud rate is set to 115200.

com_port_selection.png

4

Cover the light sensor on the IO Xplained Pro board (by placing your hand over it) to print the temperature on the terminal.

hardware_demo.png

You should see the temperature values (in °F) getting printed on the terminal every 500 milliseconds for the duration the light sensor is covered, as shown below.

result1.png

Step 7.2: Observe current consumption on Data Visualizer

The Data Visualizer is a tool used to measure the power consumption of the device.

The Data Visualizer is a program to process and visualize data. The Data Visualizer is capable of receiving data from various sources such as the EDBG Data Gateway Interface (DGI) and COM ports. Track your application's run-time using a terminal graph or oscilloscope, or analyze the power consumption of your application through correlation of code execution and power consumption, when used together with a supported probe or board. Having full control of your codes’ run-time behavior has never been easier.

Download and install stand alone Data Visualizer Here.

1

Open Data Visualizer application from your PC and select Power Debugger Data Gateway on DGI Control Panel.

data_visualizer.png

2

Click on the Connect button to have the Data Visualizer ready to receive information from the Power Debugger Data Gateway.

dvconnect.png

3

After the Data Visualizer is connected to the Power Debugger Data Gateway, select the Power interface and click on the Start button.

dvstart.png

4

On the right-hand side of the Power Analysis window, click on the Control Panel tab and Disable Channel B.

Below image shows the device in Standby mode, smaller peaks are the 500ms timer expiry peaks.

standby_mode.png

Cover the light sensor on the IO Xplained Pro board (by placing your hand over it) to print the temperature on the terminal. The following image shows the power consumption values in Standby mode and CPU Active mode.

dvresult1.png

Press Switch SW0 to switch from Standby mode to Idle mode. The following image shows the transition power consumption values from Standby to Idle mode. Idle mode consumes more power compared to Standby mode.

dvresult2.png

Place your hand nearer to the light sensor. Device wakes up, reads and prints temperature value on serial console, and re-enters the Standby mode. The following image shows the transition power consumption values from Idle to Standby mode.

dvresult3.png

5

Note that from above results the power consumption is low in Standby mode compared to Idle mode.

Step 7.3: Wake Up time measurement using Logic Analyser/CRO

Logic Analyser or CRO can be used to measure device wake up time.

1

Relatively, the wake-up time is more in Standby mode compared to Idle mode, since CPU and all peripherals will be stopped.

To demonstrate the CPU wake up time, switch SW0 is configured to generate an interrupt. A General Purpose Input/Output (GPIO) is toggled in the Interrupt Service Routine (ISR) of the switch press event. The MCU comes out of the Sleep mode when an interrupt occurs (in this case, the switch press interrupt). The time between the switch press and the GPIO toggle in the ISR is wake up time.

Press the switch SW0 and capture the signals to measure the wake-up time in Standby and Idle mode.

Setup Trigger (High to Low) on SWITCH0 probe is configured to capture the signals.

The following image shows the time taken to wake up the device from Standby mode.

lgresult1.png

The following image shows the time taken to wake up the device from Idle mode.

lgresult2.png

By observing the outputs, you can conclude that wake-up time is more in Standby mode compared to Idle mode.

 Results

You successfully created a low power application using SAMC21 Xplained Pro Evaluation Kit and I/O1 Xplained Pro Kit and experienced how, where, and which Low Power mode to use depending on the application requirements like power and wake up response times.

 Analysis

In this lab, you have successfully created a project from scratch, added Peripheral Libraries (PLIBs) and learned how to use an Event System to drive events received from the peripherals without CPU intervention. You also learned how to configure a device to work in Sleep modes and measure wake up time.

 Conclusions

In this tutorial, you discovered how to configure the device to work in Sleep modes, this tutorial can be used as a reference when you develop a real-time application where the power and wake up response time plays a crucial role.

© 2019 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.