DM163010 Microchip Technology, DM163010 Datasheet - Page 49

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
4.7
©
2001 Microchip Technology Inc.
Examples
4.6.2
Subsequently, the host sends a setup token requesting the device descriptor.
The USB Peripheral receives the Setup transaction, places the data portion in
the EP0 out buffer, loads the USTAT register to indicate which endpoint
received the data, and triggers the Token Done (TOK_DNE) interrupt. The
Chapter 9 commands interpret the Setup token and sets up the data to
respond to the request in the EP0 IN buffer. It then sets the UOWN bit to tell
the SIE there is data available.
Next, the host sends an IN transaction to receive the data from the setup
transaction. The SIE sends the data from the EP0 IN buffer and next sets the
Token Done interrupt to notify us that the data has been sent. If there is addi-
tional data, the next buffer full is set up in the EP0 IN buffer.
Token processing takes place for the entire enumeration sequence. The
device starts in the powered state, transitions to RESET via the Reset inter-
rupt, moves to ADDRESSED via the Set Address command, and shifts to
CONFIGURED via a Set Configuration command.
The USB peripheral detects several different errors and handles most inter-
nally. The USB_ERR interrupt notifies the PIC that an error has occurred. No
action is required by the PICmicro MCU when an error occurs. Instead, the
errors are simply acknowledged and counted. There is no mechanism to pull
the device off the bus if there are too many errors. If this behavior is desired, it
must be implemented in the application.
The Activity interrupt is left disabled until the USB peripheral detects no bus
activity for 3 ms. Then, it suspends the USB peripheral and enables the Activ-
ity interrupt. The Activity interrupt subsequently re-activates the USB periph-
eral when bus activity resumes, so processing may continue.
CheckSleep
CheckSleep is a separate call that takes the bus idle one step further and
puts the PICmicro MCU to SLEEP if the USB peripheral has detected no
activity on the bus. This powers down most of the device to minimal current
draw. This call should be made at a point in the main loop where all other
processing is complete.
This example shows how the USB functions are used. This example first ini-
tializes the USB peripheral, which allows the host to enumerate the device.
The enumeration process occurs in the background, via an Interrupt Service
Routine. This function waits until enumeration is complete. Then, it polls EP1
OUT to see if there is any data available. When a buffer is available, it is cop-
ied to the IN buffer. Presumably, your application would be more interesting
than Example 4.1.
Chapter 9 USB Firmware
DS41174A-page 45

Related parts for DM163010