6 Replies Latest reply on May 29, 2015 7:34 PM by user_5544

    GPIO interrupt in Deep Sleep isn't working

    user_5544

      I am using a 4200, and have a switch on P3.5, with a falling edge interrupt.  That works just great when the chip is awake.  But when I put it into deep sleep, the interrupt never happens and the chip never wakes up.  I'm stopping the ILO before deep sleep, and restarting the ILO on wakeup (which never happens).  The IRQ should restart the IMO, and state should be retained.  I have saved the state of PWMs and other UDBs, but even without any other configuration besides the single GPIO pin with the switch, it doesn't work.

         

      Since it's deep sleep and all the clock are off, I am using transparent mode on an input pin configured as resistive pull-up, and with the input buffer enabled.  I have also tried single-sync with input buffering.

         

      Here's some code (I didn't include the obvious code to register the ISR, etc.) the ISR works fine when not in deep sleep.

         

       
      CySysClkIloStop();   // turn off the ILO
      CySysPmDeepSleep();  // go to DEEP sleep
      CySysClkIloStart();  // turn the ILO on again   (after the GPIO IRQ returns we should be here)

         

       

         

      CY_ISR(ISR_SW_PWR_Handler)
      {
         SW_PWR_ClearInterrupt();
          return;
      }