If you're an embedded systems engineer, you may want to build a product that either takes input from a human operator or delivers outputs to an operator through a human-readable interface. When such functions are to be implemented, it is common for engineers to use a special type of communication protocol known as the Human Interface Device (HID) protocol.
The HID standard specification was first proposed by Mike Van Flandern, a Microsoft employee who worked closely with the committee responsible for developing the USB standard specifications. The proposal required the establishment of a Human Input Device working group with the goal to standardize and simplify the process of installing many different kinds of computer input and output devices across an equally diverse range of machines and operating systems.
In this week's blog post, we're taking a deep look at human interface devices and the HID standard. We'll look at where the standard and specifications came from, how they are used, and the most common types of human interface devices whose operation is streamlined by the HID standard.
A human interface device can be defined as a type of computer device that ordinarily takes input from humans and gives output to humans. While the original plan for the HID specification was based on the idea of a standard for human input devices, the acronym itself was changed to human interface device as it became clear that the standard would support bi-directional communication, meaning both inputs and outputs.
Prior to the creation of the HID standard, various types of input devices were required to conform to highly specific protocols that varied by the type of device. The communication protocol for each device supported only a relatively narrow set of functions. For example, the standard protocol for a mouse supported X- and Y-axis movement and input from two buttons. This left hardware developers rather restricted in terms of what kinds of peripheral I/O device designs could be supported by computers. Manufacturers either had to overload an existing protocol with excess data, write their own customized device drivers, or conform to the existing protocol (which could stifle innovation).
The impact of the HID standard was that it removed many of the design limitations that were faced by peripherals manufacturers and enabled plug-and-play for most devices without the need to program a unique or customized driver for each new device.
The HID protocol defines two separate entities that are involved in data transfer: the host and the device. By convention, the device is the object that is in direct interface with a human operator, such as a computer mouse or a keyboard. The role of the host, then, is to receive inputs from the device and transmit outputs to the device. A human operator will be responsible for triggering device inputs and receiving device outputs. The most generic host device is a personal computer, but mobile phones, tablets, and other systems may also act as the host under the USB HID standard.
The USB HID protocol allows a human interface device to define its data packets in the form of an HID descriptor, which is then transmitted to the host. A HID descriptor is hard-coded into the device and provides the host with information about the packets that the device will send, including how many packets are supported, what the size will be, and what information will be contained in each bit or byte within packets. The host machine then parses the HID descriptor, enabling it to receive and accurately interpret packets from the device in a way that reflects the desired user input.
The original goal of the HID standard specification was to enable simple installation and usage for a variety of computer input and output devices. As such, there are many different types of HID devices whose operation is vastly improved through the use of USB HID. Some of the most common types of HID devices include:
In addition, gaming controllers, joysticks, touchscreen monitors, magnetic strip readers, fingerprint scanners, and sound output devices like headsets and speakers are all HID devices. Today, these devices can typically be hot-plugged to your PC and used immediately with minimal set-up because of the HID standard.
I2C and SMBus are two-wire serial communication protocols that are compatible with each other, especially at the 100kHz data transfer speed for which both are suited. While the HID protocol was originally targeted for devices that use USB or Bluetooth connectivity, it can also be implemented using other protocols like I2C and SMBus.
When Windows 8 was released, Microsoft wrote a specialized HID miniport driver that enabled communication between I/O devices and Systems-on-Chip (SoC) over an I2C bus. HID over I2C demonstrated an 87-99% reduction in power consumption when compared to HID over USB, making it useful for host machines with a limited power supply, such as mobile phones or tablets.
Embedded systems are frequently deployed in contexts where humans do not interface with them on a regular basis. In some cases, they may be expected to operate for years or decades at a time with minimal human interference. Still, there are some cases where an embedded system may require human inputs and may be expected to communicate outputs to humans through a human interface device. In these cases, implementation of HID over USB or HID over I2C ensures rapid installation and seamless communication between the host machine and human interface devices.
For embedded engineers building HID products, Total Phase creates innovative testing and debugging tools that streamline diagnostic processes, saving you time and money.