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

USB System Architecture

Figure 7-19: IN Transaction During Isochronous Transfer

 

 

IN Packet

 

 

 

Data Packet

 

 

 

 

 

from Host

 

 

 

from USB Device

 

 

 

Sync

 

IN Token

 

EOP

 

Sync

 

Data Packet (up to 1023 byte

 

EOP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Isochronous transfers

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

do not employ handshakes

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OUT Transactions

A typical OUT transaction consists of the token packet, data packet, and handshake packet. However, in some instances an OUT transaction may not include all three packets. OUT transactions can be employed when performing bulk, control, and isochronous transfers. Several conditions may occur during an OUT transaction:

data is sent without errors.

data is sent with errors.

the target is temporarily unable to accept data.

the target is unable to accept data without an existing error condition being cleared.

an isochronous transfer is taking place; thus, data is sent to the target, but no handshake follows the data phase.

Each of these conditions is discussed and illustrated in the following paragraphs.

OUT Transaction Without Data Packet Errors

Figure 7-20 illustrates a normal OUT transaction in which data is successfully sent to the target device without error. The target device, having received the data without error returns an ACK handshake to the root hub. Such OUT transactions can take place during bulk, interrupt, or control transfers.

160

Chapter 7: Packets & Transactions

Figure 7-20: OUT Transaction Without Errors

OUT Packet

 

 

 

Data Packet

 

 

 

Acknowledge Packet

 

 

from Host

 

 

 

to USB Device

 

 

 

from Target Device

Sync

 

OUT Token

 

EOP

 

Sync

 

Data Packet (up to 64 bytes

 

EOP

 

Sync

 

ACK

 

EOP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OUT Transaction with Errors

Figure 7-21 assumes that the same transaction described in the preceding paragraph is performed except that in this instance, the target device detects errors when receiving the data. The target device discards the data and does not respond with a handshake. The host will detect a bus time-out since the expected handshake packet does not appear in time (see “Bus Time-Out” on page 172). The host must retry the OUT transaction at a later time.

Figure 7-21: OUT Transaction with Data Packet Errors

OUT Packet

 

 

Data Packet

 

from Host

 

 

from Host

 

Sync OUT Token

EOP

Sync

Data Packet

EOP

 

 

 

USB device detects erro

r

 

 

 

and does not respond

 

 

 

 

with handshake

 

OUT Transaction — Target Unable to Accept Data

The transaction illustrated in Figure 7-22 results if the target device is temporarily unable to accept data. The target receives the data without error, but cannot accept it (e.g., due to a busy or buffer full condition). In response, the target returns NAK during the handshake phase of the transaction. This informs the host that the target did not accept the data and that the transaction must be retried later.

161

USB System Architecture

Figure 7-22: OUT Transaction to Target That is Unable to Accept Data

OUT Packet

 

 

 

Data Packet

 

 

 

No Acknowledge (NAK)

 

 

from Host

 

 

 

to USB Device

 

 

Packet fromTarget Device

Sync

 

OUT Token

 

EOP

 

Sync

 

Data Packet (up to 64 bytes )

 

EOP

 

Sync

 

NAK

 

EOP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The target device was

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

currently unable to accept data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

to a busy condition

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OUT Transaction With Target Stalled

Figure 7-23 illustrates a transaction that results from the target device being unable to receive data due to an internal error condition. The target receives the OUT token recognizing that it is addressed; however, when the host sends the data packet, the target device is unable to accept the data and returns a STALL to the host during the handshake phase of the transaction. The STALL condition is reported to the host software, which must clear the error condition within the target.

Figure 7-23: OUT Transaction to Stalled Endpoint

OUT Packet

 

 

 

Data Packet

 

 

from Host

 

 

 

to USB Device

Sync

 

OUT Token

 

EOP

 

Sync

 

Data Packet (up to 64 byte s)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The target device is unable to accept

 

 

 

 

 

 

 

 

data due to a device stall condition

STALL Handshake Packet

from Target Device

EOP Sync STALL EOP

OUT Transaction During Isochronous Transfer

Figure 7-24 illustrates an OUT transaction performed during an isochronous transfer. Whether data is received with or without errors by the target device, no handshake phase is performed.

162

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