background image

7

Firmware Implementation

The fi rmware for this reference design is written in the 
Avago Technologies assembly language. The following 
fi les are required to compile the mouse. 

SPCP825A _A6000.asm - main mouse fi rmware

calibration_hid.asm – HID compliant device USB descrip-
tor ROM tables.  Load during calibration mode.

hiddesc3.asm - 3 buttons mouse mode USB descriptor 
ROM tables.  Load during normal mouse mode.

pro_6000.asm – Routine to access ADNS-6000 sensor 
register.

spi.asm – Routine to access ADNS-6000 sensor register 
and EEPROM during calibration mode.

SPCP825A.inc – The SPCP825A I/O registers defi nition.

adns6000_srom_25.inc – ADNS-6000 SROM fi rmware.

ADNS6000.inc – ADNS-6000 interface constants.

delay.inc – SPCP825A delay loop subroutine.

decode_setup.inc – USB descriptor and request 
constants.

DET_Z.inc – SPCP825A Z-axis event handler.

DET_KEY.inc – SPCP825A button event handler.

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 fi rst connected to the bus, it is 
powered and running fi rmware, but communications on 
the USB remain non-functional until the host has issued 
a USB bus reset.

2. Bus Reset

The pull-up resistor on D– notifi es the hub that a low 
speed (1.5 Mbps) device has just been connected. 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 specifi c 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, confi guration  descrip-
tion and HID report description. Using the informa-

tion 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. 

Notes
1.  idVendor should be changed to the value as supplied by the USB-IF
2.  idProduct should be assigned for specifi c product.
3.  MaxPower value should be changed as per specifi c circuit’s current 

draw.

4. Post Enumeration Operation

Once communication between the host and mouse is es-
tablished, the peripheral now has the task of sending and 
receiving data on the control and data endpoints. In this 
case, when the host confi gures 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 periph-
eral may be reset or reconfi gured by the host.

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 specifi -
cation) to determine the device type and how to confi gure 
communications 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 specifi cation. 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 informa-
tion. Requests to this endpoint are not recognized until 
the host confi gures 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 fi rmware 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 defi ned by the HID specifi cation, is the 
default report protocol that all USB enabled systems un-
derstands. The boot protocol has a three-byte format, and 
so does not report wheel information. The HID report de-
scriptor defi nes 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 infor-
mation. Appendix F of this document lists the USB Data 
Reporting Format. 

Содержание ADNK-6003-SP01

Страница 1: ...tion velocities up to 20 inches per second and accelerations up to 8g The ADNS 6000 sensor along with the ADNS 6120 lens ADNS 6230 001 clip and ADNV 6340 laser diode form a complete and compact laser...

Страница 2: ...T high When the SPI is enabled thru PB0 NCS the PB2 SCLK PB1 MISO and PB3 MOSI GPIO pins serve special functions to enable the SPI interface to talk with external hardware During normal operation the...

Страница 3: ...y reading the Motion_Burst register The ADNS 6000 will respond with the contents of the Motion Delta_X Delta_Y SQUAL Shutter_Upper Shutter_Lower and Maximum_Pixel registers in that order SROM download...

Страница 4: ...buttons and USB cable See Figure 4 Unscrewing the one screw located at the base of the unit can open the ADNK 6003 SP01 unit Lifting and pulling the PCB out of the base plate can further disassemble t...

Страница 5: ...ns reference plane to surface While reassembling the components please make sure that the Z height Distance from lens reference plane to surface is valid Refer to Figure 5 Sensor Sensor PCB 2 40 0 094...

Страница 6: ...esign Documentation Gerber File The Gerber File presents detailed schematics used in ADNK 6003 SP01 in PCB layout form See Appendix C for more details Overall circuit A schematic of the overall circui...

Страница 7: ...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 Operati...

Страница 8: ...000 Delta_X register for the X movement Calls the ReadSPI routine to enable the SPI interface and perform reading operations through the two wire serial interface Any new X motion information is added...

Страница 9: ...routine is entered whenever a SET ADDRESS request has been received The device address change cannot actually take place until after the status stage of this no data control transaction so the addres...

Страница 10: ...he following string ADNS 6000 Mouse Configuration String A request for the configuration string will return the following string HID Compliant Mouse Endpoint 1 String A request for the endpoint string...

Страница 11: ...A Schematic Diagram of the Overall Circuit Figure A1 Circuit level block diagram for ADNK 6003 SP01 designer s kit optical mouse using the Avago Technologies ADNS 6000 optical mouse sensor and Sunplu...

Страница 12: ...1 0 125W 0805 2 Chip RES 12 7K 1 0 125W 0805 1 Chip RES 2K7 1 0 125W 0805 1 Chip RES 20K 1 0 125W 0805 4 Chip RES 100K 1 0 125W 0805 1 Chip RES 240R 1 0 125W 0805 1 Photo Transistor DIP 1 2N3906 TO 92...

Страница 13: ...13 Appendix C PCB Layout Figure C1 PCB Schematic Bottom Layer Figure C2 PCB Schematic Top Layer...

Страница 14: ...14 Figure C3 PCB Schematic Top Overlay Figure C4 PCB Schematic Bottom Overlay...

Страница 15: ...e 0 0 0 0 0 0 Middle Right Left Byte 1 X X X X X X X X 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 fourth byte Wh...

Страница 16: ...ADNS 6130 001 Trim Lens Data Sheet d ADNS 6230 001 VCSEL Assembly Clip Data Sheet e ADNV 6340 VCSEL Data Sheet f Avago Technologies ADNS 6000 ADNS 6010 ADNS 6090 and ADNS 7010 Laser Mouse Eye Safety C...

Отзывы: