Design Guide
Total Page:16
File Type:pdf, Size:1020Kb
ADNK-3061 Optical Mouse Designer’s Kit Design Guide Introduction Introduction to ADNS-3060 Optical Mouse Sensor This design guide describes how a cost-effective combi- Avago’s ADNS-3060 optical mouse sensor is used in nation USB-PS/2 yet feature-rich optical mouse can be this reference design as the primary navigation engine. built using the Avago Technologies high performance This Optical Navigation Technology contains an Image ADNS-3060 optical mouse sensor and Cypress Semi- Acquisition System, a Digital Signal Processor, and a conductor CY7C63743-PC USB microcontroller. The four-wire serial port. The CY7C63743-PC periodically document starts with the basic operations of a computer reads the ADNS-3060’s Delta_X and Delta_Y registers mouse peripheral followed by an introduction to the to obtain any horizontal and vertical motion informa- ADNS-3060 optical mouse sensor and CY7C63743-PC tion happening as a result of the mouse being moved. USB microcontroller. A schematic of the ADNS-3060 The four-wire synchronous serial port is used to set optical mouse sensor to the CY7C63743-PC USB micro- and read parameters in the ADNS-3060, and to read controller buttons of a standard mouse is also shown in out the motion, (triangle)x and (triangle)y information. this document. The software section of this design guide This motion information is reported to the PC updating describes the architecture of the firmware required to the position of the cursor. The advantages of using the implement the USB and PS/2 mouse functions. ADNS-3060 optical sensor are: best tracking accuracy, sensor programming flexibility via SPI port, and the Optical Mouse Basics automatic frame rate feature (1000fps to 6400fps). Fur- The optical mouse measureschanges in position by thermore, the ADNS-3060 sensor has excellent tracking optically acquiring sequential surface images (frames), performance on difficult surfaces such as wood and half- and mathematically determining the direction and tone surfaces. Additionally, the Burst mode is another magnitude of movement. The Z-wheel movement is special serial port operation mode which may be used done in the traditional method by decoding the quadra- to reduce the serial transaction time for three predefined ture signal generated by optical encoder. This design operations: motion read, SROM download, and frame guide shows how to connect to and manage a standard capture. Speed improvement is achieved by continuous configuration of mouse hardware, as well as handle data clocking to or from multiple registers during this the USB and PS/2 protocols. Each of these protocols operation. provides a standard way of reporting mouse movement Motion Read is activated by reading the Motion_Burst and button presses to the PC. register. The ADNS-3060 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 uses Burst Mode to load the Avago-supplied firmware file contents into the ADNS- 3060. The firmware file is an ASCII text file with each 2- character byte (hexadecimal representation) on a single line. Frame Capture is a fast way to download a full array of pixel values from a single frame. To learn more about sensor’s technical information, please visit the Avago web site at http://www.semicon- ductor.Avago.com Mouse Optics Introduction to the CY7C63743-PC The of Z-wheel motion is detected using the traditional The CY7C63743-PC is an 8-bit RISC microcontroller with method by decoding the quadrature signal generated an integrated USB Serial Interface Engine (SIE). The ar- by optical encoder. Two phototransistors are connected chitecture executes general-purpose instructions that in a sourcefollower configuration. An infrared LED are optimized for USB applications. The CY7C63743-PC shines, causing the phototran-sistors to turn on. In has a built-in clock oscillator and timers, as well as pro- between the phototransistors and LED is a pinwheel grammable drive strength, and pull-up resistors on each that turns on the mouse ball rollers. The fan of this I/O line. High performance, low-cost human interface pinwheel is mechanically designed to block the infrared type computer peripherals can be implemented with a light such that the phototran-sistors are turned on and minimum of external components and firmware effort. off in a quadrature output pattern. Every change in the phototransistor outputs represents a count of wheel Serial Peripheral Interface (SPI) movement. Comparing the last state of the optics to the The CY7C63743-PC provides a SPI compatible interface. current state derives direction information. As shown The SPI circuit supports byte serial transfer in either in Figure 1, traveling along the quadrature signal to Master or Slave mode. The integrated SPI circuit allows the right produces a unique set of state transitions, and the CY7C63743-PC to communicate with an external traveling to the left produces another set of unique state SPI compatible hardware, in this case the ADNS-3060 transitions. For a lower power system solution, using a sensor. mechanical z-wheel is recommended instead of a Z LED and Optical Encoder combination. Hardware Implementation The standard hardware to implement a mouse is shown Infrared Photo- LED transistors in Figure 2. For X and Y movement, the optical mouse sensor is used. The Z wheel movement is detected by another set of optical encoder that outputs quadrature signals. For each button there is a switch that is pulled up internally by the built-in in pull up resistors. The D-line is pulled up via a 1.3k ohm resistor connected to the VREG pin. Firmware Configurable GPIO Q1.1 output The reference firmware is configured to use the GPIO pins as shown in the schematic under Appendix A. However, it Q1.3 output may be more optimal to use a different I/O configuration to meet the mechanical constraints of PCB design. The Figure 1. Optics Quadrature Signal Generation. reference firmware is designed to be easily configured to another set of pin connections. This is accomplished Mouse Buttons through changes in the I/O definitions at the beginning of the adns- 3060.asm listing. The following statements Mouse buttons are connected as standard switches. are the pin definitions as they exist today. The firmware These switches are pulled up by the pull up resistors will use these definitions to read and configure the GPIO inside the microcontroller. When the user presses a pins, without any other modifications. button, the switch will be closed and the pin will be pulled LOW to GND. A LOW state at the pin is interpreted as the button being pressed. A HIGH state is interpreted as the button has been released or the button is not being pressed. Normally the switches are debounced in firmware for 15–20 ms. In this reference design there are three switches: left, Z-wheel, and right. 2 Communications between the CY7C63743-PC and GPIO pins for PS/2 operation. The firmware for this the ADNS-3060 are done through the integrated SPI reference design will automatically detect the host interface. The serial port cannot be activated while the topology (USB or PS/2) at plug-in, and will configure chip is in power down mode (NPD low) or reset (RESET itself for operation on that bus. If a USB host connection high). When the SPI is enabled thru P0.4 (NCS), P0.7 is detected, the firmware will enable the VREG pin, such (SCLK), P0.6 (MISO), and P0.5 (MOSI) GPIO pins serve as that the 1.3k ohm resistor connected to the D- line, can special functions enabling the SPI interface to talk with be pulled up to 3.3V. Through this action, the host is able the external hardware. (Sensor) During normal operation, to recognize there is a lowspeed USB peripheral attached. the CY7C63743-PC SPI is always configured as a Master These connections are shown in Figure 3 below. to output the serial clock on P0.7. So, the USB microcon- troller always initiates communication. Data sent by the ADNK-3061 Designer’s Kit - Optical Mouse ADNS-3060 optical sensor is received on the P0.6 (MISO), The ADNK-3061 optical mouse unit allows users to and data is shifted out to the same sensor through P0.5 evaluate the performance of the Avago’s Optical Tracking (MOSI). See schematic in Appendix A. When writing to Engine (sensor, lens, LED assembly clip, LED) over both the ADNS-3060, the microcontroller drives both SCLK a USB or PS/2 connection, using a Cypress enCoRe USB and MOSI lines. When reading from the ADNS-3060, the Controller. This kit also enables users to understand the microcontroller drives both SCLK and MOSI lines initially. recommended mechanical assembly. (See Appendices After tSRAD delay, the ADNS-3060 will drive the data via C, D, and E). MISO. The microcontroller is only driving the SCLK line ( for the serial interface). System Requirements USB and PS/2 Connection PCs using Windows® 95/ Windows® 98/ Windows® NT/ Windows® 2000 with PS/2 port and standard 3-button The CY7C63743-PC has a configuration register that USB mouse driver loaded. switches control from the SIE to manual control on the D+ and D- pins. This allows the firmware to dynami- Functionality cally configure itself to operate as a USB or PS/2 mouse, allowing signal lines to be shared without using extra 3-button, scroll wheel combi-mouse. MISO VREG MOSI Avago ADNS-3060 optical mouse sensor SCLK NCS 1.3 k Ohm Cypress Z Optics CY7C63743A-PC enCoRe USB Controller Z LED Left Button USB/PS2 Interface Wheel Button D+/D- SCLK/SDATA Right Button Figure 2. CY7C63743-PC –ADNS-3060 Optical Mouse Hardware Block Diagram.