■ FIGURE 2.
contains a lot of
only requires a
the AT90USB162 comes with a Device Firmware Update
(DFU) bootloader that allows you to program the device
using the USB port. All you need to do is download,
install, and run Atmel’s free DFU programmer software to
load the firmware supplied with this article; no external
programmer is required.
Once programmed, when the device is connected to
a USB port it will tell Windows to automatically install the
correct driver and your volume/mute controller will be up
and running. Pretty neat!
The AT90USB162 is really a USB “toolkit.” It contains
a USB Serial Interface Engine (SIE) that manages all of the
basic USB communications functions:
• Error detection and correction.
This takes away a lot of complexity from the software,
leaving the implementation of the USB protocol and
managing the encoder and pushbutton used for the
volume control and mute. Only a few external
components are needed to complete the design. Refer to
the schematic in Figure 2.
A rotary encoder is used for data entry. The encoder
controls the volume and the part specified contains a
pushbutton switch that is activated by pressing down on
the encoder shaft for the mute function. This keeps the
overall design very compact.
I planned the project around the USB Human
Interface Device (HID) class driver built into the Windows
operating system — no additional drivers are required. The
HID class specification describes all sorts of devices
including mice, keyboards, and joysticks, and includes the
media controls needed for this project.
All of the information needed to identify our device as
a HID is stored in the device’s programmable memory in
a data structure called a descriptor. Within the descriptor,
there is an additional structure called a report that
describes the features in the host’s operating system that
are to be controlled. The report for our device brings
together some useful media controls and is one byte in
January 2012 39