8 Replies Latest reply on May 8, 2015 1:55 PM by matt.young

    Trouble waking from sleep with OPPS wakeup source

    matt.young

      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.