Such a cable is used by smart phones (which typically use a micro-B port) to allow you to connect devices such as USB flash drives to them. A USB On-The-Go cable can be used to convert the micro-B connector to an A connector, allowing the NU32 to act as a host. Apart from the mini-B USB connector you use for programming the NU32, the board has a micro-B connector, which makes it a device by default. The physical connectors for hosts and devices are incompatible this prevents two devices or two hosts from being connected to each other. Each host can control up to 127 devices through a hub. With USB, the bus is controlled by a single master called the host, typically your computer or a smart phone (although the PIC32 can act as a host too). To support such a profusion of devices, the USB protocol is relatively complicated therefore, we describe only the minimum required to use Harmony’s USB middleware to create simple USB devices. An unimaginable number of USB devices have been created over the years.
If you have used a computer in the past 20 years, you probably have used universal serial bus (USB) devices. Elwin, in Embedded Computing in C with the PIC32 Microcontroller, 2016 20.8.1 USB Basics
If the attached USB device is a function, then attachment notifications will be dispatched by USB software to interested host software. If the attached USB device is a hub and USB devices are attached to its ports, then the above procedure is followed for each of the attached USB devices. The host establishes a control pipe for the USB device using the assigned USB address and endpoint number zero. The host determines if the newly attached USB device is a hub or a function and assigns a unique USB address to the USB device.
All USB devices are addressed using the USB Default Address when initially connected or after they have been reset.
The host enables the port and addresses the USB device with a control pipe using the USB Default Address. The hub responds by identifying the port used to attach the USB device. The host queries the hub to determine the reason for the notification. Hubs indicate the attachment or removal of a USB device in its per port status. William Buchanan BSc (Hons), CEng, PhD, in Computer Busses, 2000 Attachment of USB devicesĪll USB devices attach to the USB via a port on specialised USB devices known as hubs.