DataSheet.es    


PDF TB054 Data sheet ( Hoja de datos )

Número de pieza TB054
Descripción An Introduction to USB Descriptors
Fabricantes Microchip Technology 
Logotipo Microchip Technology Logotipo



Hay una vista previa y un enlace de descarga de TB054 (archivo pdf) en la parte inferior de esta página.


Total 10 Páginas

No Preview Available ! TB054 Hoja de datos, Descripción, Manual

TB054
An Introduction to USB Descriptors
with a Game Port to USB Game Pad Translator Example
Author: Reston Condit
Microchip Technology Inc.
INTRODUCTION
This Technical Brief demonstrates the translation of a
game port game pad to a USB game pad using the
PIC16C765, Microchip's low-speed USB PICmicro®
microcontroller (MCU). The purpose of this Technical
Brief is not only to show the translation of a game pad
to USB, but also to show how to successfully develop
a USB peripheral using the PIC16C765. An under-
standing of USB descriptors is the foundation for
successful USB peripheral development.
Note:
This Technical Brief is the first in a series
of five technical briefs. This series is
meant to familiarize developers with USB.
For the best understanding of USB, read
the briefs in order: TB054, TB055, TB056,
TB057 and TB058.
USB Basics
All USB communication takes the form of frames sent
over the USB bus. Frames are one-millisecond incre-
ments in which the host schedules what device end-
points it will communicate with. At the scheduled time,
the host and device send one another requests, or
data, in the form of packets, which are limited in length
to eight bytes for low-speed devices. All packets are
sent to and received by the device via endpoints. End-
points are buffers where a device either puts data to
wait for a chance to be sent to the host, or where data
received from the host is stored until the device has a
chance to access the data and utilize it. Low-speed
devices have two endpoints that can be configured by
the device as IN or OUT (with respect to the host).
These are Endpoints 1 and 2. Endpoint 0 is reserved
for control transfers between the host and device. This
is the bidirectional avenue through which the host and
device share administrative data. Enumeration is the
process in which a peripheral describes what type of
device it is to the host, and occurs via Endpoint 0.
USB is a master-slave protocol. In other words, the
host (i.e., PC) directs all communications to and from
the peripherals. Peripherals do not send information to
the host unless the host requests the information. How
does a peripheral tell the host what type of device it is
when it is first connected to the host? The answer lies
in the use of “descriptors,” as described in the following
section.
Descriptors
GENERAL
USB descriptors tend to be the biggest stumbling block
for developers that have been recently introduced to
USB. The purpose of descriptors is to communicate the
identity of a particular peripheral to the host. For
instance, the game pad in this technical brief communi-
cates to the host that it is a two axis, six-button game
pad that sends data to the host via Endpoint 1. A device
does not volunteer this information to the host, rather
the host requests this information when it detects that a
new device has been attached to the USB bus. As
mentioned before, the process in which the host
requests and receives a device's descriptors is called
“enumeration.”
Peripherals have more than one descriptor. Each new
descriptor progressively provides the host more infor-
mation about the peripheral or about other descriptors
to follow. Descriptors can be thought of as a hierarchy.
The first descriptor, the device descriptor, is very gen-
eral and conveys the most basic information about the
device. The next descriptor is more specific, and so on,
until the host finally gains all the information it needs to
communicate effectively with the device.
Game pads fall under the Human Interface Device
(HID) class. Mice, keyboards and LED displays are all
examples of other devices that fall into the HID class.
The HID class is unique in that driver support is sup-
plied automatically by Windows® (Windows 98 second
edition and newer) and the Macintosh® operating sys-
tems. These operating systems will custom build a
driver whenever they detect a new HID peripheral. The
driver is constructed from the data format conveyed in
the report descriptor received from that device. Devel-
oping within the HID class specification is the easiest
way to learn how USB works because the developer
doesn't have to be concerned with writing a driver at the
host end.
2004 Microchip Technology Inc.
DS91054C-page 1

1 page




TB054 pdf
TB054
FIGURE 1:
USB GAME PAD CIRCUIT DIAGRAM(1)
GAME PAD
Button F
Button E
Y-axis
X-axis
Button A
Button B
Button C
Button D
R2
100
PIC16C765
C1(2)
A 2 RA0
B 3 RA1
C 4 RA2
D 5 RA3
E 19 RD0
F 20 RD1
G 21 RD2
H 22 RD3
11,32
VDD
XTAL
6 MHz C2(2)
VDD
VSS
D+
D-
C4
0.1 µF
USB Cable
To Host
R1
VUSB
1.5 k
C5 0.1 µF
C6 0.1 µF
C7 0.1 µF
C13 0.1 µF
C14 0.1 µF
C15 0.1 µF
C21 0.1 µF
C22 0.1 µF
VSS
R4 1 k
A
B
C
D
E
F
G
H
R5 51 k
VDD
VSS
C3 200 nF
VSS
Note 1:
2:
Microchip’s PICDEM™ USB board was used to develop the USB game pad. This board has all the external circuitry
necessary in place.
C1 and C2 values selected according to crystal load capacitance.
From Figure 1 it can be seen that the analog pins have
several external components added between the game
pad and PICmicro, namely two resistors and one
capacitor per pin. The reason for this circuitry stems
from the way analog pins were originally read by the
PC. The PC would clear a capacitor tied to ground at its
end and then time how long it took the capacitor to
charge up. The capacitor would charge at a rate pro-
portional to the resistance varied by one axis of the
joystick, for instance. This is legacy technology and is
not needed when using a PICmicro with an analog-to-
digital converter. As a result, the before-mentioned
circuitry was put into place in order to obtain a clean
analog output from the D-pad. This circuitry is not
needed for buttons E and F since they are digital, but
was put in place so that this diagram will support other
game pads.
SOFTWARE
Microchip's USB support firmware provided a founda-
tion for creating the USB game pad firmware. The firm-
ware provides a linkable file named ch9_usb.asm,
which includes most of the functions described in
Chapter 9 of the USB Specification, v1.1. Also included
with this firmware is the file hidclass.asm. This file
implements functions described in the “HID Device
Class Definitions”. These two files were linked without
any changes to the USB game pad project. The two
remaining assembly files included with the Chapter 9
USB firmware, descript.asm and main.asm, were
altered to implement the game pad conversion.
The USB support firmware has a cursor demonstration
incorporated into it. The file descript.asm contains
the descriptors necessary for the demonstration to
enumerate properly. To convert this file for the game
pad application, the cursor demonstration descriptors
were removed and replaced with the game pad
descriptors. Main.asm was rewritten to contain the
main routine for the game pad conversion. The main
program flow is shown in Figure 2.
2004 Microchip Technology Inc.
DS91054C-page 5

5 Page










PáginasTotal 10 Páginas
PDF Descargar[ Datasheet TB054.PDF ]




Hoja de datos destacado

Número de piezaDescripciónFabricantes
TB054An Introduction to USB DescriptorsMicrochip Technology
Microchip Technology
TB055PS/2 to USB Mouse TranslatorMicrochip Technology
Microchip Technology

Número de piezaDescripciónFabricantes
SLA6805M

High Voltage 3 phase Motor Driver IC.

Sanken
Sanken
SDC1742

12- and 14-Bit Hybrid Synchro / Resolver-to-Digital Converters.

Analog Devices
Analog Devices


DataSheet.es es una pagina web que funciona como un repositorio de manuales o hoja de datos de muchos de los productos más populares,
permitiéndote verlos en linea o descargarlos en PDF.


DataSheet.es    |   2020   |  Privacy Policy  |  Contacto  |  Buscar