Shut down or sleep mode for AVR-USB
Shut down or sleep mode for AVR-USB
I have completed a device that with many LEDs. I have tried it on Windows XP in several desktop computers and notebook computers. Some computer's motherboard design will cut off the 5V power from USB port, some will not.
My problem: After shut down of computer. My device's LED are still getting ON, the AVR MCU is still running and It remains the last state of computer shut down. What approach that i can solve this problem? Have any loop subroutine that can detect the computer was off? Thanks.
My problem: After shut down of computer. My device's LED are still getting ON, the AVR MCU is still running and It remains the last state of computer shut down. What approach that i can solve this problem? Have any loop subroutine that can detect the computer was off? Thanks.
See the end of http://avrusb.wikidot.com/examples, the section about suspend mode. This explains how suspend mode can be implemented.
hi, thanks for both you guy's reply.
Now, my design's D+ pin is connected to INT0
Do i have to re-layout to D- pin to INT0 or modification of firmware (keep D+ pin to INTO)can solve this issue? Thanks.
I want to study more information about this 1kHz idle clock, what documents that i can check about it. I want to know whether the idle clock is still exists when Windows at sleep mode. Thanks.
Now, my design's D+ pin is connected to INT0
Do i have to re-layout to D- pin to INT0 or modification of firmware (keep D+ pin to INTO)can solve this issue? Thanks.
I want to study more information about this 1kHz idle clock, what documents that i can check about it. I want to know whether the idle clock is still exists when Windows at sleep mode. Thanks.
christian wrote:See the end of http://avrusb.wikidot.com/examples, the section about suspend mode. This explains how suspend mode can be implemented.
If D- is wired to a pin which can trigger an interrupt (e.g. INT1, pin change interrupt), there's also an example available how to implement it.
Suspend mode is documented in the USB specification. When the host goes to sleep it MUST stop sending the 1 kHz pulses. The device may wake up the host by sending an SE0 (= USB Reset = very short disconnect) signal.
Suspend mode is documented in the USB specification. When the host goes to sleep it MUST stop sending the 1 kHz pulses. The device may wake up the host by sending an SE0 (= USB Reset = very short disconnect) signal.
hi, sorry for too much questions since it is too much documents about USB.
I read the document "USB in a Nutshell" from beyondlogic. In page 5 "Electrical", it state "Certain bus states are indicated by single ended signals on D+, D- or both." It seems no more information i can dig into in this documents.
Christian replied: "The device may wake up the host by sending an SE0 (= USB Reset = very short disconnect) signal." <- My device doesn't need to wake up the host. It just need to know host is sleep/OFF, then device go into suspend mode. In this case, can i use D+?
Thanks.
I read the document "USB in a Nutshell" from beyondlogic. In page 5 "Electrical", it state "Certain bus states are indicated by single ended signals on D+, D- or both." It seems no more information i can dig into in this documents.
Christian replied: "The device may wake up the host by sending an SE0 (= USB Reset = very short disconnect) signal." <- My device doesn't need to wake up the host. It just need to know host is sleep/OFF, then device go into suspend mode. In this case, can i use D+?
Thanks.
christian wrote:The 1kHz SE0 pulses are on D-, not D+. You therefore need an interrupt on D-.
You need to detect the Start Of Frame pulses. Since they are on D-, you need to supervise D-. The pulses are short (667 ns) and rare (every 1 ms), so you need hardware to detect them. This hardware could be an interrupt or a counter input.
There are no such pulses on D+ (therefore we use D+ for the USB interrupt so that no unnecessary interrupts are generated).
The USB spec defines this in an abstract language because signal lines are swapped between low speed and full speed devices.
There are no such pulses on D+ (therefore we use D+ for the USB interrupt so that no unnecessary interrupts are generated).
The USB spec defines this in an abstract language because signal lines are swapped between low speed and full speed devices.