Page 1 of 1

How to wakeup PC?

Posted: Wed Apr 23, 2008 8:21 am
by Sooloom
I use infrahid on my Computer ,but i couldn't to wakeup pc when PC standby or Poweron,how to do ?help

Posted: Wed Apr 23, 2008 4:50 pm
by christian
You must generate a USB reset condition to wake up the PC. This is done with

Code: Select all

    usbDeviceDisconnect();
    _delay_ms(10);
    usbDeviceConnect();


You should only generate the reset if the PC is really in sleep mode. You can find out by checking for start of frame pulses on D-.

Posted: Thu Apr 24, 2008 7:37 am
by Sooloom
I have test this way to wakeup my Computer,but has a problem,when i back to windows from standby mode, my keyboard and my mouse no response,how to solute?

I know this way not a standard wakeup mode,i want to use set feature and clear feature to realize the remote wakeup ,how to do?

Posted: Thu Apr 24, 2008 9:49 am
by christian
Sorry, what I have posted is NOT correct. I've re-read the spec and the resume signal is a differential "1", not SE0. The code should therefore look like this:

Code: Select all

    cli();
    USBOUT |= _BV(USB_CFG_DPLUS_BIT);
    USBDDR |= _BV(USB_CFG_DPLUS_BIT) | _BV(USB_CFG_DMINUS_BIT);
    _delay_ms(5);  /* spec says min 1 ms, max 15 ms */
    USBDDR &= ~(_BV(USB_CFG_DPLUS_BIT) | _BV(USB_CFG_DMINUS_BIT));
    USBOUT &= ~_BV(USB_CFG_DPLUS_BIT);
    sei();

Posted: Thu Apr 24, 2008 11:11 am
by Sooloom
OK,Thanks!

Posted: Thu Oct 23, 2008 3:14 am
by keyfans
How to use this code, can give an example, thank you!