Chapter 18
426
(++5(++9
When transferring data, the two states on the bus are Differential 0 and Differ-
ential 1. A Differential 0 exists when D+ is a logic low and D- is a logic high. A
Differential 1 exists when D+ is a logic high and D- is a logic low. Chapter 19
has details about the voltages.
The Differential 0/1s dont translate directly into zero and one data states but
instead indicate either a change in logic level, no change in logic level, or a bit
stuff, as explained later in this chapter.
# 25
The Single-ended 0 (SE0) state occurs when both D+ and D- are logic low. The
bus uses the SE0 state when entering the EOP, Disconnect, and Reset states.
# 29
The complement of SE0 is the Single-ended 1 (SE1). This state occurs when
both D+ and D- are logic high. This is an invalid bus state and should never
occur except as specified in the USB battery-charging specification.
((0
In addition to the Differential 0 and Differential 1 states, which are defined by
voltages on the lines, USB also defines two Data bus states, J and K. These are
defined by whether the bus state is Differential 0 or Differential 1 and the speed
of the cable segment:
Defining the J and K states in this way makes it possible to use one terminology
to describe an event or logic state even though the voltages on low- and
full-speed lines differ. For example, a Start-of-Packet state exists when the bus
changes from Idle to the K state. On a full-speed segment, the state occurs
when D- becomes more positive than D+, while on a low-speed segment, the
state occurs when D+ becomes more positive than D-.
% 
) 3
Differential 0 Data J Data K
Differential 1 Data K Data J
Packets on the Bus
427

In the Idle state, no drivers are active. On a full-speed segment, D+ is more pos-
itive than D-, while on a low-speed segment, D- is more positive than D+.
Shortly after device attachment, a hub determines whether a device is low or
full speed by checking the voltages on the Idle bus at the devices port.
$"
When a device is in the Suspend state, a Data K state at the devices port signi-
fies a resume from Suspend.
#2+2%
The Start-of-Packet (SOP) bus state exists when the lines change from the Idle
state to the K data state. Every transmitted low- or full-speed packet begins with
an SOP.
2+2%
The End-of-Packet (EOP) state exists when a receiver has been in the SE0 state
for at least one bit time followed by a Data J state for at least one bit time. A
receiver may optionally accept a shorter minimum time for the Data J state. At
the driver, an SE0 is approximately two bit widths. Every transmitted low- or
full-speed packet ends with an EOP.
(
A downstream port is in the Disconnect state when an SE0 has persisted for at
least 2.5 µs.

A downstream port enters the Connect state when the bus has been in the Idle
state for at least 2.5 µs and no more than 2.0 ms.
$
When an SE0 has lasted for 10 ms, the device must be in the Reset state. A
device may enter the Reset state after an SE0 of at least 2.5 µs. A full-speed
device that is capable of high-speed communications performs the high-speed
handshake during the Reset state.
Chapter 18
428
On exiting the Reset state, a device must be operating at its correct speed and
must respond to communications directed to the default address (00h).
)5GG G
Many of the high-speed bus states correspond to states for low and full speed,
but a few are unique to high speed, and some low/full-speed states have no
equivalents at high speed.
. 2(++5(++9
The two bus states that exist when transferring high-speed data are High-speed
Differential 0 and High-speed Differential 1. As with low and full speeds, a
High-speed Differential 0 exists when D+ is a logic low and D- is a logic high,
and a High-speed Differential 1 exists when D+ is a logic high and D- is a logic
low. The voltage requirements differ at high speed, however, and high speed has
additional requirements for AC differential levels.
. 2((0
The definitions for High-speed Data J and Data K states are identical to those
for full-speed J and K.
0
The Chirp J and Chirp K bus states are present only during the high-speed
detection handshake. The handshake occurs when a USB 2.0 hub has placed a
downstream bus segment in the Reset state. In a Chirp J, D+ is more positive
than D-, and in a Chirp K, D- is more positive than D+.
A high-speed device must use full speed on attaching to the bus. The
high-speed detection handshake enables a high-speed device to tell a USB 2.0
hub that the device supports high speed and to transition to high-speed com-
munications.
As Chapter 4 explained, shortly after detecting device attachment, a device’s
hub places a devices port and bus segment in the Reset state. When a
high-speed-capable device detects the Reset, the device places its line in the
% !
Differential 0 High-speed Data K
Differential 1 High-speed Data J
Packets on the Bus
429
Chirp K state for 1–7 ms. A hub that communicates upstream at high speed
detects the Chirp K and in response, sends an alternating sequence of Chirp K
and Chirp J. The sequence continues until shortly before the Reset state ends.
On detecting the Chirp K and Chirp J sequence, the device disconnects its
full-speed pull-up, enables its high-speed terminations, and enters the Default
state. A hub that communicates upstream at low/full speed ignores the devices
Chirp K. The device doesnt see the answering sequence and knows that com-
munications must take place at full speed.
. 2#-"
The High-speed Squelch state indicates an invalid signal. High-speed receivers
must include circuits that detect the Squelch state, indicated by a differential
bus voltage of 100 mV or less.
. 2
In the High-speed Idle state, no high-speed drivers are active and the
low/full-speed drivers assert SE0. Both D+ and D- are between -10 and +10
mV.
#+. 2%
A Start-of-High-speed Packet (HSSOP) exists when a segment changes from
the High-speed Idle state to the High-speed Data K state. Every high-speed
packet begins with a Start of High-speed Packet.
+. 2%
An End of High-speed Packet (HSEOP) exists when the bus changes from the
High-speed Data K or Data J state to the High-speed Idle state. Every
high-speed packet ends with an End of High-speed Packet.
. 2(
Removing a high-speed device from the bus also removes the high-speed line
terminations at the device. Removing the terminations causes the differential
voltage at the hubs port to double. A differential voltage of at least 625 mV on
the data lines indicates the High-speed Disconnect state. A USB 2.0 hub con-
tains circuits that detect this voltage.
Chapter 18
430
PP5
All data on a USB 2.0 bus is encoded using a format called non-return to zero
inverted (NRZI) with bit stuffing. The encoding ensures that the receiver
remains synchronized with the transmitter without the overhead of sending a
separate clock signal or Start and Stop bits with each byte.
If you use an oscilloscope or logic analyzer to view USB data on the bus, you’ll
find that reading the bits isnt as easy as matching voltage levels to logic levels.
Instead of defining logic zeroes and ones as voltages, NRZI encoding defines
logic zero as a voltage change, and logic one as a voltage that remains the same.
Figure 18-1 shows an example. Each logic zero results in a change from the pre-
vious state. Each logic one results in no change in the voltages. The bits trans-
mit least-significant-bit first.
Fortunately, USB hardware performs the encoding and decoding automatically
so device developers and programmers dont have to do it. The encoded data is
harder to interpret on an oscilloscope or logic analyzer, but as Chapter 17
showed, a protocol analyzer will decode the data for you.
Figure 18-1. In NRZI encoding, a 0 causes a change and a 1 causes no change.
Bit stuffing adds a 0 after six consecutive 1s.