This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3200 Power management not dropping current

Other Parts Discussed in Thread: CC3200, ENERGIA

Hi, I'm very new to TI-RTOS and CCS6, I'm using a CC3200 launchpad xl

I'm trying the  gpiointerrupt_CC3200_LAUNCHXL_TI example from TI-RTOS

I want to set the MCU to LPDS, from reading this pdf: www.ti.com/.../sprui18c.pdf

I was able to understand that TI-RTOS already has power management and so I looked at the CC3200_LAUNCHXL.c file within the project example and was able to find the following:

/*
* =============================== Power ===============================
* In this configuration, Power management is disabled since runPolicy
* is set to 0. Power management can be enabled from main() by calling
* Power_enablePolicy(), or by changing runPolicy to 1 in this structure.
*/
const PowerCC3200_Config PowerCC3200_config = {
  .policyInitFxn = &PowerCC3200_initPolicy,
  .policyFxn = &PowerCC3200_sleepPolicy,
  .enterLPDSHookFxn = NULL,
  .resumeLPDSHookFxn = NULL,
  .enablePolicy = false,
  .enableGPIOWakeupLPDS = true,
  .enableGPIOWakeupShutdown = false,
  .enableNetworkWakeupLPDS = false,
  .wakeupGPIOSourceLPDS = PRCM_LPDS_GPIO13,
  .wakeupGPIOTypeLPDS = PRCM_LPDS_FALL_EDGE,
  .wakeupGPIOSourceShutdown = 0,
  .wakeupGPIOTypeShutdown = 0,
  .ramRetentionMaskLPDS = PRCM_SRAM_COL_1 | PRCM_SRAM_COL_2 | PRCM_SRAM_COL_3 | PRCM_SRAM_COL_4
};

The comment above says that if I place Power_enablePolicy() in main, the power management should work.

I then measure the current in J12 just like it is instructed in the User's guide, picture below:

The problem I see is that I am always reading around 20mA, whether the LED is on or not, shouldn't the MCU go to LPDS when the LED is off? 

Any help is appreciated, let me know if I'm missing something or if I am doing something wrong.

Thank You! 

  • Hello,
    I will move your thread to the CC32xx forum. The experts there can help you best.
    Thanks
    ki
  • I have tried flashing my program to the board and measuring the current to see if that would help but it didn't. Any thoughts? I have looked around and a possibility is that using a normal multi meter to measure the current is not a good idea.
  • Hello,

    You have been moved to SimpleLink forum but actually the example you are using is from the TIRTOS examples.

    In case you would like to use CC3200 SDK, I would be able to assist but since you have already started with TIRTOS example, I will move you to the right forum for feedback.

    Regards,

    Shlomi

  • I might go the route of using the 0.1 ohm resistor to measure the power consumption

  • I just saw this great video from mraureliusr on CC3200 Solar Power & Current Measurement:

    www.element14.com/.../cc3200-solar-power-current-measurement

    To measure the current he is using a multimeter and the J12 jumper so maybe the current I was reading (about 20mA) was correct?

    And now I have another question, how do I know if and when the MCU is sleeping?  

    I am most likely missing a piece of code from the TI-RTOS power management, I will keep looking around!

  • I kept playing around with the cc3200.

    I tried another example, the i2ctmp006_CC3200_LAUNCHXL_TI example, In this one I just placed the Power_enablePolicy() in the main function and this example would send the device to sleep after one sample but with one problem, the device wouldn't wake up after that sample.

    const PowerCC3200_Config PowerCC3200_config = {

    .policyInitFxn = &PowerCC3200_initPolicy,
    .policyFxn = &PowerCC3200_sleepPolicy,
    .enterLPDSHookFxn = NULL,
    .resumeLPDSHookFxn = NULL,
    .enablePolicy = true,
    .enableGPIOWakeupLPDS = true,
    .enableGPIOWakeupShutdown = false,
    .enableNetworkWakeupLPDS = false,
    .wakeupGPIOSourceLPDS = PRCM_LPDS_GPIO13,                                                  <--- Could this be my problem for that example? It can only be woken from this GPIO?
    .wakeupGPIOTypeLPDS = PRCM_LPDS_FALL_EDGE,
    .wakeupGPIOSourceShutdown = 0,
    .wakeupGPIOTypeShutdown = 0,
    .ramRetentionMaskLPDS = PRCM_SRAM_COL_1 | PRCM_SRAM_COL_2 |
    PRCM_SRAM_COL_3 | PRCM_SRAM_COL_4

    };

    For the previous gpiointerrupt_CC3200_LAUNCHXL_TI example I decided to add " Power_idleFunc() " on the gpio interrupt function, so whenever I would touch the button it would call that function, gladly it sent the device to sleep, I measured the current and it wads only about 9mA but with the same problem that it would not wake up. I'm guessing I need to configure that .wakeupGPIOSourceLPDS field?

    Now one of my many questions, from what I understood TI-RTOS would take care of the power automatically, as in after me calling the Power_enablePolicy() in main, TI-RTOS would send the device to sleep whenever my device wasn't doing anything or in idle, but that doesn't seem to be the case with the gpiointerrupt_CC3200_LAUNCHXL_TI example?


    Sorry to annoy so much with this! I'm working on a project that requires me to save power, and I'm enjoying TI-RTOS alot so I will stick to it. XD

    I will read the PDFs on power management again to see if I missed anything!

  • jorge hernandez9 said:

     ....and this example would send the device to sleep after one sample but with one problem, the device wouldn't wake up after that sample.

    I was wrong, the demo works as intended, what "freezes" is the the terminal output seem in CCS, I had forgotten that if the device is sent to sleep while debugging it would stop the debugging.

    After taking all the temperature examples the current does not drop from around 16mA not sure why.

    I tried the UART Power example, this one works perfectly! I can see the output using Tera Term, whenever it is doing something the device draws about 17mA but when it goes to sleep it draws around 9mA.

    jorge hernandez9 said:

    ..add " Power_idleFunc() " on the gpio interrupt function, so whenever I would touch the button it would call that function, gladly it sent the device to sleep, I measured the current and it was only about 9mA but with the same problem that it would not wake up. I'm guessing I need to configure that .wakeupGPIOSourceLPDS field?

    I modified the .wakeupGPIOsourceLPDS field and was successfully able to wake up the device.

    A) I could use the Power_idleFunc() in my code to manually send the device to sleep is this correct?

    B) How come the power feature works with the UART Power example, but not with the gpiointerrupt example?

  • Hello Jorje,

    Not sure why this post is moved to this forum for the 2nd time.

    The device is CC3200 but you are using TIRTOS examples that are not part of the SDK I am supporting.

    In the SDK I am supporting, the structure is different so it is hard to compare why it is not working for you as it should wakeup with GPIO13. Again, in my SDK you also need to configure the pin as GPIO input.

    Regardless, I believe it is proper to call Power_idleFunc() from your idle loop so policyFXN is invoked.

    Regards,

    Shlomi

  • Hello Shlomi, 

    Thank you for the replies! I'm sorry I keep getting my post changed, I'm new and still learning where to ask the questions. XD

    There could be a question you might be able to help me with, is this example: http://processors.wiki.ti.com/index.php/CC32xx_Sleep_Application 

    The values for when the MCU is in deep sleep seem to be smaller than from what I measured.

    Do you think I could be missing something? Maybe the DMM I'm using to measure is not good?

    I measured it via the J12 jumper

    My goal is to have the CC3200 draw at max 0.7mA during deep sleep.

    Any help on this i s appreciated!

    Thank You so much, and sorry to annoy this much XD 

  • Hello,

    The link is relatively old and does not contain too much information.

    If you are working in LPDS, depending on your use case, you should see LPDS current lower than you target number.

    Again, depends if you are still connected to WiFi and keeping the connection or going to hibernate.

    What I recommend is looking at idel_profile example and power_measurement example.

    Also take a look at the following descriptive power framework docs:

    Regards,

    Shlomi

  • Thank You so much for the information! Happy Holidays! I will look through them these days! :D

  • So I decided to try some small code in Energia and measure the current, I tried both LPDS and HiB.

    This is my code for LPDS:

    #include <Energia.h>
    #include <driverlib\prcm.h>

    #define LED RED_LED
    #define PUSHBUTTON 4

    void setup()
    {

    PRCMLPDSWakeupSourceEnable(PRCM_LPDS_GPIO);

    PRCMLPDSWakeUpGPIOSelect(PRCM_LPDS_GPIO13, PRCM_LPDS_FALL_EDGE);

    pinMode(LED, OUTPUT);

    pinMode(PUSHBUTTON, INPUT_PULLUP);
    attachInterrupt(PUSHBUTTON, wake_upFxn, FALLING);
    }

    void loop()
    {

    digitalWrite(LED, HIGH); 
    delay(1000); 
    digitalWrite(LED, LOW);

    PRCMLPDSEnter();

    }


    This program is fairly simple, It sets SW3 to wake up the MCU from LPDS.

    In the loop the program turns on an LED waits 1 second, turns off the LED and then goes to sleep.

    For HiB this is the code:

    #include <Energia.h>
    #include <driverlib\prcm.h>

    #define LED RED_LED

    void setup()
    {

    PRCMHibernateWakeupSourceEnable (PRCM_HIB_SLOW_CLK_CTR);
    PRCMHibernateIntervalSet (10 * 32768);

    pinMode(LED, OUTPUT); 

    pinMode(PUSHBUTTON, INPUT_PULLUP);
    attachInterrupt(PUSHBUTTON, wake_upFxn, FALLING);
    }

    void loop()
    {

    digitalWrite(LED, HIGH); 
    delay(1000); 
    digitalWrite(LED, LOW); 

    PRCMHibernateEnter()

    }


    This program is similar to the LPDS program but instead of using the button to wake up, it uses the slow clock to wake up in 10 seconds.

    I measured the currents of each program while they were sleeping, the results were:

    For LPDS: ~9mA

    For HiB:    ~0.03mA

    This is an improvement on what I plan to do but I think both currents should be lower, I would expect LPDS to be in the 0.2mA range and HiB to be in the microAmps range.

    I will keep digging around to see what I find!

  • Hi Jorge,

    This is in regards to the current measurements you are getting with TI-RTOS apps. From your post it looks like the current measurement you are getting is ~9mA when the Cortex-M4 enters LPDS mode. I believe the numbers are not lower because the NWP processor does not enter standby mode. If you add logic to your application to force the NWP into standby or shutdown, the current measurement should drop by a couple of mA.

    Another important thing to consider is the leakage currents from I/O pins. Once the CC3200 goes into LPDS, I/O pins that are left floating may continue to leak current. It is therefore important to pull all pins either high or low. You can configure the pins to reduce leakage currents and get lower current measurement.

    Best,
    Ashish
  • I believe this is the correct way of lowering the current in LPDS.

    Ashish Kapania said:
    If you add logic to your application to force the NWP into standby or shutdown, the current measurement should drop by a couple of mA

    I was not successful on this, I need to learn more about NWP.

    Ashish Kapania said:
    Once the CC3200 goes into LPDS, I/O pins that are left floating may continue to leak current. It is therefore important to pull all pins either high or low. You can configure the pins to reduce leakage currents and get lower current measurement.

    I read this from the pdf "TI-RTOS 2.20 Power Management: MSP432, CC13xx/CC26xx, and CC3200 SimpleLink MCUs " link: http://www.ti.com/lit/ug/sprui18c/sprui18c.pdf 

    Utils_SpiFlashDeepPowerDown();

    I am not sure exactly what it does, but it helps to reduce current drawn.

    I am happy with these measurements and I think I will use them!

    Thank You!

  • I posted a picture on the previous post and don't see it.
    What I posted is that according to the doxygen the power config structure no longer has a .pinParkDef field, which is seen on the above PDF on page 8. And so I didn't try to park the pins.
  • jorge hernandez9 said:

    I posted a picture on the previous post and don't see it.
    What I posted is that according to the doxygen the power config structure no longer has a .pinParkDef field, which is seen on the above PDF on page 8. And so I didn't try to park the pins.

    The pin parking field is relatively new and I believe it is not available in public releases of TI-RTOS yet.

    Best,
    Ashish