DM163010 Microchip Technology, DM163010 Datasheet - Page 26

BOARD DEMO PICDEM USB

DM163010

Manufacturer Part Number
DM163010
Description
BOARD DEMO PICDEM USB
Manufacturer
Microchip Technology
Datasheet

Specifications of DM163010

Processor To Be Evaluated
PlC16C745/765
Interface Type
USB
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Lead free / RoHS Compliant
PICDEM™ USB User’s Guide
DS41174A-page 22
2.2.10
2.2.11
Soft Detach
The soft detach command is one of the most useful features on the USB
In this example, several events precede the implementation of a soft detach.
During the soft detach process, several things occur. First, the PICmicro MCU
Translation to USB
In order to act like a USB mouse or keyboard, the PICmicro MCU has to
PICmicro MCU. The reason the soft detach command is so useful is that in
applications such as the PS/2 mouse/keyboard example, no special driver
has to be created for the host. Most often for this application, the PICmicro
MCU would have two configurations - one for a mouse and the other for a
keyboard. A special driver would have to be created for the host that would
instruct the PICmicro MCU to change configurations. Furthermore, in order to
do this, the host’s driver would have to be able to detect what peripheral is
attached. An easy way to avoid difficulty with creating a unique driver for the
host, is to give the PICmicro MCU control over whether it will send the host
mouse or keyboard data. Based on the type of data it will send to the PC, the
PICmicro MCU can soft detach and re-enumerate as the peripheral of choice.
As mentioned before, an interrupt is generated when the data line goes low.
This initiates the receive routine, because it is assumed that the data line
dropping low is the result of a START bit being sent by the device. However,
the data line will also drop if the user disconnects the device. To distinguish
between these two cases, the firmware starts a timer when the data line goes
low. If the timer times out before the clock line goes high, the device has been
disconnected. Otherwise, the data line going low is the result of a START bit.
Once it has been determined that a device has been disconnected, the firm-
ware waits for another device to be attached. When the clock and data lines
are both high, a device has been attached. At this point, the PICmicro MCU
will ask the device to identify itself (see Appendix B for keyboard and mouse
commands). Based on the device’s response, the firmware will know whether
the newly attached device is a keyboard or mouse and perform a soft detach.
turns off the pull-up resistor to V
DEV_ATT bit. Turning the pull-up resistor off, removes the PICmicro MCU
from the bus. After approximately 50 ms, which is enough time for the host to
see the device disconnect, the firmware sets DEV_ATT and reconnects the
PICmicro MCU to the bus. The host then re-enumerates the PICmicro MCU.
translate the PS/2 data format for each device to its USB data format. For the
mouse, this is very simple. For the keyboard, however, the process is more
complex.
USB
. The firmware does this by clearing the
©
2001 Microchip Technology Inc.

Related parts for DM163010