3
Z-Wheel
The motion of Z-wheel is detected using the quadrature
signal generated by optical sensors. Two phototransistors
are connected in a source-follower configuration forming
Channel A and Channel B. An infrared LED shines,
causing the phototransistors to turn on. In between the
phototransistors and LED is a pinwheel that turns on the
mouse ball rollers. The fan of this pinwheel is mechanical-
ly designed to block the infrared light such that the pho-
totransistors are turned on and off in a quadrature output
pattern. Every change in the phototransistor outputs rep-
resents a count of mouse movement. Comparing the last
state of the optics to the current state derives directional
information. As shown in Figure 3. below, rotating the
wheel forward produces a unique set of state transitions,
and rotating the wheel backward produces another set of
unique state transitions.
Figure 3. Optics Quadrature Signal Generation
Mouse Buttons
Mouse buttons are connected as standard switches. These
switches are pulled up by the pull up resistors inside the
microcontroller. When the user presses a 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-
20ms. In this reference design there are three switches:
left, Z-wheel, and right.
Hardware Implementation
Optical Mouse Sensor
This reference design features the ADNS-3040 optical
navigation engine. It contains an Image Acquisition System
(IAS), a Digital Signal Processor (DSP), and a three-wire
Serial Peripheral Interface consists of the serial clock (SCLK),
the master-in/slave-out (MISO) and the master-out/slave-
in (MOSI). In addition a fourth signal, Motion, is an output
intended to act as an interrupt to the microcontroller
whenever the ADNS-3040 senses motion. When the mouse
is moved the ADNS-3040 alerts the system controller by
activating the Motion signal triggering an interrupt service
routine. At the same time the ADNS-3040 accumulates
the horizontal and vertical displacements (count per inch,
or cpi) in its Delta_X and Delta_Y registers respectively.
The ADNS-3040 deactivates the Motion signal as soon as
movement stops. The SmartSpeed technology automati-
cally optimizes the frame rate by examining the acquired
images of the surface. It also manages the integrated LED
driver to coordinate with the shutter.
The system controller reads the motion information and
reports it to the PC to update the cursor position.
The advantages of using ADNS-3040 optical sensor are the
efficient power management, high tracking accuracy, and
efficient communications with the optical sensor via the
full duplex SPI port.
To learn more about sensor’s technical information, please
visit the Avago web site at http://www.avagotech.com
Microcontroller
The Texas Instruments MSP430 family of ultra-low power
microcontrollers consists of several devices featuring
different sets of peripherals targeted for various applica-
tions. The architecture, combined with five low-power
modes, is optimized to achieve extended battery life in
portable measurement applications. The device features
a powerful 16-bit RISC CPU, 16-bit registers, and constant
generators that attribute to maximum code efficiency. The
Digitally Controlled Oscillator (DCO) allows wake-up from
low-power modes to active mode in less than 6 µsec.
The specific device used in this reference design is the
MSP430F1222 with 28 pin to accommodate ample amount
of I/O. It is an ultra-low power mixed-signal microcontrol-
lers with a built-in 16-bit timer, 10-bit A/D converter with
integrated reference and Data Transfer Controller (DTC),
and 14 (20 pin package) or 22 (28 pin package) general
purpose I/O pins. The MSP430x12x2 series microcontrol-
lers have built-in communication capability using asyn-
chronous (UART) and synchronous (SPI) protocols.