Content originally posted in LPCWare by bosbessenbasje on Tue Mar 25 05:22:17 MST 2014 Hello !
I am using the LPC2468 to make a specific USB HID device. This HID device is bus powered and will be certified. This means that the CPU needs to go into power down mode when the PC is suspended (or in sleep mode).
I am using the following code to do that:
PCONP &= ~(1UL<<14); // Disable power to USB device
INTWAKE = (1 << 5); // Allow wakeup on USB state change
PCON = (1 << 1); // Goto power down mode
However, the CPU does wake up immediately. The target is not connected to a PC but to an USB power adapter, which almost immediately results in a 'SUSPENDED' state of the USB stack (which is correct). But it also means that there should be no USB activity, so there is no reason for the CPU to wakeup again.
If I remove the 'INTWAKE' statement, the powerdown mode is entered correctly, but the CPU does not wake on USB activity (of course not).
Is there something I am missing here? Do I need to change some of the USB peripheral settings as well?