Trouble waking from sleep with OPPS wakeup source

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

cross mob
Anonymous
Not applicable

I have some custom hardware buit around a CY8C5867AXI-LP024. I'm trying to sleep and wake up on a sustained button press, or a USB cable being plugged in.  This is the loop. 

   

CyPmSaveClocks();

   

CyPmSleep(PM_SLEEP_TIME_NONE,PM_SLEEP_SRC_ONE_PPS);

   

 while(1)

   

 {

   

        CyPmRestoreClocks();

   

        if((CHRG_Read() == 0) || (ACPR_Read() == 0))

   

        {

   

            return(start_up);   

   

        }

   

        else if(PB_CENTER_Read() == 0)

   

        {

   

            wake_up_counter++;

   

            if(wake_up_counter == 3)

   

            {

   

                return(start_up);

   

            }

   

        }        

   

        else

   

        {

   

            wake_up_counter = 0;

   

            CyPmSaveClocks();           

   

            CyPmSleep(PM_SLEEP_TIME_NONE,PM_SLEEP_SRC_ONE_PPS);

   

        }

   

}   

   

 

   

It does exactly what I expect when I single step through it, but running at full speed, it's like the OPPS interrupt isn't firing. The RTC_Start() and RTC_Enable() functions are called in the initializtion. Usuaully things like this are something obvious. Anyone see my error? Thanks.

0 Likes
8 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

  Hi,

   

 

   

When CTW or One PPS is used as a wakeup source, the CyPmReadStatus function must be called upon wakeup, with the corresponding parameter.Can you please use CyPmReadStatus(CY_PM_ONEPPS_INT).

   

 

   

Thanks,

   

Hima

0 Likes
Anonymous
Not applicable

Thanks for the reply, but that wasn't the magic bullet. I put  CyPmReadStatus(CY_PM_ONEPPS_INT); right after the sleep function and put a break point on it. I can enter the sleep state, but it never hits the break point.

0 Likes
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

 Hello,

   

 

   

It is not recommended to run the low power code in debug mode. Can you please test this in anyother way like blinking an LED or something.

   

 

   

Thanks,

   

Hima

0 Likes
Anonymous
Not applicable

Thanks, I compiled for release, and it's still not waking up. I suspect the OPPS interrupt isn't actually firing. Global interrupts and the RTC are enabled. What am I missing here?

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

It wouldn't be too bad if you could post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.



Bob
 

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 Project attached

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

Datasheet (System Reference Guide pg. 49) clearly states:

   

PSoC 5 devices will not go into low power modes while the debugger is running

   

That has nothing to do with Debug or Release build configuration.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 It doesn't matter if it's running in debug or not, it gets to the sleep state, and can't get out of it.

0 Likes