CC3100 Power Management Optimizations and Measurements

From Texas Instruments Wiki
Jump to: navigation, search
Cc31xx cc32xx return home.png
Cc31xx return sample apps.png

Introduction

The CC3100 SimpleLink Power Management Measurement application provides users the ability to configure the device in various low power modes and profiles, for the purposes of current consumption measurements. The user can choose to work in the Interactive (simple) mode or to use the advanced mode, where they can change the define values in the source code in order to control the behavior of the application. The application has recommended guidelines on how to optimize the power consumption for the different power profiles.
The system's various basic power modes are first explained. These are the building blocks of all power management profiles.

  • Hibernate
  • Low power deep sleep (LPDS)
  • Active modes (Rx or Tx)

The various power profiles are the focus of this document:

  • Always connected (a.k.a. Idle Connected)
  • Intermittently connected
  • Transceiver mode

NoteNote: The focus is on periodic/repetitive events because one-time events, no matter how high they peak, do not need to be taken into account, since their influence is negligible for longer periods of activity.

Getting started

All instructions in this document are under the assumptions that the user already has a working environment of CC3100 BoosterPack attached to the MSP430 LaunchPad, and that he installed all the relevant software packages. Otherwise, please refer to CC3100 getting started user guide, before proceeding.

Pre-requisites

Hardware

  • CC3100 Boosterpack Rev 3.3 or above
  • MSP430F5529LP
  1. Oscilloscope with differential probe or current probe
  2. Digitial multimeter (capable of measuring down to 1 uA)

Software

  • CC3100 SDK, which contains
    • CC3100 ServicePack
    • CC3100 SDK
    • CC3100 Power Management Optimizations and Measurements source code

The power management application is released as a stand alone CC3100 application, which is integrated within the CC3100 SDK folder during installation. Import it into your environment (code composer /IAR), as any other project described in the getting started user guide.

Basic System Power Modes

The following section describes the CC3100 active and low power static modes. The CC3100 device contains only the Networking sub-system and it is self-contained in terms of power optimization. The following system modes are defined and could be measured on TI's EVM boards. There are three main basic system power modes, which constitute the main building blocks of all power related application profiles.

  • Hibernate
  • Low Power Deep Sleep (LPDS)
  • Active: RX & Tx

More details can be found at: SimpleLink™ CC3100/CC3200 Wi-Fi Internet-on-a-chip™Networking Sub-System Power Management

Hibernate State

Hibernate configuration example

The hibernate mode represents the lowest power state of the device. In this mode, memory is not retained, and wake up requires a cold boot initialization. The device is powered off except for the hibernate logic. RTC clock keeps running and RTC counter keeps counting. The CC3100 provides a simple and easy method to measure the hibernate current.

The application enables the user to enter a constant Hibernate state for an easy measurement of the power consumption of this state.

To do so, configure g_ActiveUseCase to "HIBERNATE_MEASURE" in the PM management benchmark code.

Measurement Tool
Follow the steps mentioned in the static current measurements section, in order to record the hibernate current.

Expected Results
The expected power consumption numbers are described in the datasheet.

LPDS state

LPDS configuration example

In this mode, the voltage levels are lowered, and the fast clocks (40 MHz XTAL and internal PLL) are off. Memories are in retention mode. Device stays in low power deep sleep (LPDS) mode if the Wi-Fi and NWP blocks have no immediate activity. Each of them manages its own sleep and wakeup events, and when both are in their low power mode, the entire Networking sub-system is in LPDS mode.

The application enables the user to enter a constant Sleep mode (no traffic) to enable an easy way to measure the power consumption of this state.
To do so, configure g_ActiveUseCase to "SLEEP_MEASURE" in the PM management benchmark code

Measurement Tool
Follow the steps mentioned in the static current measurements section, in order to record the LPDS current.

Expected Results
The expected power consumption numbers are described in the datasheet.

Active (Rx & Tx) States

The device is fully active, voltage levels are at their operational value, and all clocks are ticking. At least one block (NWP / Wi-Fi) is running. The two main active modes are transmitting (TX) and receiving (RX). The Tx and Rx active currents vary based on the channel, packets type, etc...

Configuration Parameter
In order to individually measure the the Tx and Rx current consumptions, please refer to the Appendix section of Using radiotool for active modes.

Follow the steps mentioned in the Profiles and Active current measurements section, in order to measure the average current consumption, for each of the active mode.

Expected Results
The expected power consumption numbers for each Rx and Tx states are described in the datasheet.

Power Profiles Use Cases

The Power Profiles use cases combine various power state to emulate the behavior of a real application in an end product. This section describes how to emulate, optimize, and measure such profiles. We will focus on these three main profiles:

  • Idle Connected
  • Intermittently Connected
  • Transceiver Mode

End product's applications have various power requirements, which drive the duration of the active states and inactive periods. The system's latency, or the response time, is another common requirement, which focuses on how fast a device can wake up from inactive mode and be fully functional. Thus, it is important to architect multiple low power inactive modes depending upon all the possible use cases of the end product. In other words, the low power mode used in the system is determined by the end product's application properties.

Follow the steps mentioned in the Profiles and Active current measurements section, in order to measure the average current consumption, for each of these profiles.

Use Case 1: Always Connected

Always Connected

The always connected profile deals with situations where the device must stay connected to the access point (AP) at any time. Staying connected may cause a high power consumption due to periodic beacon functionality. In this profile, the system will enter LPDS mode between wakeups for activity since the system state needs to be kept and low latency is required.

To optimize your use case please implement below configurations:

  • LSI (Long Sleep Intervals) – A configuration that enable to wake the device up only on every n-th beacon thus providing longer Sleep periods.
Implementation: Use the sl_WlanPolicySet and configure SL_POLICY_PM to LSI. Can be added to the “configureSimpleLinkToDefaultState” function” in the main.c file


  • mDNS - Upon connection to an AP, NWP automatically starts advertising itself by sending mDNS packets. Stop the mDNS feature when it is not required by the system application for power optimization.
Implementation: Stopping the mDNS feature is done using the sl_NetAppStop API, and can be done once as an indication is stored in NVMEM. Can be updated in the “configureSimpleLinkToDefaultState” function” in the main.c file

A good representation of a code for such case is:

//Configurations - This section is done once
sl_start(0,0,0);
sl_WlanPolicySet(...); // configure the time interval between wakeups
sl_socket();
sl_SetSocketOpt();     // configure UDP/TCP Secured or not
sl_bind();
 
// Sending/Receiving Data - Done when packet need to be sent or received
while (1) {
    sl_Send();         // can be UDP/TCP and/or secure connection 
    sl_Recv();         // can be UDP/TCP and/or secure connection
    Delay();
}

Configuring Options

Always connected configuration example.jpg

There is one define value that configures the behavior of the device in this case:

  • LSI_SLEEP_DURATION_IN_MSEC – define the sleep period between each wake-up for beacon reception.
Example: "#define LSI_SLEEP_DURATION_IN_MSEC 500" will set it to 500 milliseconds.

A detailed configuration example for always connected use case is shown in the Always connected configuration example figure; the relevant settings are emphasized.

Expected Results

Parameter Description
Setup & scenario info The AP connection security is open. Device is in Idle profile (beacons receive only).

Beacon interval is 102mS

Average current consumption (steady-state) 0.695 mA
Electric charge consumption of one active cycle 0.05 mC (one Beacon reception)
Remarks By default the device is listening on a UDP socket for incoming packets. The user can configure TCP with or without SSL socket as well.

NoteNote: The option with SSL sockets requires a peer server.

The following figure describes the use case profile

CC3100 Always connected idle profile
CC3100 Always connected idle profile ZoomIn.jpg





Use Case 2: Intermittently Connected

Intermittently Connected

This profile is for devices that need to operate between long time intervals. In this mode, the device is in Hibernate state between working cycles, the lowest power consumption possible state. Almost all the device's components are shut-down, hence when waking up a new connection needs to be established. Optimizations were integrated in order to reduce the power consumption cost of this periodic reconnection, these are:

  1. Working with static IP (when possible) in order avoid DHCP.
  2. Set the connection policy to work with fast connect, which means that the device will first try to re-establish the previous connection.
  3. Disable Scan, as in this case we probably stay in the same channel & network (AP).
  4. Disable mDNS.

A good representation of a code for such case is:

//Configurations Done once – every exit from hib
sl_start(0,0,0); 
sl_NetCfgSet() ;      // set static IP address to the device
sl_WlanPolicySet(...); // disable scan
sl_WlanPolicySet();   // set fast connect
sl_NetAppStop(..);     // disable mDNS
 
//Sending/Receiving Data - Done when packet need to be sent or receive
while (1) {
    sl_stop(10);       // to enter hibernate mode
    Delay();           // Long hibernate Time period
    sl_Start();        // device wake up and connect to network with previous setting  
    sl_socket();       // usually UDP 
    sl_SetSocketOpt(); // configure UDP/TCP Secured or not
    sl_bind();   
    sl_RecvFrom();  
    sl_SendTo();
    sl_Close();
}

Configuration Options

Intermittently Connected configurations example

The define value that configures the behavior of the device in this case:

  • NOT_ACTIVE_DURATION_IN_MSEC – defines the hibernate time period between 2 active states.
Example: "#define NOT_ACTIVE_DURATION_IN_MSEC 800"' will set 800 milliseconds hibernate time periods.

A detailed configuration example for intermittently connected use case is shown in Intermittently Connected configurations example figure; the relevant settings are emphasized.

Expected Results

UDP Packet

Parameter Description
Setup & scenario info Device wakes up from hibernate every 5 seconds, and transmits 1 packet on UDP socket.

The AP connection security is open.

Average current consumption (steady-state) 0.98 mA
Electric charge consumption of one active cycle 3.8 mC

The following figure describes the use case profile:

CC3100 Intermittently connected 1 UDP packet

TCP Packet

Parameter Description
Setup & scenario info The AP connection security is open.

Device wakes up from hibernate every 5 seconds. Establishes a TCP and SSL connection, and then transmit 1 TCP secured packet. The SSL version is SSLv3, and the cipher is "RSA_WITH_RC4_128_SHA".

Average current consumption (steady-state) 2.4 mA
Electric charge consumption of one active cycle 13.3 mC
Remarks This examples requires a peer server.

See Appendix section on how to setup a server with Python scripts.

The following figure describes the use case profile:

CC3100 Intermittently connected 1 TCP packet with SSL

Use Case 3: Transceiver Mode

Transceiver Mode

For Transceiver mode a connection to standard Wi-Fi network is not required. The device is in hibernate state between operation times, and the socket in use is RAW hence not requires use of networking services. In this mode we can configure some MAC/PHY attributes like:

  • Ignore CCA (Clear channel Assessment).
  • Set CCA threshold.
  • Set Tx timeout.
  • Do channel tune.
  • Set TX power.
  • Set TX rate.

The tweaks made in this mode for power optimization are:

  • Setting the PM policy to "SL_LOW_POWER_POLICY".
  • Setting the connection policy to all zeroes, as connection is not required.
  • The device is in hibernate state between operation.

To optimize transceiver mode please use below configurations:

  1. Ignore CCA – While sending a packet in transceiver mode, CCA can be checked or bypassed. For power optimized configure device to bypass CCA.
    Can be configured in the sl_Socket by choosing RAW or DGRAM socket.
  2. Set TX Power - Tx output power can be configured in order to reduce the current consumption, there are 15 steps
    Note: Can be set by configuring SL_RAW_RF_TX_PARAMS in the sl_Send command
  3. Set TX Rate – Transmission rate of the packet can be configured to reduce TX period and thus saving current.
    Note: Can be set by configuring SL_RAW_RF_TX_PARAMS in the sl_Send command

A good representation of a code for such case is:

//Configurations - Done once
sl_start(0,0,0); 
sl_WlanPolicySet(...);  // set "SL_LOW_POWER_POLICY"
sl_WlanPolicySet();    // set all connection option to zero
 
// Sending/Receiving Data - Done when packet need to be sent or received
while (1) {
    sl_stop(10);        // Enter hibernate mode
    Delay();            // Long hibernate Time period
    sl_Start();  
    sl_socket();        // Raw socket 
    sl_SetSockOpt();   // Optional setting CCA threshold & TX timeout
    sl_Send();          // TX param are passed also
}

Configuration Options

Transceiver mode configurations
PHY/MAC/L2 packet attributes configuration example

The define values that configure the behavior of the device in this case:

  1. TAG_TUNED_CHANNEL – defines the channel number the device will work and do channel tune.
    Example: " #define TAG_TUNED_CHANNEL 1" will set the working channel to be channel 1.
  2. NOT_ACTIVE_DURATION_IN_MSEC – defines the hibernate time period between 2 active states.
    Example: "#define NOT_ACTIVE_DURATION_IN_MSEC 800" will set 800 milliseconds hibernate time periods.
  3. TAG_FRAME_LENGTH - Tag frame data length.
    Example: "#define TAG_FRAME_LENGTH 50" will set the data length to 50.
  4. TAG_FRAME_TRANSMIT_RATE – the PHY rate to be used.
    Example: "#define TAG_FRAME_TRANSMIT_RATE 6" will set mcs 6 or equivalent legacy rate.
  5. TAG_FRAME_TRANSMIT_POWER - TX Power to be used.
    Example: "#define TAG_FRAME_TRANSMIT_POWER 7" will set the TX power.

A detailed configuration example for transceiver mode use case is shown in Transceiver mode configurations figure; the relevant settings are emphasized. A detailed configuration of MAC/PHY and L2 packet attributes is shown in PHY/MAC/L2 packet attributes configuration example figure.

Expected Results

Parameter Description
Setup & scenario info Device wakes up from hibernate every 5 seconds, and transmit 3 packets of 100 bytes each, on raw socket. The packet is OFDM at rate 6 Mbps & TX power is 7 (out 15).
Average current consumption (steady-state) 0.64 mA
Electric charge consumption of one active cycle 3.15 mC
NoteNote: Channel tune is being carried out on every wake up (R1 limitation)

The following figure describes the use case profile:

CC3100 Transceiver Profile 1min





Power Management Application BenchMark

The power management application is released as a stand alone CC3100 application, which is integrated within the CC3100 SDK folder during installation. Import it into your environment (code composer /IAR), as any other project described in the getting started user guide.

The application requires some preliminary action to be taken/defined within the code. The next values need to be defined; the pre-define lines are already in the code, just fill the relevant values:

  1. IP_ADDR – Destination IP address.
  2. MY_IP_ADDRESS – The device IP address.
  3. GW_IP_ADDRESS – The gateway IP address.
  4. NO_OF_PACKETS – The number of packets to be transmitted
  5. NUM_OF_CYC – defines how many times to repeat current use case.
  6. BUF_SIZE - defines the packet data size.
  7. INTERACTIVE – defines if we use the simple mode where small amount configuration/settings can be set interactively through sets of menus displayed on the terminal screen. The value 1 for this define (this is the default) will set the application to simple/interactive mode while 0 to the advanced one.

Moreover, there is also a need for a destination peer. A python script that implements TCP/UDP client or server is a simple solution for such peer. There are also good examples of DHCP server PC applications that can be found in the internet that the user can use.

How to use

The power measurement application enables to switch between the various use cases and to configure the device settings through several global variables declared at the top of the main file. The table below describes how use them. For the user convenient defines were already created for all possible values. Please note that if the user works in interactive mode, the use case & socket type are set interactively, while the other (advanced setting) still need to be defined in source code.

Variable Name Value Remarks
g_ActiveUseCase HIBERNATE_MEASURE Hibernate Current measurement mode
SLEEP_MEASURE Sleep current measurement mode
TRANSCEIVER MODE
ALWAYS CONNECTED USE CASE
INTERMEDIATELY CONNECTED
g_SocketType UDP SOCKET
TCP SOCKET
SEC_TCP_SOCKET NoteNote: For secure socket there are default values for cipher & method variables.
g_IpV4Option STATIC_IP The Address value is defined in the "MY_IP_ADDRESS" define statement.
DHCP Obtain IP address through DHCP process.
g_CcaBypass 0 This variable is relevant only on Transceiver mode, the default value is 1,
aka bypass the CCA
1 Example





Example Usage

This example will show step by step how to run the application in "Intermittently connected" use case with static IP address and communicating via UDP socket.

  1. Connect Micro-USB cable from J401 on the MSP430 Launchpad to a windows PC.
  2. Connect the current, measurement tool.
    1. Check to make sure that all pull-ups, pull-downs, and resistors are in place (according the board measurement setup ECO).
    2. Remove the jumper from J6 and connect your current measurement tool.
  3. Open CCS (Code Composer Studio) and Choose File->import from the menu, choose CCS project.
  4. Under select search directory, enter the path: C:\ti\CC3100SDK_1.0.0\cc3100-sdk\platform\msp430f5529lp\example_project_ccs.
  5. Check the project "power_management" and press Finish.
  6. Open the sl_common.h file located at the path C:\TI\CC3100SDK_1.0.0\cc3100-sdk\examples\common\ , and configure your network parameters.
    Setting AP info in the code
  7. Open the main file from the project explorer in the CCS and configure the general & use case settings.
    Global variables & define desired use cases
  8. . Launch Tera Term on the relevant com port , the serial number of the com port may differ.
    Teraterm UART setup
  9. Press F11 on the CCS window, and let the application run. On successfully termination you should see in the Tera Term outputs similar to this figure .
    Teraterm Application termination
The next sniffer snapshot corresponds to the traffic initiated by the application in one hibernate active hibernate cycle:
Sniffer snapshot of intermittently connected mode

The current measurement graph should look like this graph of Graph of 3 active cycles for intermittently connected mode. In each state connection is reestablished and one UDP packet is sent.
Graph of 3 active cycles for intermittently connected mode

Current Consumption Measurements Setup

Current Measurement for Profiles and Active States

Application energy consumption profile describes the consumption of the system for different system modes over time. The profile also includes the energy consumed for the transition between system modes. The total energy consumed is an integral of the current consumed, measured in units of Amperes, over time from the supply:

Energy: E [Jouls]= ∫Vsupply*Idt

Alternatively the charge consumption could be calculated:

Charge: C [coulomb ]= ∫ Idt

Commonly, a simpler, piece-wise linear approximation description of energy consumption is used:

Energy: E [Jouls]= ∑_(x=1)^n(Vsupply*Ix*Tx )

Alternatively the charge consumption could be calculated:

Charge: C [coulomb]= ∑_(x=1)^n(I_x*T_x )

The application power consumption could be measured in various methods, using:

These methods are recommended for dynamic and active current consumption measurements.

Oscilloscope with Current Probe

TX/RX current measurement setup
Average current measurements settings
Max current measurements settings
  1. Tools Needed
    1. Oscilloscope(Tektronix TDS7404/TDS5104B)
    2. Current probe with Amplifier(Tektronix TCP312 and TCPA300)
    3. External 3.3V supply source(Agilent E3631A)
    4. Short cables to connect 3.3V external supply to device
  2. FW Needed
    1. Use TI PM benchmark code or your application FW
  3. Pre-requisites / Things to Consider
    1. This setup is suited for active current measurements only or current numbers, which are higher than min measurable currents using particular current probe (with current probe and oscilloscope which we have in our lab, we could measure current numbers accurately which are higher than 10mAmp).
    2. Make sure FULL bandwidth is selected for the channel where current probe is connected this is to make sure you do not miss out any glitch/spike while measuring currents.
    3. Calibrate current probe before connecting across supply line, and align current direction mark (arrow) on current probe with current direction in supply line (if not you will see negative currents on the oscilloscope).
    4. Always feed external 3.3V supply at VBAT_CC pin and connect current probe across this supply line and measure current.
      For the CC3200Launchpad : Connecting wire across jumper(J12) is not a good method, since this will alter the DCDCs inductor values.
    5. Check the current limit that you have set for the external supply, lower current limit may RESET the device.
    6. Calibrate for voltage drop across the wire connecting supply to the device (use short and multi strand wire).
  4. Procedure
    1. Modifications for each board
      For CC3100Boosterpack: Remove jumper J6, Connect at Jumper J10, Pin_3.2 for GND.
      For CC3200LaunchPad: Remove resistor R62 across jumper J12 and also jumper J12
    2. Connect external supply to the pin, which connects to device(on other pin we can measure 3.3V which is coming from board supply)
    3. Connect current probe to the positive supply wire and make sure current direction in the wire and arrow on the current probe are in same direction.
    4. Start executing the code and measure the active currents on the oscilloscope.
      1. To measure the charge of a profile, place the cursors to limit the profile and use “math” function to perform integral over time. The result will be the total profile charge in [Coulombs] in between the cursors.
      2. To measure the peak current of transmit (TX) and receive (RX) modes use the “Y” axis cursors.

Mobile Communications DC source

Agilent_66319D_Mobile_Communicator
  1. Tools Needed
    1. Agilent 66319D
    2. Install NI Measurement and Automation explorer and Agilent 66319D GUI.
    3. NI GPIB-USB connector.
    4. Wires to connect instrument to device.
  2. FW Needed
    1. Use TI benchmark code or your application FW
  3. Pre-Requisites /Things to Consider
    1. This particular setup can be used to measure transient currents.
    2. Set proper supply Voltage, Current and series resistor value before turning ON the supply Output.
    3. Make sure you select proper range in the “Range” tab before you start the measurements.
      There are three ranges: Low, Mid and HiGH. Select based on the requirement.
      Select the proper time and current divisions, these will be at top left and top right corner of plot window.
    4. Plot in the GUI might not match the current numbers due to software issue. But the Minimum, Average and Maximum values displayed at the bottom are accurate.
    5. In order to measure max current of particular spike/peak use marker, place markers on either side of the spikes and look for max currents.
    6. There is no necessity to tweak settings for the measurements accuracy. Hence Set it to default, software automatically sets the best possible accuracy with the current configuration.
    7. If you select the 4wire connection mode then software will take care of drop across the wire, there is no need to compensate for the drop across the wire.
  4. Procedure
    1. Modifications for each board
      For CC3100Boosterpack: Remove jumper J6, Connect at Jumper J10, Pin_3.2 for GND
      For CC3200LaunchPad: Remove resistor R62 across jumper J12 and also jumper J12
    2. Install necessary software for the instrument 66319D
    3. Open 66319D GUI and go to “Source” tab and select “I/O Configuration…” .
      On the pop window press “Auto-Detect”
      This will show instrument details, which are connected to your PC and prompt if you want to use 66319D as power supply, click “Yes”.
    4. Connect positive terminal of power supply to VBAT_CC pin and GND to board GND.
    5. Configure supply voltage, current and series resistor value and then turn on the power supply.
    6. Start executing code and press “DLOG” tab if you want to log the data or press “Measure” if you want to measure instantaneous current numbers.
    7. To measure average current over certain period of time or over one complete cycle of active + low power mode, stop measurement after desired time period or one cycle and place markers on either ends and measure currents.

Static Current Measurements

The static low power modes current consumption could be measured using digital multi-meter. Here is a description of the setup:

Digital Multimeter

Hibernate current measurement setup

  1. Tools Needed
    1. Digital multimeter(Agilent 34401A)
    2. Short cables to connect multimeter in series with the device
    3. Optional: Keysights Software
  2. FW Needed
    1. Use TI benchmark code to generate the system modes
      • For Hibernate
      • For LPDS
  3. Pre-Requisites / Things to Consider
    1. This particular setup should be used to measure constant currents(both low and high currents can be measured provide these currents are constant over time or long interval).
    2. Start all current measurements with higher current range setting on ammeter and then depending on low power mode configured, reduce the current measurement range.
    3. Take care of the current direction through the ammeter, wrong current direction may lead to negative current numbers.
    4. Use short cables for connecting ammeter to device.
  4. Procedure
    1. Modifications for each board
      For CC3100Boosterpack: Remove jumper J6
      For CC3200LaunchPad: Remove resistor R62 and connect ammeter across jumper J12
    2. Configure multimeter to measure DC current and set higher current range.
    3. Check for the current direction, wrong current direction will lead to negative currents.
    4. Release RESET and execute the code.
    5. Once device enters into the configured low power mode, reduce current range and note down the current numbers.
    6. Before you exit from low power mode/RESET the device increase the current range on multimeter to higher value.


Appendix

How To Select Simplelink Wi-Fi Low Power Profiles

Active Current consumption Setup

Server Setup With Python Scripts

Links