ADNK-6003-SP01 AVAGO | Alldatasheet

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 16

Technical content

Optical Mouse Designer’s Kit Design Guide Introduction The Universal Serial Bus (USB) is an industry standard serial interface between a computer and peripherals such as a mouse, joystick, keyboard, UPS, etc. This design guide describes how a cost-eff ective USB optical mouse can be built using the Sunplus, SPCP825A USB microcon- troller and the Avago Technologies ADNS-6000 optical sensor. The document starts with the basic operations of a computer mouse peripheral followed by an introduc- tion to the Sunplus SPCP825A USB microcontroller and the Avago Technologies ADNS-6000 Optical Navigation Sensor. A schematic of the Sunplus SPCP825A USB micro- controller to the ADNS-6000 optical sensor and buttons of a standard mouse can be found in Appendix A. The software section of this application note describes the ar- chitecture of the fi rmware required to implement the USB mouse functions. The Sunplus SPCP825A data sheet is available from the Sunplus web site at www.sunplus.com . The ADNS-6000 data sheet is available from the Avago Technologies web site at www.avagotech.com. USB docu- mentation can be found at the USB Implementers Forum web site at www.usb.org. ADNS-6000 laser mouse set is the world’s fi rst laser-illumi- nated navigation system. With laser navigation technol- ogy, the mouse can operate on many surfaces that prove diffi cult for traditional LED-based optical navigation. Its high-performance architecture is capable of sensing high-speed mouse motion -- 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 mouse tracking system. There are no moving parts, which means high reliabil- ity and less maintenance for the end user. In addition, precision optical alignment is not required, facilitating high volume assembly. Optical Mouse Basics The optical mouse measures changes in position by optically acquiring sequential surface images (frames), and mathematically determining the direction and magnitude of movement. The Z-wheel movement is done in the traditional method by decoding the quadrature signal generated by optical sensors. This design guide shows how to connect to and manage a standard con- fi guration of mouse hardware, as well as handle the USB protocols. Each of these protocols provides a standard way of reporting mouse movement and button presses to the PC. Introduction to the Sunplus, SPCP825A The Sunplus, SPCP825A is a general purpose OTP USB mi- crocontroller. It has dual USB speed, namely low and full speed. It can support PS/2 mode. The transceiver is fully controlled by the fi rmware. Moreover the USB SIE provides good fl exibility for fi rmware to handle USB protocol. The built-in PLL allows CPU to work at 6MHz or 12MHz by using only one 6MHz crystal or resonator. Serial Peripheral Interface (SPI) The Sunplus SPCP825A provides a SPI compatible interface. The SPI circuit supports byte serial transfer in either Master or Slave mode. The integrated SPI circuit allows the Sunplus SPCP825A to communicate with external SPI compatible hardware, in this case the ADNS- 6000.

the GPIO pins, without any other modifi cations. Figure 1. Sunplus SPCP825A - ADNS-6000 Optical Mouse Hardware Block Diagram ohm resistor connected to the VREG pin.

Figure 2. Optics Quadrature Signal Generation this reference design as the primary navigation engine. optical sensor is 4-wire serial port. ous data clocking to or from multiple registers. visit the Avago Technologies web site at http://www.

described below in the section “Single Fault Detection” . and LP_CFG1 must be programmed to appropriate values. please refer to Eye Safety Application Note 5088. Figure 5. Distance from lens reference plane to surface surface) is valid. Refer to Figure 5. Serial Port section. The program size is 1986 x 8 bits. following Avago Technologies recommendations.

  • Passes IEC-1000-4-3 radiated susceptibility level when assembled into a mouse with shielded cable and following Avago Technologies recommendations.
  • Passes EN61000-4-4/IEC801-4 EFT tests when assembled into a mouse with shielded cable and following Avago Technologies recommendations.
  • UL fl ammability level UL94 V-0.
  • Provides suffi cient ESD creepage/clearance distance to avoid discharge up to 15kV when assembled into a mouse according to usage instruction above.

Below is the summary of the components contained in the ADNK-6003-SP01 Designer’s Kit. Sensor The sensor technical information is contained in the ADNS-6000 Data Sheet. Lens The lens technical information is contained in the ADNS- 6120 Data Sheet. The fl ange on the standard ADNS-6120 lens is for ESD protection. LASER Assembly Clip The information on the assembly clip is contained in the ADNS-6230-001 Data Sheet. LASER The LASER technical information is contained in the ADNV-6340 Data Sheet and Application Note AN-5088. Additional application notes regarding Eye Safety Re- quirements are also available at Avago Technologies website. Base Plate Feature – IGES File The IGES fi le on the CD-ROM provides recommended base plate molding features to ensure optical alignment. This includes PCB assembly diagrams like solder fi xture in assembly and exploded view, as well as solder plate. See Appendix D for details. Reference Design 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 circuit is shown in Appendix A of this document. Appendix B lists the bill of materials. LASER Power Adjustment Procedure 1. The ambient temperature should be 25 ° C ± 5 ° C. 2. Set VDD3 to its permanent value. 3. Ensure that the laser drive is at 100% duty cycle by setting bit 6 of register 0x0A to 0. 4. Program the LP_CFG0 and LP_CFG1 registers to achieve an output power as close to 506uW as possible without exceeding it. Good engineering practices should be used to guarantee performance, reliability and safety for the product design. LASER Output Power The laser beam output power as measured at the naviga- tion surface plane is specifi ed below. The following condi- tions apply: 1. The system is adjusted according to the above procedure. 2. The system is operated within the recommended operating temperature range. 3. The VDD3 value is no greater than 50mV above its value at the time of adjustment. 4. No allowance for optical power meter accuracy is assumed.

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.

A function call map for USB operation is shown in Figure 6. The following are descriptions of the functions in SPCP825A _A6000.asm. IO_initial – This function is use to set the Sunplus micro- controller 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 resistor for left, right and middle keys. 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 the low speed is selected. The USB reset event interrupt as well as the set up event interrupt are enabled. DetectUsbReset – This routine initializes USB interface service and SPI ports. Then, the normal_mode variable is compared, if normal_mode is equal to ‘0’ then this routine will invoke the calibration_operation routine to enter cali- bration loop. If normal_mode variable fl ag is equal to ‘1’ then Read_LP_CFG_REG is called to load the calibrated LP_CFG0 and LP_CFG1 register value. Subsequently, the ADNS-6000 sensor is reset and AdjustLaser routine is invoked to write the LP_CFG0 and LP_CFG1 value to the sensor register. Then, SetShuttherMode routine is called to enable VCSEL in shutter mode and laser output is enabled. Default_state – This function is used to set the default service routing. SPI_init – This function involves the initialization of SPI. Read_LP_CFG_REG – This function reads the calibrated laser power confi guration register from EEPROM. sample_mouse – This routine returns any updates in the X, Y and Z-wheel motion information. The motion of the Z-wheel is detected using the traditional method by decoding the quadrature signal generated by the pho- totransistors. The X and Y directions of the movement are obtained by calling the ReadDeltaX and ReadDeltaY routines. The X, Y, and Z-wheel movement is stored in the [xCount], [yCount], and [zCount] variables which will be sent to the host in the main routine. ReadDeltaX – Reads the ADNS-6000 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 to the [xCount] variable. ReadDeltaY – Reads the ADNS-6000 Delta_Y register for the Y movement. Calls the ReadSPI routine to enable the SPI interface and perform reading operations through the two wire serial interface. Any new Y motion information is added to the [yCount] variable. DetectKeyLoop – This function is used to detect the left, right and middle buttons changes. check_mouse_data –This function is used to determine whether the buttons, X, Y or Z-wheel data need to be sent to the host. reset_adns6000 – This function is responsible for resetting the hardware, loading the SROM (Shadow ROM) fi rmware into the ADNS-6000 optical sensor. The ID from the device and program are compared. If the ID is not the same, then the program is trapped in the dead loop, i.e. the device is unusable. Report_mouse_data – This function is used to send buttons, X, Y and Z-wheel data to the computer. judge_mode – This function is used to check for normal mouse or calibration mode. detect_key_change – This function is used to detect left, right or middle button changes. ReadMotionReg – Reads the ADNS-6000 Motion register. The data returned from this register will be used to determine if any motion has occurred or if any fault condition exists. AdjustLaser – the AdjustLaser is used to read the value from the EEPROM and then store them into the ADNS- 6000 sensor. The mouse will do calibration when the left button is pressed when the mouse is fi rst plugged into the USB port. However if the mouse left button is not pressed, the value of calibration is already stored in the EEPROM i.e. there is no need of calibration. Calibration operation - The calibration mode is diff erent from the AdjustLaser as the calibration mode happens when the left button is pressed whereas the AdjustLa- ser is used to read the EEPROM values and put them into the ADNS-6000 sensor. This means in the Normal mouse mode, the AdjustLaser is done even in the normal mouse mode. Actually when the mouse enters the calibration mode, it cannot come back to the normal mouse mode without unplugging the USB plug.

Figure 6. USB Operation Function Call Map loaded into the endpoint 1 buff er to be sent to the host. packet is received on endpoint 0. OUT packet is received on endpoint 0. actions will recognize this and set the address properly. transaction enables boot or report protocol. GET REPORT request is received. the HID class documentation for more details. whenever a GET CONFIGURATION Request is received.

Manufacturer String*1 A request for the manufacturer string will return the following string. “Avago Technologies Reference Design Mouse” Product String*2 A request for the product string will return the following string. “ADNS-6000 Mouse” Confi guration String A request for the confi guration string will return the following string. “HID-Compliant Mouse” Endpoint 1 String A request for the endpoint string will return the following string. “Endpoint 1 Interrupt Pipe” Notes: 1. The Manufacturer String should be changed to the name of your company. 2. The Product String should be changed to your product’s name.

Appendix 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 Sunplus SPCP825A.

Appendix B: Bill of Materials for components shown on the circuit. Comment Footprint Quantity Cer. Cap 0.1uF (104) 0805 6 Cer. Cap 2.2uF, 16V CASE A 2 Cer. Cap 4.7pF, 20V CASE A 2 Cer. Cap 470pF CASE A 1 Chip RES. 10K 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 1 Crystal, 6MHz DIP 1 Crystal, 24MHz DIP 1 SPCP825A DIP-24 1 ADNS-6000 DIP-20 1 25LC040/P SO-8 1 HEADER 5 HEADLOCK5P 1 LED DIP 1 LP2950ACZ-3.3 TO-92 1 Jumper, RED DIP 1 Jumper, BLK DIP 1 VCSEL DIP 1 SW SPDT DIP 3

Appendix C: PCB Layout Figure C1: PCB Schematic (Bottom Layer) Figure C2: PCB Schematic (Top Layer)

Figure C3: PCB Schematic (Top Overlay) Figure C4 : PCB Schematic (Bottom Overlay)

Appendix D: Base Plate Feature Figure D1: Overall view of base plate Appendix E: USB data reporting format The USB report has two formats, depending on if boot or report protocol is enabled. The following format is the boot protocol and is understood by a USB aware BIOS. Bit 7 Bit 0 Byte 0 0 0 0 0 0 Middle Right Left B y t e 1 XXXXXXXX B y t e 2 YYYYYYYY The following is the USB report protocol format and allows the additional wheel movement information in the fourth byte. When the wheel is moved forward the fourth byte reports a 0x01, and when moved backward the fourth byte reports 0xFF. When the wheel is idle, then this byte is assigned 0x00. Bit 7 Bit 0 Byte 0 0 0 0 0 0 Middle Right Left B y t e 1 XXXXXXXX B y t e 2 YYYYYYYY B y t e 3 ZZZZZZZZ

Appendix F: Kit Components The designer’s kit contains components as follows: Part Number Description Name Quantity ADNS-6000 High Performance Laser Mouse Sensor Sensor 5 ADNS-6120 Laser Mouse Round Lens Plate Lens 5 ADNS-6130-001 Laser Mouse Trim Lens Plate Lens 5 ADNS-6230-001 Laser Mouse VCSEL Assembly Clip VCSEL Clip 5 ADNV-6340 Single Mode Vertical Cavity Surface Emitting LASER (VCSEL) VCSEL 5 ADNK-6003-SP01 CD Includes Documentation and Support Files for ADNK-6003-SP01 Documentation a. ADNS-6000 Data Sheet b. ADNS-6120 Round Lens Data Sheet c. 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 Calculation Application Note 5088 Hardware Support Files a. ADNK-6003-SP01 BOM List b. ADNK-6003-SP01 Schematic c. 3D Model IGES FIles d. Gerber File Software Support Files a. Microcontroller Firmware For product information and a complete list of distributors, please go to our web site: www.avagotech.com Avago, Avago Technologies, and the A logo are trademarks of Avago Technologies in the United States and other countries. Data subject to change. Copyright © 2005-2008 Avago Technologies. All rights reserved. Obsoletes AV01-0427EN AV02-1383EN - September 9, 2008