When operating, Universal Serial Bus (USB) systems have a single Host which controls all communications within the system. The Host sends communication requests and Devices respond to these requests. USB Devices do not initiate data transfer events.
Traditionally, nodes in USB networks operate in either Device or Host mode in perpetuity. USB v2.0 and earlier specifications have no provision for role changing. A 2.0 Device always acts as a Device and a 2.0 Host always operates as a Host. USB On-the-Go (OTG) and USB v3.0 (and above) provide the ability for a node to change roles from an upstream facing port (Device) to a downstream facing device (Host) and vice versa.
USB Host designs consist of a USB Host controller hardware circuit and a software component:
USB Hardware
- Detects the attachment and removal of USB Devices
- Supplies power to attached USB Devices
- Manages control and data flow between the USB Host and USB Devices
- Provides Cyclic Redundancy Check (CRC) error checking of transactions
USB Host Software
- Handles USB Devices and their connectivity
- USB Device enumeration and configuration
- Loads Device drivers for the Host CPU to access the attached Devices.
Host Application Tasks
USB connectivity adds a communications element to a design. In addition to the USB communication task, the product must also contain an application program. This application program can run on the same MCU running the USB communication tasks or may run on a separate CPU. Many developers of embedded USB applications using 32-bit PIC® MCUs combine the application software with the Host USB interface software into the PIC32. Information on how this is accomplished can be found in the MPLAB® Harmony documentation.