Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
USB System Architecture (USB 2.0).pdf
Скачиваний:
197
Добавлен:
03.05.2015
Размер:
7.03 Mб
Скачать

Chapter 7: Packets & Transactions

packet-specific data only, since the packet ID has its own check bits. See “CRC Errors” on page 169.

End of Packet (EOP)

The end of each packet is signaled by the sending agent by driving both differential data lines low for two bit times followed by an idle for one bit time. The agent receiving the packet recognizes the EOP when it detects the differential data lines both low for greater than one bit time. Figure 7-6 illustrates an EOP being signaled on the USB bus.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 7-6: End of Packet signaling

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VOH (max)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3.6 Vdc

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EOP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VOH (min)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Width

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.8 Vdc

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 bit time

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VSE (max)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.0 Vdc

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VSE (min)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0.8 Vdc

VOL (max)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0.3 Vdc

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

VSS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Token Packets

Token packets define the type of transaction that is to be broadcast over the USB. All transactions begin with a token packet. Four types of token packets are defined by the USB specification:

SOF (Start of Frame) — indicates start of the next 1ms frame.

IN — specifies a USB transaction used to transfer data from a target USB device to the system.

OUT — specifies a USB transaction used to transfer data from the system to a target USB device.

SETUP — indicates the start of a control transfer. SETUP is the first stage of

147

USB System Architecture

a control transfer and is used to send a request from the system to the target USB device.

Table 7-1 on page 148 lists the token types supported and describes the packetspecific information embedded within the packet and the action specified. Each token is identified by its packet ID, as shown in column three.

Table 7-1: USB Tokens

PID Type

PID

PID[3:0]

Description of Token Packet

Name

 

 

 

 

 

 

 

 

 

 

 

Token

SOF

0101b

Contains start of frame (SOF) marker and frame

 

 

 

number. The SOF token is used by isochronous

 

 

 

endpoints to synchronize its transfers.

 

 

 

 

Token

SETUP

1101b

Contains USB device address and endpoint num-

 

 

 

ber. Transfer is from host to function for setting up

 

 

 

a control endpoint (e.g., configuration).

 

 

 

 

Token

OUT

0001b

Contains the USB device address and endpoint

 

 

 

number. The transfer is from host to function.

 

 

 

 

Token

IN

1001b

Contains the USB device address and endpoint

 

 

 

number. The transfer is from function to host.

 

 

 

 

SOF Packet

SOF provides a way for target devices to recognize the beginning of a frame. As an example, isochronous applications can use SOF to trigger and synchronize the start of a transfer at the beginning of a specified 1ms frame. The SOF packet is broadcast to all full-speed devices (including hubs) at the beginning of each frame. SOF packets are never transferred to low-speed devices, since they cannot support isochronous transfers.

Embedded within the SOF packet is an 11-bit frame number as illustrated in Figure 7-7 on page 149. The frame number is verified by the receiver with the five CRC bits. Note that the SOF packet defines a transaction consisting solely of the token packet. No data or handshake packet is associated with an SOF packet, so delivery is not guaranteed. However, USB targets must perform the checks and take the appropriate action as follows:

PID check error — ignore the packet

Frame CRC error — ignore the frame number

148

Chapter 7: Packets & Transactions

Figure 7-7: Format of an SOF Packet

IN Packet

When software wishes to read information from a given device, an IN token is used. The IN packet notifies the target USB device that data is being requested by the system. IN transactions may be used in a variety of USB transfers types including:

Interrupt transfers

Bulk transfers

Data phase of control transfers

Isochronous transfers

As illustrated in Figure 7-8 on page 150, an IN token packet consists of the ID type field, the ID check field, the USB device and endpoints addresses, and five CRC bits. An IN transaction starts with an IN packet broadcast by the root hub, followed by a data packet returned from the target USB device, and in some cases concluded with a handshake packet sent from the root hub back to the target device to confirm receipt of the data. Note that IN transactions used during isochronous transfers do not include a handshake packet.

The amount of data that can be transferred during an IN transfer depends on the transfer type being performed as discussed in Chapter 6, entitled "LS/FS Transfer Types & Scheduling," on page 117.

149

USB System Architecture

Figure 7-8: IN Token Packet Format

 

 

 

 

 

7\SH )LHOG

 

 

 

&KHFN )LHOG

 

'HYLFH $GGUHVV

 

(QG3RLQW 1XP

 

&5&

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OVE

PVE

 

OVE

PVE

 

OVE

PVE

 

OVE

PVE

 

PVE

OVE

 

 

 

 

 

 

 

 

 

 

 

 

 

 

$GGU

$GGU

 

(3

(3

 

&5&

&5&

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

,GOH 6\QF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(23

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OUT Packet

System software specifies an OUT transaction when data is to be transferred to a target USB device. Four types of transfers employ OUT transactions:

Bulk transfers

Interrupt transfers

Data phase of control transfers

Isochronous transfers

Figure 7-9 on page 151 illustrates the contents of an OUT token packet. An OUT token packet consists of the packet ID or type field, the type check field, the USB target device and endpoint ID, and a 5-bit CRC. The OUT token packet is followed by a data packet and a handshake (no handshake for isochronous). The data payload size is governed by the transfer employing the OUT transaction.

150

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]