Design Article
Introduction to USB—Part IV
Christian Legare, Micrium
1/16/2013 1:58 PM EST
1-8 DATA FLOW MODEL
This section defines the elements involved in the transmission of data across USB.
Endpoints function as the point of origin or the point of reception for data. An endpoint is a logical entity identified using an endpoint address. The endpoint address of a device is fixed, and is assigned when the device is designed, as opposed to the device address, which is assigned by the host dynamically during enumeration. An endpoint address consists of an endpoint number field (0 to 15), and a direction bit that indicates if the endpoint sends data to the host (IN) or receives data from the host (OUT). The maximum number of endpoints allowed on a single device is 32.
Endpoints contain configurable characteristics that define the behavior of a USB device:
- Bus access requirements
- Bandwidth requirement
- Error handling
- Maximum packet size that the endpoint is able to send or receive
- Transfer type
- Direction in which data is sent and receive from the host
ENDPOINT ZERO REQUIREMENT
Endpoint zero (also known as Default Endpoint) is a bi-directional endpoint used by the USB host system to get information, and configure the device via standard requests. All devices must implement an endpoint zero configured for control transfers (see section “Control Transfers” on page 49 for more information).
1-8-2 PIPES
A USB pipe is a logical association between an endpoint and a software structure in the USB host software system. USB pipes are used to send data from the host software to the device’s endpoints. A USB pipe is associated to a unique endpoint address, type of transfer, maximum packet size, and interval for transfers.
The USB specification defines two types of pipes based on the communication mode:
- Stream Pipes: Data carried over the pipe is unstructured.
- Message Pipes: Data carried over the pipe has a defined structure.
The USB specification requires a default control pipe for each device. A default control pipe uses endpoint zero. The default control pipe is a bi-directional message pipe.
1-8-3 TRANSFERS
The USB specification defines four transfer types that match the bandwidth and services requirements of the host and the device application using a specific pipe. Each USB transfer encompasses one or more transactions that send data to and from the endpoint. The notion of transactions is related to the maximum payload size defined by each endpoint type, that is when a transfer is greater than this maximum, it will be split into one or more transactions to fulfill the action.
CONTROL TRANSFERS
Control transfers are used to configure and retrieve information about the device capabilities. They are used by the host to send standard requests during and after enumeration. Standard requests allow the host to learn about the device capabilities; for example, how many and which functions the device contains. Control transfers are also used for class-specific and vendor-specific requests.
A control transfer contains three stages: Setup, Data, and Status. These stages are listed in:

BULK TRANSFERS
Bulk transfers are intended for devices that exchange large amounts of data where the transfer can take all of the available bus bandwidth. Bulk transfers are reliable, as error detection and retransmission mechanisms are implemented in hardware to guarantee data integrity. However, bulk transfers offer no guarantee on timing. Printers and mass storage devices are examples of devices that use bulk transfers.
INTERRUPT TRANSFERS
Interrupt transfers are designed to support devices with latency constrains. Devices using interrupt transfers can schedule data at any time. Devices using interrupt transfer provide a polling interval which determines when the scheduled data is transferred over the bus.Interrupt transfers are typically used for event notifications.
Isochronous transfers are used by devices that require data delivery at a constant rate with a certain degree of error-tolerance. Retransmission is not supported by isochronous transfers.
Audio and video devices use isochronous transfers.


N6DJL
1/17/2013 7:52 AM EST
This description is the most clear and concise that I have ever seen! I wish I had seen this years ago.
Thanks.
Sign in to Reply
cmathas
1/17/2013 2:55 PM EST
Ah, better late! There will be at least 2-3 more segments posted. Stay tuned!
Sign in to Reply
Colli
1/21/2013 5:13 AM EST
no 0000 packet ID?
Sign in to Reply
DonkeyHotay
1/22/2013 11:39 AM EST
packet ID 1100 is both PRE and ERR ?
I'm confused!
Sign in to Reply
reanimator
1/23/2013 5:37 AM EST
-- packet ID 1100 is both PRE and ERR ?
Good question
Here what I have found regarding this:
* PRE Is issued to hubs by the host to indicate that the
next packet is low speed.
* ERR: Returned by a hub to report an error in a split
transaction. (HS Only)
Source: [http://www.cypress.com/?docID=33237]
Sign in to Reply