How does USB work?

All USB data transfers are initiated by the USB host. The host controls the communication time by maintaining the time interval for weighing frames.
USB-Frame-Start-of-Frame-Sequence-and-USB-Transactions

Table of Contents

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

The time interval for each frame is determined by the specified USB speed. One of the competencies required for USB compliance certification is that the host accurately publishes SOF.

The SOF interval of low speed or full speed is 1ms, and that of high speed is 125us.

USB Frame (Start of Frame Sequence and USB Transactions)

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. The size of the endpoints (that is, the amount of data in the endpoints) can vary greatly from device to device.

Device endpoints appear as numbered pairs. Endpoint numbers start at 0 and can be 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. For example, endpoint 1 is two endpoints; Endpoint 1IN (EP1IN) and endpoint 1OUT (EP1OUT).

The USB host sends data to the device


When a host wants to send a message to a device, it places the message in an OUT endpoint on the device using a WRITE transaction. The application code of the device monitors the OUT endpoint to determine whether any messages have been received from the host. Upon detecting the presence of a message from the Host, the Device copies the message from the OUT endpoint.

Writing to a USB Device

The USB host receives data from the device


If the device’s program wants 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.

Sending data to the USB host

Communication parameters


The data rate at which a USB communicates with an endpoint depends on three things:

  • The signal rate of the frame is determined by the specified USB speed.
  • The size of the endpoint (the amount of data moved per transaction).
  • The frequency with which the host issues transactions to the endpoint. This can range from a few 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 inserted into the host and successfully enumerated. The enumeration procedure informs the host which transport type to use when communicating with the device endpoint.

Control and configuration


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

END.

DiskMFR Field Sales Manager - Leo

It’s Leo Zhi. He was born on August 1987. Major in Electronic Engineering & Business English, He is an Enthusiastic professional, a responsible person, and computer hardware & software literate. Proficient in NAND flash products for more than 10 years, critical thinking skills, outstanding leadership, excellent Teamwork, and interpersonal skills.  Understanding customer technical queries and issues, providing initial analysis and solutions. If you have any queries, Please feel free to let me know, Thanks

DiskMFR Free Sample Application
  • Still worried about storage product quality?
  • Current suppliers can’t provide perfect after-sales service

  • Get our free sample for testing now

Leave a Reply

Your email address will not be published. Required fields are marked *

five × one =

Please let us know what you require, and you will get our reply within 24 hours.

  • Our team will answer your inquiries within 24 hours.
  • Your information will be kept strictly confidential.

Let's Have A Chat

Learn How We Served 100+ Global Device Brands with our Products & Get Free Sample!!!

Email Popup Background 2