sdoapps mod msp430 ccsv6 energy-trace-labs
DESCRIPTION
energy traceTRANSCRIPT
![Page 1: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/1.jpg)
Code Composer Studio
MSP430 Energy Trace Lab Material
TM
![Page 2: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/2.jpg)
LaunchPad: Hardware Setup
Agenda …
Connect mini-USB cablefrom PC to board
![Page 3: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/3.jpg)
Lab Files• Make sure the lab files, containing the code necessary for all labs has
been unzipped and is ready. The recommendation is to keep it (as will be assumed in the following steps) in c:/ti/ccs_workshop/etracelab
• This could create a directory structure as shown below
![Page 4: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/4.jpg)
LAB conventions
• Lab steps are numbered for easier reference1. …2. …
• Explanations, notes, warnings are written in blue
– Warnings are shown with
– Information is marked with
– Tips and answers are marked with
– Questions are marked with
![Page 5: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/5.jpg)
LAB 1: ENERGY TRACE BASICS
30 MINUTES
Open CCS and select the default workspaceYou can close the TI Resource Explorer View (it will not be used)
![Page 6: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/6.jpg)
Lab 1: Exercise Summary• Key Objectives
– What is energy trace– Using energy trace in ccs
• Tools and Concepts Covered– Energy Trace
![Page 7: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/7.jpg)
Workspace• Launch CCS and select a workspace folder
– Defaults to your user folder
![Page 8: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/8.jpg)
Create the Project1. Create a new project in the
CCS Workspace by going to menu Project New CCS Project
2. Fill in the boxes as shown in the image. Select the “Blink the LED” example
3. Click Finish
![Page 9: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/9.jpg)
ULP Advisor Message• A message highlighting the ULP Advisor may appear on project
creation• This message can be ignored• Use the “Do not show this again” checkbox if you do not wish to see
this message again
![Page 10: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/10.jpg)
Debug ‘lab1’ Project1. Click on the “green bug” button –
make sure the project is selected!
![Page 11: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/11.jpg)
Debug ‘lab1’ Project1. Should the ULP message appear (which can be disabled with the ”do not show
again” tickbox) simple select “proceed”
![Page 12: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/12.jpg)
Build, Load/Flash the Program
![Page 13: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/13.jpg)
Open Energy TraceNot all MSP devices support the full energy trace feature set1. Open the Energy Trace view
– View Other->MSP430-EnergyTrace2. Select “Energy Trace”3. Select “ok”
![Page 14: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/14.jpg)
Energy Trace now available
![Page 15: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/15.jpg)
Configure Energy Trace1. The buttons on the console in order from left to right are:
– Enable/Disable Energy Trace– Set capture Time– Save EnergyTrace Data– Load Energy Trace Data– Advanced Options– Toggle between Energy Only Mode and Full Mode (showing state data)
![Page 16: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/16.jpg)
1. Select the “Set Capture Time Button”– Set the capture time to 30s for this example/lab
Configure Energy Trace
![Page 17: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/17.jpg)
Run the code1. Press Run to start the code and energy trace (which is by default in energy
only mode)2. You will see energy trace start up doing a live count and capture
![Page 18: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/18.jpg)
Run the code1. When 30 Seconds have elapsed, double click on energy trace to get full view
![Page 19: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/19.jpg)
Examine the Data and Views1. Examine the data and view available! Main View
![Page 20: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/20.jpg)
Examine the Data and Views1. Energy View
![Page 21: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/21.jpg)
Examine the Data and Views1. Power View
![Page 22: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/22.jpg)
Terminate the Debug Session1. Minimize EnergyTrace and click on the terminate
button to end this session2. This will kill the debugger and return you to the Edit
perspective3. We will now move on to part 2 where we will look at the
full feature (state capture) mode4. We will use the same project!
![Page 23: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/23.jpg)
Debug ‘lab1’ Project1. Click on the “green bug” button
once again– make sure the project is selected! Our terminating the session should have brought you back here!
![Page 24: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/24.jpg)
ULP Advisor Message• A message highlighting the ULP Advisor may appear on project
creation• This message can be ignored• Use the “Do not show this again” checkbox if you do not wish to see
this message again
![Page 25: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/25.jpg)
Debugging a second Time• Note energy trace is still available
![Page 26: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/26.jpg)
1. Select the “Advanced Button” and set preferences as shown
Configure Energy Trace
![Page 27: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/27.jpg)
Run the code1. Press Run to start the code and energy trace (which is by default in energy
only mode)2. You will see energy trace start up doing a live count and capture as previously
![Page 28: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/28.jpg)
Examine the State View1. Maximize and examine the data and view available! State View
![Page 29: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/29.jpg)
Notes1. Explore the energy trace + views and data!
![Page 30: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/30.jpg)
Terminate the Debug Session1. Minimize EnergyTrace and click on the terminate
button to end this session2. This will kill the debugger and return you to the Edit
perspective3. We are finished lab1!
![Page 31: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/31.jpg)
LAB 2: ENERGY TRACE – COMPARING DATA
30 MINUTES
Open CCS and select the default workspaceYou can close the TI Resource Explorer View (it will not be used)
![Page 32: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/32.jpg)
Lab 2: Exercise Summary• Key Objectives
– More advanced energy trace look– Capturing and comparing data to asses the affect of code changes
• Tools and Concepts Covered– Advanced energy trace
![Page 33: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/33.jpg)
Workspace• Launch CCS and select a workspace folder
– Defaults to your user folder
![Page 34: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/34.jpg)
Create the Project1. Create a new project in the
CCS Workspace by going to menu Project New CCS Project
2. Fill in the boxes as shown in the image. Select the “Empty Project” template
3. Click Finish
![Page 35: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/35.jpg)
ULP Advisor Message• A message highlighting the ULP Advisor may appear on project
creation• This message can be ignored• Use the “Do not show this again” checkbox if you do not wish to see
this message again
![Page 36: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/36.jpg)
Add code for lab21. Drag and drop “first.c” and “second.c” into the
empty project just created2. Leave the default “copy files” selected as
shown and ensure the c files are now in the project
3. You should now have the file as part of your project.
![Page 37: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/37.jpg)
Setup Project1. Exclude “second.c” from the build, we will
use this later2. Right click on “second.c” and select
“Exclude from build”3. You should now have the file excluded
![Page 38: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/38.jpg)
Debug ‘lab2’ Project1. Click on the “green bug” button
once again– make sure the project is selected! Our terminating the session should have brought you back here!
2. Enter Debug mode as before
![Page 39: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/39.jpg)
ULP Advisor Message• A message highlighting the ULP Advisor may appear on project
creation• This message can be ignored• Use the “Do not show this again” checkbox if you do not wish to see
this message again
![Page 40: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/40.jpg)
Debug Lab2
![Page 41: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/41.jpg)
Open Energy TraceNot all MSP devices support the full energy trace feature set1. Once in Debug mode, open the
Energy Trace view– View Other->MSP430-EnergyTrace
2. Select “Energy Trace”3. Select “ok”
![Page 42: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/42.jpg)
Energy Trace now available
![Page 43: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/43.jpg)
1. Select the “Set Capture Time Button”– Set the capture time to 30s for this example/lab
Configure Energy Trace
![Page 44: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/44.jpg)
Run the code1. Press Run to start the code and energy trace (which is by default in energy
only mode)2. You will see energy trace start up doing a live count and capture
![Page 45: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/45.jpg)
Save Energy Trace Data1. Once the 30s capture is done, select “save current energy profile”2. You will be asked to name and locate your file, leaving the default is fine, so
select “save”, but remember where it is!
![Page 46: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/46.jpg)
Terminate the Debug Session1. Minimize EnergyTrace and click on the terminate
button to end this session2. This will kill the debugger and return you to the Edit
perspective3. We will now use the other more energy efficient piece of
code we pasted and compare! This version does not use delays and does use low power modes.
![Page 47: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/47.jpg)
Setup Project1. Exclude “first.c” from the build, we already
have the data2. Right click on “first.c” and select “Exclude
from build”3. You should now have the file excluded
![Page 48: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/48.jpg)
Setup Project1. Include “second.c” from the build, we will
use this later2. Right click on “second.c” and select
“Exclude from build” again to reinclude the file.
3. You should now have the file included and ready to capture this data
![Page 49: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/49.jpg)
Debug Lab2
![Page 50: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/50.jpg)
Run the code1. Press Run to start the code and energy trace (which is by default in energy
only mode)2. You will see energy trace start up doing a live count and capture3. Note energy trace is still set to 30s
![Page 51: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/51.jpg)
Save Energy Trace Data1. Once the session reaches the 30s, select “save current energy profile”2. You will be asked to name and locate your file, leaving the default is fine, so
select “save” but remember where!
![Page 52: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/52.jpg)
Load Energy Trace Data1. Open the previous data from the non efficient version which we just saved by
selecting “load reference energy profile”2. You will be asked to select and locate your file, so select the file we just created
with “first.c”
![Page 53: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/53.jpg)
Examine the Data and Views1. Double click to expand energy trace to full view and see the views/comparison
![Page 54: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/54.jpg)
Examine the Data and Views1. See how much more efficient the second.c code is
![Page 55: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/55.jpg)
Examine the Data and Views1. See how much more efficient the second.c code is
![Page 56: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs](https://reader030.vdocuments.site/reader030/viewer/2022020401/56d6bf4a1a28ab301695a688/html5/thumbnails/56.jpg)
Terminate the Debug Session1. Minimize EnergyTrace and click on the terminate
button to end this session2. This will kill the debugger and return you to the Edit
perspective3. We are finished lab2!