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.
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
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.
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!
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.
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 -