How to wakeup PC?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Sooloom
Posts: 3
Joined: Tue Apr 22, 2008 4:30 pm

How to wakeup PC?

Post by Sooloom » Wed Apr 23, 2008 8:21 am

I use infrahid on my Computer ,but i couldn't to wakeup pc when PC standby or Poweron,how to do ?help

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Wed Apr 23, 2008 4:50 pm

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

Sooloom
Posts: 3
Joined: Tue Apr 22, 2008 4:30 pm

Post by Sooloom » Thu Apr 24, 2008 7:37 am

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?

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Thu Apr 24, 2008 9:49 am

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();

Sooloom
Posts: 3
Joined: Tue Apr 22, 2008 4:30 pm

Post by Sooloom » Thu Apr 24, 2008 11:11 am

OK,Thanks!

keyfans

Post by keyfans » Thu Oct 23, 2008 3:14 am

How to use this code, can give an example, thank you!

Post Reply