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.

CC2538 Z-Stack Low Power Mode 3

Other Parts Discussed in Thread: CC2538, Z-STACK

Hi All, 

I'm using Z-Stack Energy on the CC2538.

I have a system that uses a battery and a voltage regulator that I control from the CC2538 to change its output voltage from 3.3V (normal operations) to 1.8V (Sleep Mode). The device is woken out of sleep mode by a button press.

I have enabled the POWER_SAVING flag, and done a few other things to get the lowest sleep mode current possible.

Presently, its at 2.1uA which is good, but according to the datasheet, this indicates that the CC2538 is still in Low Power Mode (LPM) 2.

How can I get it to go to LPM3? Is there a power-control register that I can change ( PMCTL maybe?) with an Assembler command?

Thanks!

  • As I know, Z-Stack only implements PM2. If you need to usePM3, you can try to use SysCtrlPowerModeSet to do it.
  • Thanks for the suggestion.

    I tried this:
    SysCtrlPowerModeSet( SYS_CTRL_PM_3 ); //( SYS_CTRL_PM_3 = 0x00000003 )

    But, I still only get to 2.1uA, so no change.
  • Here is the whole function where I use it:

    void halSetSleepMode(void)
    {
    /* Clear if any pending GPIO power interrupts */
    SysCtrlPowIntClear();
    /* Enable SysCtrl Power interrupts during sleep */
    SysCtrlPowIntEnableSetting();

    /* If sleep pcon flag is enabled then go to deep sleep */ //HAL_SLEEP_DEEP=CC2538_PM3; HAL_SLEEP_TIMER
    if(halSleepPconValue)
    {
    #ifdef REMOTE_CONTROL_IT
    VREG_SET_1_8V(); //Change the power reg from 3.3V to 1.8V.
    #endif //REMOTE_CONTROL_IT

    SysCtrlPowerModeSet( SYS_CTRL_PM_3 ); //Set LPM3 ???
    SysCtrlDeepSleep();

    #ifdef REMOTE_CONTROL_IT
    VREG_SET_3_3V(); //Change the power reg from 2.1V to 3.3V.; //Change the power reg from 2.1V to 2.5V
    uint16 counter = 0; //Test the VReg PG (Power Good) pin before continuing...
    while ( !( GPIOPinRead( GPIO_C_BASE, GPIO_PIN_4 ) ) && (counter++ < 0x5000) ) { } //0x5000 should give about 10ms, more than enough for VReg to settle.
    #endif //REMOTE_CONTROL_IT
    }

    /* Disable SysCtrl Power interrupts after wakeup from sleep */
    SysCtrlPowIntDisableSetting();

    HAL_DISABLE_INTERRUPTS();
    }
  • I suggest you to implement a button to trigger the following two APIs to see if PM3 works first.

    SysCtrlPowerModeSet( SYS_CTRL_PM_3 );
    SysCtrlDeepSleep();
  • Ok I'll try this, but I know it calls these APIs, I've placed a break point in the function . The stepping goes to SysCtrlDeepSleep() and then stops, then when I make it wake up, it continues on from there.

    Are you suggesting that I make sure these API's get called without any possible interference from the JTAG debug system?
  • Yes. There is no big difference in power consumption between PM2 and PM3 so you might not be able to see current consumption changes when you use PM2 or PM3.
  • Ok I tried triggering them with a button, but no difference. I did notice that the register PM under PMCTL was set to '3', which indicates that the processor is in LPM3.
  • Do you mean the processor is in LPM3 according to PMCTL register but you don't see less current consumption?

  • Yes.
    It seems then, that one of the other components is drawing the extra current. The Vreg (TPS6274x) datasheet, which I've just checked, claims between 360 - 1800 nA, so it must be some setting there.

    Thanks for your help!
  • You are welcome.