Sleep current too high

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

 This is first attempt at using Sleep command on 5LP. I am starting with the code below. Just before the unit goes to sleep the current drawn is 18mA. During sleep it only drops to 15mA.

   

Do I have the correct settings for low power mode? (The sleep timer is set for 4096).

   

CY_ISR(WakeupIsr){

   

    SleepTimer_1_GetStatus();

   

}

   

 

   

void TestSleep(void){

   

 

   

  GSM_RST_Write(1);

   

  GSM_SLEEP_Write(1);

   

  isr_1_StartEx(WakeupIsr);

   

  SleepTimer_1_Start();

   

    

   

  CyPmSaveClocks();

   

  CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_CTW);

   

  CyPmRestoreClocks();

   

}

0 Likes
7 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Debugging sucks some mA. Did you disable that?

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

Also: how did you measure the current consumption? Are you sure you measure the PSoC only?

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Which board do you have ? If the CY8CKIT-050 there are instructions

   

to measure in 77900, page 16 -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=64554     AN77900 - PSoC® 3 and PSoC 5LP Low-power Modes and Power Reduction Techniques

   

http://www.cypress.com/?rID=43337     AN61290 - PSoC® 3 and PSoC 5LP Hardware Design Considerations

   

http://www.cypress.com/?rID=78797     AN86233 - PSoC® 4 Low-Power Modes and Power Reduction Techniques

   

 

   

Regards, Dana.

0 Likes
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

 The current does seem to drop when in low power mode now. I have several mA being used by the power supply and some pull-up resistors.

   

However, The program seems to now be halting after wake from sleep (when Sleep Timer trips). I have tried turning off the sleep Timer when done and also clearing the watchdog time in the main loop but cannot figure out what is causing the program to stop (it is acting like an invisible brakpoint). Here is my current code. The Sleep timer is set to max period around 4 seconds. The project has selectable mains/battery operation. If battery then it simply switches to low power mode and wakes up every 4 seconds to check inputs then back to sleep (at least this is what is SHOULD be doing).

   

CY_ISR(WakeupIsr){

   

    SleepTimer_1_GetStatus();

   

}

   

void LowPower(void){

   

  GSM_RST_Write(1);

   

  GSM_SLEEP_Write(1);

   

  isr_1_StartEx(WakeupIsr);

   

  SleepTimer_1_Start();

   

  CyPmSaveClocks();

   

  CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_CTW);

   

  CyPmRestoreClocks();

   

  SleepTimer_1_Stop();

   

}

   

 

   

int main(){

   

    uint8 swmode;

   

    MainsTripped = false;

   

    swmode = MODE_Read();

   

    MainsPowered = swmode& 0x01;

   

    MainsDetect = swmode & 0x02;

   

    MainsLongDelay = swmode & 0x04;

   

    if(MainsLongDelay) MainsDelay = FIVEMINUTE; else MainsDelay = TENSECONDS;

   

    MainsTripCount = MainsDelay;

   

    TestSMS = swmode & 0x08;

   

    

   

    CyGlobalIntEnable; 

   

    SETTINGS_Init();

   

    COM_Init();

   

    

   

    Modem_Ready = SMS_Init();

   

    if(Modem_Ready){

   

       Send_Alarm(msgPOWERUP,0);

   

    }

   

    StartMainsTimer();

   

  

   

    for(;;){

   

      CyWdtClear();

   

      if(MainsPowered){

   

        Check_COM_Packet();

   

         Check_SMS_Receive(); 

   

        Check_Input_State();

   

        if((MainsTimeout)&&(MainsDetect)){

   

            CheckMains();

   

            StartMainsTimer();

   

        } 

   

      }

   

      else{

   

            LowPower();

   

            Check_Static_Input_State();

   

      }

   

    }

   

}

   
        
0 Likes
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

 Does the sleep mode interact with watchdog timer? I have cleared the wdt in main loop but not sure if needed. If wdt must be explicitly started then I should not need to reset it.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Might help if you post archive of project -

   

 

   

    

   

          

   

“File”                                                             Creator

   

“Create Workspace Bundle”

   

  

   

Regards, Dana.

0 Likes
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

 I found the issue. It is somehow related to Timer_1_Stop().

   

When I removed this line, the project ran ok.

0 Likes