USB communication principle

Wed Nov 30 16:31:07 CST 2022

USB-communication-principle-HornmicLink

USB communication principle

All USB data transfers are initiated by the USB host. The host controls the communication timing by maintaining a time interval called a frame. The host sends a start-of-frame (SOF) sequence on the USB data line at the beginning of each frame.

The interval between each frame is determined by the specified USB speed. one requirement for USB compliance certification is the host's ability to accurately issue SOFs. The SOF interval is 1ms for low speed or full speed, and 125us for high speed.

The following figure shows the USB host and device into using transactional communication during the interframe period.

USB-Frame-Transactional-Communication

The mechanism for transferring data involves the host reading and writing to a set of memory locations located on each device. These memory locations are called endpoints. Endpoints are essentially incoming and outgoing baskets.

Device endpoints appear as numbered pairs. Endpoint numbers start at 0 and go up to 32. each endpoint number has an IN and an OUT endpoint. The OUT endpoint carries data from the host, while the IN endpoint contains data sent to the host.

USB Host sends data to the Device

When the host sends a message to the device, the message is placed in the OUT endpoint on the device by using the WRITE transaction. The device's application monitors the OUT endpoint to determine if any messages have been received from the host. After detecting the presence of a message from the host, the device copies the message from the OUT endpoint.

USB-Host-sends-data-to-Device

USB Device sends data to the Host

If the device's application wishes to communicate with the host, a message is placed in the IN endpoint. The message will remain in the IN endpoint until the host issues a READ transaction. The READ transaction causes the contents of the IN endpoint to be sent to the host.

USB-Device-sends-data-to-Host

Communication parameters

The data rate at which USB communicates with endpoints depends on three things.

1. The signal rate of the frame, determined by the specified USB speed

2. The size of the endpoint (how much data is moved per transaction)

3. The frequency with which the host sends transactions to the endpoint. This can vary from multiple transactions per frame to multiple frames between endpoint transactions.

Information about all endpoint parameters and communication requirements is defined by the device and provided to the host when the device is plugged into the host and successfully enumerated. The enumeration process informs the host which transport type to use when communicating with the device's endpoints.

Control and Configuration

Each USB device reserves Endpoint 0 as a unique endpoint, called the Control Endpoint. EP0 IN contains the description of the USB device read by the host during enumeration. EP0 OUT enables the host to send configuration commands to the device.



HornmicLink Logo-Intelligent Connection Solutions-China USB Cable provider,Charging Cable,Hub Adapter,USB Charger manufacture

By Henry @221130 16:38