cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Contributor II

I have a project running on PSCO 4200 that goes into deep sleep and is woken by change in GPIO pin.

   

When I run the code , it appears to sleep for a while and then wakes up (but not by GPIO pin change).

   

The code starts a timer, and then stops the time when done and puts the device back in deep sleep mode.

   

However, once the device is woken it appears the timer never stops and it keeps getting continuously woken by the time (I put a break point at the ISR and it is going directly to it).

   

I have a Global Signal - System Power Interrupt placed in the design but do not use the watchdog.

   

Firstly, is there a register that indicates what caused the wake from deep sleep ?(I am sure I saw this in a document for hibernate but not sure about deep sleep).

   

What would cause the timer interrupt to not be cleared.

   

CY_ISR(TimerINT){

   

    Timer_ReadStatusRegister();

   

    Timer_Flag = 1;

   

}

   

void StartTimer(uint32 tdelay){  //used in "processLF()" routine when woken

   

    uint32 period = tdelay;

   

    Timer_WritePeriod(period);

   

    Timer_WriteCounter(period);

   

    Timer_Enable(); 

   

}

   

void StopTimer(void){  //called just before deep sleep when leaving "processLF()"

   

   Timer_Stop();

   

   Timer_Flag = 0;   

   

}

   

 

   

main loop

   

for(;;){

   

          CySysPmDeepSleep();

   

          processLF();

   

    }

0 Likes
Reply
2 Replies
Esteemed Contributor II

PSoC4 Low Power Technics state that any interrupt will wake from deep-sleep. No isr-component needed, just an enabled interrupt.

   

Can make it difficult to find a wakeup cause, looks as if you'll have to read some ICU-registers to get the cause.

   

Keep in mind that debugging and deep-sleep may not go together!

   

 

   

Bob

0 Likes
Reply
Esteemed Contributor

This ap note should help -

   

 

       

http://www.cypress.com/?rID=95069     AN90799 - PSoC® 4 Interrupts

   

 

   

    

   

         

   

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

   

 

   

and GPIO issues in sleep -

   

 

   

    

   

          

   

http://www.cypress.com/?rID=93401     AN86439 - PSoC® 4 - Using GPIO Pins

   

 

   

 

   

 

   

Regards, Dana.

0 Likes
Reply