2
Left Button
ADNS-6000
Optical Mouse Sensor
Wheel Button
Right Button
Z Optics
Sunplus SPCP825A
USB Controller
USB interface
MISO
MOSI
SCLK
NCS
D+/D-
SCLK/SDATA
VREG
1.3k Ohm
Avago Technologies
Firmware Confi gurable GPIO
The reference fi rmware is confi gured to use the GPIO pins
as shown on the schematic in Appendix A. However, it
may be more optimal to use a diff erent I/O confi guration
to meet the mechanical constraints of PCB design. The
reference fi rmware is designed to be easily confi gured
to another set of pin connections. This is accomplished
through changes in the I/O defi nitions at the beginning
of the SPCP825A_A6000.asm listing. The following state-
ments are the pin defi nitions as they exist today. The
fi rmware will use these defi nitions to read and confi gure
the GPIO pins, without any other modifi cations.
Communications between the Sunplus SPCP825A and
the ADNS-6000 are done through the integrated SPI
interface. The serial port cannot be activated while the
chip is in power down mode (NPD low) or reset (RESET
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 Sunplus
SPCP825A SPI is always confi gured as a Master to output
the serial clock on PB7. Therefore, the USB microcontroller
always initiates communication. Data sent by the ADNS-
6000 optical sensor is received on the PB1 (MISO), and
data is shifted out to the ADNS-6000 through the PB3
(MOSI). See the schematic in Appendix A. When writing
to the ADNS-6000, the microcontroller drive both the
SCLK and the MOSI lines. When reading from the ADNS-
6000, the microcontroller drives both the SCLK and MOSI
lines initially. After t
SRAD
delay, the ADNS-6000 will drive
Figure 1. Sunplus SPCP825A - ADNS-6000 Optical Mouse Hardware Block Diagram
Hardware Implementation
The standard hardware to implement a mouse is shown
in Figure 1. For X and Y movement, the optical sensor
is used. The Z- wheel movement is detected by a set of
optical sensors that output quadrature signals. For each
button there is a switch that is pulled up internally by the
built in pull up resistors. The D - line is pulled up via a 1.3k
ohm resistor connected to the VREG pin.