sdoapps mod msp430 ccsv6 energy-trace-labs

56
Code Composer Studio MSP430 Energy Trace Lab Material TM

Upload: waqas-ali-khan

Post on 14-Apr-2016

217 views

Category:

Documents


1 download

DESCRIPTION

energy trace

TRANSCRIPT

Page 1: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

Code Composer Studio

MSP430 Energy Trace Lab Material

TM

Page 2: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

LaunchPad: Hardware Setup

Agenda …

Connect mini-USB cablefrom PC to board

Page 3: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

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

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

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

Workspace• Launch CCS and select a workspace folder

– Defaults to your user folder

Page 8: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

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

Debug ‘lab1’ Project1. Click on the “green bug” button –

make sure the project is selected!

Page 11: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

Build, Load/Flash the Program

Page 13: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

Energy Trace now available

Page 15: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

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

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

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

Examine the Data and Views1. Examine the data and view available! Main View

Page 20: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

Examine the Data and Views1. Energy View

Page 21: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

Examine the Data and Views1. Power View

Page 22: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

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

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

Debugging a second Time• Note energy trace is still available

Page 26: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

1. Select the “Advanced Button” and set preferences as shown

Configure Energy Trace

Page 27: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

Examine the State View1. Maximize and examine the data and view available! State View

Page 29: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

Notes1. Explore the energy trace + views and data!

Page 30: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

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

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

Workspace• Launch CCS and select a workspace folder

– Defaults to your user folder

Page 34: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

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

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

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

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

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

Debug Lab2

Page 41: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

Energy Trace now available

Page 43: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

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

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

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

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

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

Debug Lab2

Page 50: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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

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

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

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

Examine the Data and Views1. See how much more efficient the second.c code is

Page 55: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

Examine the Data and Views1. See how much more efficient the second.c code is

Page 56: Sdoapps Mod Msp430 Ccsv6 Energy-trace-labs

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!