background image

6

USB Requests – Endpoint 0

Endpoint 0 acts as the control endpoint for the host. 
On power-up endpoint 0 is the default communication 
channel for all USB devices. The host initiates Control- Read 
and Control-Write (see Chapter 8 of the USB specification) 
to determine the device type and how to configure com-
munications with the device. 

In this particular design, only Control-Read transactions are 
required to enumerate a mouse. For a list of valid requests, 
see Chapter 9 of the USBG specification. In addition to the 
standard “Chapter 9” requests, a mouse must also support 
all valid HID class requests for a mouse. 

USB Requests – Endpoint 1

Endpoint 1 is the data transfer communications channel 
for mouse button, wheel, and movement information. 
Requests to this endpoint are not recognized until the host 
configures endpoint 1. Once this endpoint is enabled, then 
interrupt IN requests are sent from the host to the mouse 
to gather mouse data. When the mouse is left idle (i.e. no 
movement, no new button presses, no wheel movement) 
the firmware will NAK requests to this endpoint. Data 
is only reported when there is a status change with the 
mouse.

Two HID report formats are used in this design. The boot 
protocol, as defined by the HID specification, is the default 
report protocol that all USB enabled systems understands. 
The boot protocol has a three-byte format, and so does 
not report wheel information. The HID report descriptor 
defines the report protocol format. This format is four  
bytes and is the same as the report format with the 
exception of the fourth byte, which is the wheel informa-
tion. Appendix E lists the USB Data Reporting Format. 

USB Interface

All USB Human Interface Device (HID) class applications 
follow the same USB start-up procedure. The procedure is 
as follows:

1. Device Plug-in
  When a USB device is first connected to the bus, it is 

powered and running firmware, but communications 
on the USB remain non-functional until the host has 
issued a USB bus reset.

2. Bus Reset
 

The host recognizes the presence of a new USB device 
and initiates a bus reset to that device.

3. Enumeration
  The host initiates SETUP transactions that reveal 

general and device specific information about the 
mouse. When the description is received, the host 
assigns a new and unique USB address to the mouse. 
The mouse begins responding to communication with 
the newly assigned address, while the host continues 
to ask for information about the device description, 
configuration description and HID report description. 
Using the information returned from the mouse, 
the host now knows the number of data endpoints 
supported by the mouse

2

. At this point, the process of 

enumeration is completed. 

 Note:
 

1.  idVendor should be changed to the value as supplied by the  

USB-IF

 

2.  idProduct should be assigned for specific product.

 

3.  MaxPower value should be changed as per specific circuit’s 

current draw.

4.  Post Enumeration Operation
 

Once communication between the host and mouse is 
established, the peripheral now has the task of sending 
and receiving data on the control and data endpoints. 
In this case, when the host configures endpoint 1, the 
mouse starts to transmit button and motion data back 
to the host when there is data to send. At any time the 
peripheral may be reset or reconfigured by the host.

USB Firmware Description

A function call map for USB operation is shown in 

 

Figure 6. The following are descriptions of the functions  
  in

 SPCP826A _A60X0.asm.

• 

IO_initial

 

 

This function is use to set the Sunplus 

microcontroller as input or output.

  Port A(PA) is set as input while both Port B(PB) and 

Port C(PC) are set as output. This function also includes 
setting and enabling of pull-up resistors for left, right 
and middle buttons.

• 

clear_ram

 – 

This function clears the internal RAM of the 

microcontroller. 

• 

Usb_initial

 – 

This function is used to enable the USB 

mode. This is done by enabling the watchdog and LVR 
and selecting low speed. The USB reset event interrupt 
as well as the set up event interrupt are enabled. 

Summary of Contents for LaserStream ADNK-6093-SP11

Page 1: ...tion with reso lution up to 1600 counts per inch cpi velocities up to 35 inches per second ips and accelerations up to 8 g The Sunplus SPCP826A is a general purpose OTP USB mi crocontroller It has dua...

Page 2: ...d to the PC to update the position of the cursor The advantages of using ADNS 6090 optical sensor are the best tracking accuracy exibility of programming the optical sensor via the SPI port and the au...

Page 3: ...and data is shifted out to the ADNS 6090 through the PB3 MOSI Please see the schematic in Appendix A WhenwritingtotheADNS 6090 themicrocontrollerdrives both the SCLK and the MOSI lines When reading fr...

Page 4: ...eference design will automatically detect the host topology USB The connections for the connectors are shown in Figure 3 below Hot Pluggable USB The PC does not need to be powered o when plugging or u...

Page 5: ...enerates the drive current for the laser diode ADNV 6340 In order to stay below the Class 1 power requirements resistor Rbin must be set at least as high as the value in the bin table based on the bin...

Page 6: ...in non functional until the host has issued a USB bus reset 2 Bus Reset The host recognizes the presence of a new USB device and initiates a bus reset to that device 3 Enumeration The host initiates S...

Page 7: ...program is trapped in the dead loop i e the device is unusable Report_mouse_data This function is used to send button X Y and Z wheel data to the computer judge_mode This function is used to check fo...

Page 8: ...escriptors to the host requestNotSupported Unsupported or invalid descriptor requests will cause this rmware to STALL these transactions Manufacturer String1 A request for the manufacturer string will...

Page 9: ...9 Appendix A Schematic Diagram...

Page 10: ...40R 1 100 ET1 1 R3 15 5way Header 2 54mm 2 54mm BULGIN 14191 1 H1 16 Microswitch 3 ways Through Hole Omron Electronic Components D2F F 3 SW2 SW3 SW4 17 R A SPNO Push Button Through Hole Omron Electron...

Page 11: ...11 Appendix C PCB Layout Top Layer Bottom Layer Top Silkscreen Overlay Bottom Silkscreen Overlay...

Page 12: ...12 Appendix D 3D View VCSEL s PCBA ADNS 6230 001 Clip ADNV 6340 VCSEL ADNS 6090 Sensor ADNS 6120 Round Lens with Round Lens Base Plate ADNS 6130 001Trim Lens with Trim Lens Base Plate Overall Assembly...

Page 13: ...Byte 2 Y Y Y Y Y Y Y Y The following is the USB report protocol format and allows the additional wheel movement information in the sixth byte When the wheel is moved forward the sixth byte reports a...

Page 14: ...tion Sensor 5 ADNS 6120 Round Lens Plate 5 ADNS 6130 001 Trim Lens Plate 5 ADNS 6230 001 LASER Assembly Clip 5 ADNV 6340 Single Mode Vertical Cavity Surface Emitting LASER VCSEL 5 ADNK 6093 SP11 CD In...

Reviews: