USB Device Addressing- Explained

USB



In this article, we explain how USB device addressing works.

USB device addressing is how the USB host assigns an address to another USB device when it is communicating with it.

Every USB device connected to the bus has a unique address.

The address is the unique identifier that the host uses to know which USB device it must communicate with.

The address of the USB device that a host communicates with is present within the token packet of a USB transaction.

Remember that in a USB transaction, the token packet is the first user-defined packet which gets sent out.

Below is the format of a token packet of a USB transaction.


USB token packet


So you can see the label, ADDR, which will specify the address of the USB device.

Based on whether the token packet specifies IN, OUT, or SETUP will determine if the host sends data to the device, reads data from the device, or sends SETUP data to the device to make specific requests.

An important thing to note is that the ADDR bit is 7 bits long.

27 is 128.

So a USB address can technically address up to 127 devices, from 1 to 127.

This is because address cannot be used.

This means that in a USB system, there is a single host controller and up to 127 slave devices. This is how it could work in theory but in actual practice, the USB system would run out of power or bandwidth or other resources before it could have 127 devices connected to the system.

An important thing to note is that the default device address is 0; this is until it gets assigned an address by the USB host.

The address of a USB device is not fixed and is assigned dynamically by the USB host. The USB host assigns the address while enumerating the device.

The device address can be different each time the USB device is disconnected and reconnected to the system. So, again, the address of a device is not fixed and is assigned dynamically by the USB system.

So this is an overview of USB device addressing and how it works.



Related Resources





HTML Comment Box is loading comments...