I am trying to wake-up the PC from sleep mode, using PIC24FJ256GB106.
I am using Windows 7. I have installed "Microchip Solutions v2012-04-03" and I used the firmware from "Device – HID – Custom Demos" directory as a starting point.
When I connect my USB device, it shows up in Device Manager, in "Human Interface Devices" tree. (I am using Windows 7) But there is no "Power Management" tab from which I can check the "Allow this device to wake the computer".
Anyways, I figured out some kind of a solution for my device to wake up the computer from sleep. So I have to:
-
connect a USB mouse on the same root hub with the device
-
I have to check the "Allow this device to wake up the computer" for the mouse
-
and in the USBCBSendResume() function, I had to remove the
if(USBGetRemoteWakeupStatus() == TRUE)
condition
How can I wake-up the PC only using the device, without the mouse connected on the same root hub?
Best Answer
You will need to alter the config descriptor to enable the device to wake the PC from sleep. Specifically this means setting bit 5 in the bmAttributes byte. Have a look through the Microchip USB stack (e.g. config_desc.c or whatever it's named currently), there are plenty of comments to guide you.
Above table and info from "USB Complete" by Jan Axelson - an excellent book on all things USB.