Pages

Easy Understanding About USB For Beginner's (Part 3)

Kamis, 20 Agustus 2009
Easy Understanding About USB For Beginner's (Part 3)

Transactions
A successful transaction is a sequence of three packets which performs a simple but secure transfer of data. For IN and OUT transactions used for isochronous transfers, there are only 2 packets; the handshake packet on the end is omitted. This is because error-checking is not required.

1. Out Transactions

A successful OUT transaction comprises two or three sequential packets. If it were being used in an Isochronous Transfer there would not be a handshake packet from the device.

On a low or full speed link, the PID shown as DATAx will be either a DATA0 or a DATA1. An alternating DATA0/DATA1 is used as a part of the error control protocol to (or from) a particular endpoint.


2. In Transactions

A successful IN transaction comprises two or three sequential packets. If it were being used in an Isochronous Transfer there would not be a handshake packet from the host. Here again, the DATAx is either a DATA0 or a DATA1.


3. Setup Transaction

A successful SETUP transaction comprises three sequential packets. This is similar to an OUT transaction, but the data payload is exactly 8 bytes long, and the SETUP PID in the token packet informs the device that this is the first transaction in a Control Transfer (see below). As will be seen below, the SETUP transaction always uses a DATA0 to start the data packet.

Data Flow Types

There are four different ways to transfer data on a USB bus. Each has its own purposes and characteristics.

1. Bulk Transfer

Bulk transfers are designed to transfer large amounts of data with error-free delivery, but with no guarantee of bandwidth. The host will schedule bulk transfers after the other transfer types have been allocated.

The max packet size is 8, 16, 32 or 64 at full Speed and 512 for high speed. Bulk transfers are not allowed at low speed.

2. Interrupt Transfer

Interrupt transfers are regularly scheduled IN or OUT transactions, although the IN direction is the more common usage.

Interrupt packets can have any size from 1 to 8 bytes at low speed, from 1 to 64 at full speed or up to 1024 bytes at high speed.

3. Isochronous Transfer

Isochronous transfers have a guaranteed bandwidth, but error-free delivery is not guaranteed.


The main purpose of isochronous transfers is applications such as audio data transfer, where it is important to maintain the data flow, but not so important if some data gets missed or corrupted. The special feature of these transactions is that there is no handshake packet at the end.

4. Control Transfer

This is a bi-directional transfer which uses both an IN and an OUT endpoint. Each control transfer is made up of from 2 to several transactions. Control transfers are used for initial configuration of the device by the host, The max packet size for the data stage is 8 bytes at low speed, 8, 16, 32 or 64 at full Speed and 64 for high speed.


Summary Of Transfer

Each of the USB’s four transfer types is suited for different uses.

How Controlling Device

  1. When you plug a USB device in, the host becomes aware. The host now signals a USB Reset to the device

  2. In this state the device responds to the default address 0.The host will now send a Get Descriptor request to endpoint 0 of address 0
  3. Typically (i.e. with Windows) the host will now reset the device again, It then sends a Set New Address request to Device
  4. Typically the host will now begin to quiz the device for as many details as it feels it needs. At the moment the device is in an addressed but unconfigured state
  5. Once the host feels it has a clear enough picture of what the device is, it will load a suitable device driver.
  6. The device driver will then select a configuration for the device, by sending a Set Configuration request to the device
  7. The device is now in the configured state, and can start working as the device it was designed to be

Tidak ada komentar: