Everything
2.17 Measuring Current Consumption [E2][Simulator]

Measurement of current consumption refers to measuring the amount of current consumption by a whole system to be debugged [E2] or peripheral modules of within the MCU [Simulator].

Remark

Measuring current consumption by the simulator is only available for devices that have peripheral function simulations. Check which products are supported on the Renesas Web site.

 

[How to use]

The target for measurement differs between the use of the E2 emulator and the simulator.

The following explains the usage in both cases.

 

 

-

With the E2 emulator

In using the E2 emulator to measure current consumption, the current values in the target system as a whole are measured.

For measurement of current consumption, the facility for supplying power to the target by the E2 emulator and the E2 expansion interface are used.

Accordingly, to use this facility, be sure to specify [Yes] for the [Power target from the emulator (MAX 200mA)] property and [Use supplied power from the emulator] for the [Interface for supplying the power] property on the [Connect Settings] tab in the Property panel before connecting the debug tool.

(1)

Open the Measuring Current Consumption panel

Select [RL78 E2] as the debug tool, open the Solution List panel, and click on the [GO] button for measuring current consumption. The Measuring Current Consumption panel [E2][Simulator] will open.

Figure 2.164

Measuring Current Consumption Panel [E2]

(2)

Set the conditions (measurement conditions, trigger conditions, and monitoring points)

In measuring current consumption, you can acquire the pattern of transitions for the current value to be detected by setting conditions in advance. The main settings that can be made in advance are measurement conditions, trigger conditions, and monitoring points.

Remark

Conditions are set as follows by default.

Operation after record memory is full: Overwrite to the record memory and continue execution

Sampling time: 10us

Acquisition condition: All

No external trigger is used.

No monitoring points are set.

 

If you only want to measure the current as a trial, start the procedure from "(3) Start measurement".

(a)

Set the measurement conditions

Set conditions regarding the recording of the measured current values in the Current Consumption Measurement Condition Setting dialog box [E2] which is displayed by clicking on on the toolbar in the Measuring Current Consumption panel [E2][Simulator].

Figure 2.165

Current Consumption Measurement Condition Setting Dialog Box

<1>

Select the operation after recording memory becomes full

Select any operation from among the following after the memory used to record the current values in the E2 emulator becomes full.

-

Overwrite to the record memory and continue execution

-

Stop recording (continue to execute the program)

-

Stop program

<2>

Select the sampling time

Select the sampling time for use in measurement from among the following.

1us, 2us, 5us, 10us, 20us, 50us, 100us, 200us, 500us, 1ms

<3>

Select the acquisition condition

An acquisition condition for recording the current values in the memory of the E2 emulator can be set so that recording only starts when the specific condition has been satisfied.

The condition can be selected as one of the following.

-

All

Record all current values that have been sampled after starting measurement without specifying specific conditions.

-

During detecting an external trigger input

This item selects recording in memory in response to the external trigger input facility of the E2 expansion interface only while the specified signal is being detected.

When this is specified, the channel for input of the external trigger to be detected and the level of the signal to be detected must be specified.

In addition, the external trigger input must have been correctly set before the debug tool is connected.

Remark

For details on setting the external trigger input facility of the E2 expansion interface, refer to the Application Note on the Current Consumption Tuning Solution (E2 Emulator, CS+).

-

During monitor points

Specify the monitoring point to serve as the start condition in the left entry field and that to serve as the end condition in the right entry field against [Monitor points range].

The current values will be recorded from detection of the monitoring point specified as the start condition until detection of the monitoring point specified as the end condition.

For details on the monitoring points, refer to "(c) Set monitoring points".

(b)

Set the trigger condition

The E2 emulator is able to stop the program or output an external trigger signal in response to the value for current being measured satisfying a specific condition.

Set the trigger condition in the Current Consumption Measurement Trigger Condition Setting dialog box [E2], which is displayed by clicking on on the toolbar in the Measuring Current Consumption panel [E2][Simulator].

Figure 2.166

Current Consumption Measurement Trigger Condition Setting Dialog Box

<1>

Specify whether to use the trigger facility

Select the checkbox for [Use trigger function] to use the trigger facility.

This checkbox is de-selected by default.

<2>

Set the trigger action

Select the operation when a trigger is detected as either of the following.

-

Stop program

Stop execution of the program.

-

Output external trigger signal

Output an external trigger through the E2 expansion interface.

 

Also make the following settings if an external trigger is to be output.

-

Select a channel

Specify the channel for output of the external trigger through the E2 expansion interface.

-

Select the type of signal to be output

Select whether a high pulse is to be output in response to the condition being satisfied or output of the high level is to continue as long as the condition is being satisfied.

When a high pulse is to be output, also specify the pulse width.

Remark

For details on the external trigger output facility, refer to the Application Note on the Current Consumption Tuning Solution (E2 Emulator, CS+).

<3>

Set the trigger condition

Select the trigger condition for the current value as [Over Threshold], [Under Threshold], [In Range], or [Out of Range].

Specify the current value or range of current values to be detected as the trigger.

Caution

For a range of current values, the value entered in the left field for entry must be lower than that in the right field.

 

As well as the condition for the current value, a sub-condition (condition for the detection width) regarding the time over which the condition is satisfied can be set. Specifying a width for detection can eliminate the detection of noise that temporarily satisfies the condition.

The condition for the detection width is selectable as [Over threshold] (detecting the current value when the condition continues to be satisfied for more than a specified time) or [In range] (detecting the current value when the condition is satisfied over a time within the specified range).

 

Specify a multiple of the sampling time as the detection width.

Note that the actual time for detection also depends on the sampling time.

(c)

Set monitoring points

A monitoring point is a facility for recording a timestamp when a specified line of source code is run.

When monitoring points are set, transitions of the execution time and the current values at the monitoring points can be confirmed on a graph for measuring current consumption.

The monitoring points are indicated by colored vertical lines on the graph.

Remark

Monitoring points are not supported for RL78/G10 devices.

Figure 2.167

Monitoring Point

 

Monitoring points are set from [Monitor Point Setting] in the context menu after placing the cursor on the line of the target source code that was opened in the Editor panel.

Figure 2.168

Context Menu in the Editor Panel

 

A list of the monitoring points that are currently set is displayed under the Measuring Current Consumption panel [E2][Simulator].

The monitoring points that have been set are enabled or disabled by the leftmost checkbox in this list or from the context menu of the Editor panel.

Figure 2.169

List of Monitoring Points

 

Monitoring points must be set at the addresses of NOP instructions. An attempt to set monitoring points at other instructions or the debug tool not being able to detect the NOP instruction even if it is set as a monitoring point leads to the monitoring points being forcibly disabled when measurement is started.

However, when the compiler in use for the project is V1.05.00 or later of CC-RL and when the source file is registered in the active project, the NOP instructions can be automatically inserted at the addresses where the monitoring points are set before measurement, rebuilding and downloading are enabled. In this case, monitoring points that have been set at any addresses are enabled. However, when the [CPU Reset after download] property in the [Download] category on the [Download File Settings] tab in the Property panel is set to [Yes], note that the monitoring points are forcibly reset by rebuilding and downloading.

(3)

Start measurement

Start measuring current consumption by the target system by using the facilities of the E2 emulator.

Click on or on the toolbar in the Measuring Current Consumption panel [E2][Simulator].

Figure 2.170

Toolbar in the Measuring Current Consumption panel [E2]

 

Caution

Current consumption is not measured by clicking on in the Main window.

 

(a)

Clicking on

The project is rebuilt and downloaded before measurement starts.

However, if the device does not support monitoring points or the compiler used in the active project is a version of CC-RL earlier than V1.05.00, rebuilding and downloading do not proceed.

When [Hold the build options for monitor point specified when measuring] in the Measuring Current Consumption panel [E2][Simulator] is selected, the options which are specified for rebuilding and downloading before measurement are reflected in the [Parameters of NOP instruction insertion for measuring current consumption] property of the build tool.

(b)

Clicking on

The project is not rebuilt and downloaded before measurement starts.

Select this button when you want to measure current consumption without resets due to rebuilding and downloading.

Note that this button is not displayed if the device does not support monitoring points or the compiler used in the active project is a version of CC-RL earlier than V1.05.00.

(4)

End measurement

Measurement ends at the same time as execution of the program is stopped.

Execution of the program can be stopped by setting a breakpoint or a trigger condition, or by clicking on .

(5)

Display a graph

At the same time as measurement ends, a graph of current values showing the results of measurement is displayed in the graph display area of the Measuring Current Consumption panel [E2][Simulator].

Check that the current values that are shown are as intended.

 

In the panel, dragging a cursor (the red vertical line) shows the time and the current value at the cursor location in the information display area.

When the search facility is used, since the cursor is moved to the location where the search condition was satisfied, the time and the current value at that location can be confirmed.

Markers A and B (green vertical dashed lines) can also be dragged to confirm the average current and maximum current between the markers.

When a monitoring point is the target of the search, the location where processing to be confirmed was executed can be identified immediately.

 

 

-

With the simulator

When current consumption is measured on the simulator, the current values in the MCU are simulated and displayed.

(1)

Open the Measuring Current Consumption panel

Select [RL78 Simulator] as the debug tool, open the Solution List panel, and click on the [GO] button for measuring current consumption. The Measuring Current Consumption panel [E2][Simulator] will open.

Figure 2.171

Measuring Current Consumption Panel [Simulator]

(2)

Enable measurement of the current consumption

The facility for measuring current consumption is enabled or disabled by clicking on on the toolbar in the Measuring Current Consumption panel [E2][Simulator].

Enabling the facility simulates the current values when the program is executed.

Figure 2.172

Toolbar in the Measuring Current Consumption Panel [Simulator]

 

Remark

The facility for measuring current consumption is disabled immediately after the debug tool is connected.

 

(3)

Start measurement

After the facility for measuring current consumption is enabled, measurement proceeds during normal execution of the debugger initiated by, for example, clicking on or on the toolbar in the Main window.

Remark

Furthermore, measurement also proceeds in response to operations that place the debug tool in the execution state, e.g. source-level step execution.

(4)

End measurement

Measurement ends at the same time as execution of the program is stopped.

Execution of the program can be stopped by setting a breakpoint, or by clicking on .

(5)

Display a graph

At the same time as measurement ends, a graph of current values showing the results of measurement is displayed in the graph display area of the Measuring Current Consumption panel [E2][Simulator].

Check that the current values that are shown are as intended.

 

In the panel, dragging a cursor (the red vertical line) shows the time and the current value at the cursor location in the information display area.

When the search facility is used, since the cursor is moved to the location where the search condition was satisfied, the time and the current value at that location can be confirmed.

Markers A and B (green vertical dashed lines) can also be dragged to confirm the average current and maximum current between the markers.

In addition, hovering the mouse cursor over a point on the graph displays a pop-up window showing the current value in each peripheral module at that point. This makes it possible to confirm that the intended modules have been enabled.

Figure 2.173

Displaying the Values for Current Consumption by Individual Modules