Posts Tagged ‘The Host Manages’

The Host Manages Traffic on The Bus

This chapter looks at the elements that make up a USB transfer. You don’t need to know every detail about USB transfers to get a project up and running, but understanding something about how the transfers work can help in deciding which transfer types a device should use, writing device firmware, and debugging.

To send or receive data, a host initiates a USB transfer. Each transfer uses a defined format to send data, addressing information, error-detecting bits, and status and control information. The format varies with the transfer type and direction.

Every USB communication (with one exception in USB 3.0) is between a host and a device. The host manages traffic on the bus, and the device responds to communications from the host. An endpoint is a device buffer that stores received data or data to transmit. Each endpoint has a number, a direction, and a maximum number of data bytes the endpoint can send or receive in a transaction.
Each USB transfer consists of one or more transactions that can carry data to or from an endpoint. A USB 2.0 transaction begins when the host sends a token packet on the bus. The token packet contains the target endpoint number and direction. An IN token packet requests a data packet from the endpoint. An OUT token packet precedes a data packet from the host. In addition to data, each data packet contains error-checking bits and a Packet ID (PID) with a data-sequencing value. Many transactions also have a handshake packet where the receiver of the data reports success or failure of the transaction. For USB 3.0 transactions, the packet types and protocols differ, but the transactions contain similar addressing, error-checking, and data-sequencing values along with the data.

Tags: , ,

No Comments



SetPageWidth