DM163010 Microchip Technology, DM163010 Datasheet - Page 46

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
4.5
DS41174A-page 42
Function Call Reference
4.5.1
File hidclass.asm provides some HID Class specific functions. Currently,
only Get_Report_Descriptor is supported. Other class specific functions can
be implemented in a similar fashion. When a get token interrupt determines
that it’s a class specific command on the basis that ReportType bit 6 is set,
control is passed to function ClassSpecific. If you’re working with a different
class, this is your interface between the core functions and the class specific
functions.
File usb_main.asm is useful as a starting point on a new application, and as
an example of how an existing application needs to service the USB interrupt
and communicate with the core functions.
Interface between the Application and Protocol layer takes place in three main
functions: InitUSB, PutEPn, and GetEPn (with ’n’ representing the endpoint
number).
Application Layer Function
4.5.1.1
InitUSB should be called by the main program immediately upon power-up. It
enables the USB peripheral and the USB Reset interrupt, and transitions the
part to the powered state to prepare the device for enumeration. At this point,
the USB Reset is the only USB interrupt allowed, preventing the part from
responding to anything on the bus until it’s been reset. The USB Reset inter-
rupt initializes the Buffer Descriptor Table (BDT) and transitions the part to the
default state, where it responds to commands on address zero. When it
receives a Set Address command, the device transitions to the addressed
state and now responds to commands on the new address.
4.5.1.2
PutEPn (Buffer pointer, Buffer size) sends data to the host. The pointer to the
block of data to transmit is in the FSR/IRP, and the block is passed in the W
register. The endpoint is set with a Set Instruction preceding the function defi-
nition. If the IN buffer is available for that endpoint, the block of data is copied
to the buffer. The Data 0/1 bit is then flipped and the OWNS bit is set. A
"Buffer Not Available" will occur when it has been previously loaded and the
host has not requested that the USB peripheral transmit it. In this case, a
failure code would be returned so the application can try again later.
InitUSB
PutEPn
©
2001 Microchip Technology Inc.

Related parts for DM163010