Hardware Reference
In-Depth Information
subpipe, data flows from the root hub to the device or the other way. There is no
traffic between two I/O devices.
Precisely every 1.00
0.05 msec, the root hub broadcasts a new frame to keep
all the devices synchronized in time. A frame is associated with a bit pipe and
consists of packets, the first of which is from the root hub to the device. Subse-
quent packets in the frame may also be in this direction, or they may be back from
the device to the root hub. A sequence of four frames is shown in Fig. 3-58.
±
Time (msec)
0
1
2
3
Idle
Frame 0
Frame 1
Frame 2
Frame 3
Packets
from root
Packets
from root
SOF
SOF IN DATA ACK
SOF
SOF OUT DATA ACK
From
device
Data packet
from device
SYN PID PAYLOAD CRC
SYN PID PAYLOAD CRC
Figure 3-58. The USB root hub sends out frames every 1.00 msec.
In Fig. 3-58 there is no work to be done in frames 0 and 2, so all that is needed is
one SOF (Start of Frame) packet. This packet is always broadcast to all devices.
Frame 1 is a poll, for example a request to a scanner to return the bits it has found
on the image it is scanning. Frame 3 consists of delivering data to some device, for
example to a printer.
USB supports four kinds of frames: control, isochronous, bulk, and interrupt.
Control frames are used to configure devices, give them commands, and inquire
about their status. Isochronous frames are for real-time devices such as micro-
phones, loudspeakers, and telephones that need to send or accept data at precise
time intervals. They have a highly predictable delay but provide no retransmis-
sions in the event of errors. Bulk frames are for large transfers to or from devices
with no real-time requirements, such as printers. Finally, interrupt frames are
needed because USB does not support interrupts. For example, instead of having
the keyboard cause an interrupt whenever a key is struck, the operating system can
poll it every 50 msec to collect any pending keystrokes.
A frame consists of one or more packets, possibly some in each direction.
Four kinds of packets exist: token, data, handshake, and special. Token packets are
from the root to a device and are for system control. The SOF , IN , and OUT pack-
ets in Fig. 3-58 are token packets. The SOF packet is the first in each frame and
marks the beginning of the frame. If there is no work to do, the SOF packet is the
 
Search WWH ::




Custom Search