USB States
Some of the USB bus states are:
Idle: The bus is in idle state when the pulled-up line is high and the other line is low. This is the state of the lines before and after a packet transmission.
Detached: When no device is connected to the bus, the host sees both lines as low.
Attached: When a device is connected to the bus, the host sees either Dþ or D- go to logic high, which means a device has been plugged in.
J state: The same as idle state.
K state: The opposite of J state.
SE0: The single ended zero state, where both lines on the bus are pulled low.
SE1: The single ended one state, where both lines on the bus are high. SE1 is an illegal condition on the bus; it must never be in this state.
Reset: When the host wants to communicate with a device on the bus, it first sends a “reset” condition by pulling low both data lines (SE0 state) for at least 10ms.
EOP: The end of packet state, which is basically an SE0 state for 2 bit times, followed by a J state for 1 bit time.
Keep alive: The state achieved by EOP. Keep alive is sent at least once every millisecond to keep the device from suspending.
Suspend: Used to save power, suspend is implemented by not sending anything to a device for 3ms. A suspended device draws less than 0.5mA from the bus and must recognize reset and resume signals.
Resume: A suspended device is woken up by reversing the polarity of the signal on the data lines for at least 20ms, followed by a low-speed EOP signal.