Configure wakeup events on PSOC5LP (hibernate mode)

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

cross mob
Anonymous
Not applicable

Hello,

   

in the datasheet of the PSOC5LP in chapter 6.2.1.5 Wakeup Events I found that wakeup events are configurable but I didn't found how. I use hibernate mode and want only one external interrupt as a wakeup source. How can I configure only one out of all external interrupts as a wakeup source?

   

Or is the solution in AN72382 with the do-while loop the only solution?

   

As a workaround I switched the other interrupt pins to output, so no other external interrupt can occur.

   

Thanks for your help.

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

Look into this appnote which tells that "any unmasked PICU interrupt" can be used to return from hibernate. So you have to mask off all the interrupts you do not want to wake you up. Accessing the PICU is described in this appnote.

   

 

   

Happy coding

   

Bob

0 Likes
Anonymous
Not applicable

The last AN is the same I mentioned, with the do-while loop. So there is no possibility to do this in "hardware", I always wake up and have to look which external interrupt occured? This would explain why fast toggling signals are not preferred in hibernate mode (wakeup time is too long to save energy).

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

The do-while is just for the example project. When you have got more than one GPIO-pin casting an interrupt you will have to disable them before hibernating.

   

In a case like this I usually have two functions that care for all the needed hardware Component_Sleep() calls while the other issues the Component_Wakeup(). This would also be the place to disable/enable the unwanted PICU interrupts.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

OK, but I didn't understand how to disable the unwanted PICU interrupts. I tried using ISR_Stop(), but this only disabled the ISRoutine (the code to execute), not the interrupt itself, so there was a wakeup through this interrupt anyway.

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

Look at the end of the do-while there is

   
    CY_SET_REG8(CYREG_PICU6_INTTYPE1,0x00);   
   

This line disables the interrupt on port 6 pin 1. The last parameter corresponds to the table at page 14 in the appnote.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

This works, thanks.

   

So I have to save the old state before hibernate, set interrupt to 0x00 and restore it after wakeup. And this for all external interrupts which should not wake up the device.

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

Principially: Yes

   

But how many pins and ports did you define to generate an interrupt? Only those pins you have to care for.

   

 

   

Bob

   

PS: I am located near Bremen, where do you live?

0 Likes
Anonymous
Not applicable

On this device there are only two other external interrupts, so it is no problem. But on a device with more of them it would be easier the other way round.

   

I'm living near Stuttgart, on the other side of Germany. 

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

Not sure if any of this ref material will help, but here it is -

   

 

   

    

   

          

   

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

   

 

   

    

   

              

   

          

   

http://www.cypress.com/?rID=38267     AN54460 - PSoC® 3, PSoC 4, and PSoC 5LP Interrupts

   

 

   

 

   

Regards, Dana.

0 Likes