The USB supports four different transfer types: Bulk, Control, Interrupt, and Isochronous. The Endpoint 0 (EP0) is configured for Control Type transaction with a fixed packet size of 8. The other user specific Endpoints (EP4-11) can be defined as Bulk, Interrupt, and Isochronous. Endpoints 1, 2, and 3 are reserved for downloading DSP code and are hard-wired to be Bulk Out pipes with a maximum packet size of 64. They cannot be used for data transfers for user-specific purpose.
The USB supports four different data transfer types: Bulk, Control, Isochronous, and Interrupt. These types are described in the subsections that follow.
Bulk transactions guarantee error-free delivery of data between the host and a function Endpoint. Bulk transactions start with the host issuing an IN or an OUT token. For example, if the host is writing data, it issues an OUT transaction followed by a DATA0 (PID) packet. Upon receiving the packet, the function can respond by:
• Issuing an ACK to signify the proper receipt of data. The host can then send the next data packet (if it has any) in the data sequence.
• Not acknowledging the transaction to force a timeout if there is a CRC error or bit stuffing errors in the data packet. In this situation, the host retransmits the data packet using the same PID as the failed packet.
Packet sizes for the Bulk data are limited to 8, 16, 32, and 64 bytes. Each USB Endpoint is assigned one of these sizes and may not switch between them. Large data transfers are broken down into units of these basic packet sizes. For example, a 1044 byte file transfer across USB to a 64 byte bulk Endpoint consists of 17 packet transfers as follows: 16 packets of 64 bytes each and 1 packet of 20 bytes. The USB Host assumes that the short packet represents an end of transfer indicator.
Bulk Transactions do not have a guaranteed bandwidth associated with them. They use whatever bandwidth that has been left over after all other types of transactions have been serviced. They are the preferred transaction type if guaranteed error free delivery of data is required.
The isochronous transaction is used when there is a requirement for guaranteed constant bandwidth for the data transfer. These transfers occur in every frame and guarantee one packet transfer per USB frame. The maximum packet size (up to 1023 bytes) is specified in the Endpoint descriptor table. These transfers are not acknowledged. The data in the Isochronous transfers must be error tolerant. In the presence of CRC, an error may be detected, but the data cannot be retransmitted.
Control Transfers are used for short command/control messages between a host and a function. Control transactions start with a setup stage. The format and contents of the packet are defined in the USB specification. If a data stage follows, the transfer is essentially similar to the bulk transfer. The status stage completes the handshaking sequence.
During the setup stage, the USB Host sends an 8-byte setup packet to the USB Device. The packet specifies information such as the types of command (standard-request, vendor-specific, device-class specific), direction and size of the data phase (if any), and the specific command code.
After receiving the command, the device (function) can either process the command and proceed through the data and status phase or ignore the command. Functions cannot issue a NAK or STALL to ignore setup tokens. If the setup token packet is corrupt, it is ignored and a timeout occurs.
In the USB system, only a host can initiate a USB transaction. The function can have the host make regularly scheduled polls of itself. The frequency of the polling is specified by the function during the bus enumeration process. This process consists of a host sending out an IN token packet to the function and the function responding with either a data packet (if available) or a NAK or STALL (if a data packet is not available). This is an Interrupt transaction. The maximum allowable data payload for an interrupt transaction is 64 bytes.
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.