Wakeup from sleep from key pressed with UART USB?

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

cross mob
EmGa_3347101
Level 2
Level 2

Hi!

Is there any form to wakeup PSoC 5LP from SLEEP mode, connected to PC with USB UART when press a key from the keyboard?

0 Likes
1 Solution

No, it is not possible.

You can't even go to sleep (with PM_SLEEP_SRC_PICU) if there is activity in the USB. You can only suspend the USB and go to sleep if there is no activity for 3 ms.

If your concern is power, what you can do is to call the following command in the main loop:

CyPmAltAct(PM_SLEEP_TIME_NONE, PM_ALT_ACT_SRC_INTERRUPT);

Still, if the PC is running, it will periodically send USB packets, therefore it might have an interrupt going on in the background. However, you do save a bit of power, since the CPU will stay idle longer.

You can also disable the SOF interrupts in the component to avoid more interrupts, if your application allows.

View solution in original post

0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello EmGa_3347101,

As mentioned in the community thread: PSoC 5LP USB UART interrupt , the USB device once sent to sleep in case of PSoC 5LP will wakeup only when the Host drives the D Plus line of the USB from high to low.

The only time we can suspend the USB and send the device to sleep is when the host stops sending packets. This usually happens when you place the PC in sleep mode (or hibernate).

If the PC is running and the OS is active, it will constantly send packets to the USB device.

Please refer to the USBFS component datasheet, Enter/Exit Low Power Mode Example topic on page 50 to implement entry and exit from low power mode.

Also, can you please let me know how are you sending the device in Sleep mode? Does the host also go to sleep then?

Regards

Ekta 

0 Likes

Hi EktaN_26 Moderador,

I'm sending my device to Sleep exactly with the enter/exit low power mode example. And it works OK.

During my Sleep mode (device), PC is running or hibernate, that doens't matter for me.

My question is if is it possible to wake up my device from Sleep if I press a key in a terminal window connected by usb uart.

Thanks for your support!

0 Likes

No, it is not possible.

You can't even go to sleep (with PM_SLEEP_SRC_PICU) if there is activity in the USB. You can only suspend the USB and go to sleep if there is no activity for 3 ms.

If your concern is power, what you can do is to call the following command in the main loop:

CyPmAltAct(PM_SLEEP_TIME_NONE, PM_ALT_ACT_SRC_INTERRUPT);

Still, if the PC is running, it will periodically send USB packets, therefore it might have an interrupt going on in the background. However, you do save a bit of power, since the CPU will stay idle longer.

You can also disable the SOF interrupts in the component to avoid more interrupts, if your application allows.

0 Likes