Wake up on IO from sleep

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

cross mob
Anonymous
Not applicable

 Hi,

   

Can I please get a code example on how to place the PSoC3 into sleep mode for wake up by a signal on an IO pin.  

   

I can't find an appropriate second argument for CyPmSleep().  I don't want to wake up the device after a set amount of time, or by using any of the peripherals offered.  The datasheet says that IO is one of the available wake up sources for sleep mode.

   

Thanks.

0 Likes
11 Replies
Anonymous
Not applicable

Hi kristen,

   

 

   

In order to wake up the device from sleep due to a signal on IO, you need to use PICU (Port Interrupt Control Unit) as the source of wakeup.

   

For the input pin, set the interrupt mode to Rising or Falling edge according to your requirement.

   

Next, the parameters for CyPmSleep should be WakeupTime = PM_SLEEP_TIME_NONE 

   

WakeupSource = PM_SLEEP_SRC_PICU

0 Likes
Anonymous
Not applicable

 Thanks very much.  That has solved my problem.

0 Likes
Anonymous
Not applicable

How to define GPIO pin for Interrupt.

   

How to use more than one Interrupt for wake up (GPIO AND UART RX)

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Looks like you cannot wake from sleep using UART, you would have to be

   

in one of the active modes.

   

 

   

http://www.mymcu.ru/content/articles/Cypress/AN66083.pdf

   

 

   

Regards, Dana.

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

One possibility to wake on UART would be to use flow control signaling,

   

eg RTS and CTS, that only works if you are in control of both host and

   

client to enforce a 5 wire RS232 connection. If you did use this RTS and

   

CTS would have to be signal conditioned, eg MAx232 like part, unless

   

of course you used proprietary solution on both ends.

   

 

   

Regards,m Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

To effect an ISR for a pin just place pin on schematic, and on input tab for the

   

pin there is an option to enable an interrupt. Then attach an ISR component to

   

the pin, as shown on attachment.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Thanks to all

0 Likes
Anonymous
Not applicable

 I want to know how to hold the I/O status during sleep and hibernate mode? i create a project can enter sleep mode, but after use mcu wake, the ourput I/O can't hold the status. i test it in CY8CKIT-030 EVK. can you help to solve this issues! thanks!

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

A point about control register driven I/O -

   

 

   

   

Regards, Dana.

0 Likes
GeMo_285911
Level 4
Level 4
First like received

Hello,

   

  I have a question concerning waking up on Rx activity on UART. Would it be possible to add an interrupt on Rx, falling edge, for waking up (or connect the Rx line externally to another pin of the PSoC and make it generate an interrupt)? I apologise if the question is dumb.

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

The UART is powerd off, but you could use a pin tied to  Rx (CMOS) to monitor activity

   

and via PICU wakeup out of Hibernate or Sleep. See the following -

   

 

   

    

   

          

   

 

   

http://www.cypress.com/?rID=64554     AN77900

   

 

   

http://www.mymcu.ru/content/articles/Cypress/AN66083.pdf

   

 

   

 

   

Regards, Dana.

0 Likes