Agilent ADNS-2051 Optical Mouse Sensor: Data Sheet
Agilent ADNS-2051 Optical Mouse Sensor: Data Sheet
Description
The ADNS-2051 is a low cost
optical sensor used to implement a
non-mechanical tracking engine for
computer mice.
It is based on optical navigation
technology, which measures
changes in position by optically
acquiring sequential surface images
(frames) and mathematically determining the direction and magnitude
of movement.
The sensor is housed in a 16-pin
staggered dual inline package (DIP)
that is designed for use with the
HDNS-2100 Lens and HDNS-2200
Clip and HLMP-ED80 (639 nm LED
illuminator source). There are no
moving parts, and precision optical
alignment is not required,
facilitating high volume assembly.
The output format is two channel
quadrature (X and Y direction)
which emulates encoder phototransistors. The current X and Y
information are also available in
registers accessed via a serial port.
Features
Precise optical navigation technology
No mechanical moving parts
Complete 2D motion sensor
Serial interface and/or
quadrature interface
Smooth surface navigation
Programmable frame speed up to
2300 frames per sec (fps)
Accurate motion up to 14 ips
800 cpi resolution
High reliability
High speed motion detector
No precision optical alignment
Wave solderable
Single 5.0 volt power supply
Shutdown pin for USB suspend
mode operation
Power conservation mode during
times of no movement
On chip LED drive with regulated
current
Serial port registers
Programming
Data transfer
16-pin staggered dual inline
package (DIP)
Applications
Mice for desktop PCs,
workstations, and portable PCs
Trackballs
Integrated input devices
Pin
Description
SCLK
XA
XA quadrature output
XB
XB quadrature output
YB
YB quadrature output
YA
YA quadrature output
XY_LED
LED control
REFA
Internal reference
REFB
Internal reference
OSC_IN
Oscillator input
10
GND
System ground
11
OSC_OUT
Oscillator output
12
GND
System ground
13
VDD
14
R_BIN
15
PD
16
SDIO
SCLK
XA
XB
YB
YA
XY_LED
REFA
REFB
A2051
YYWW
16
SDIO
15
PD
14
R_BIN
13
VDD
12
GND
11
OSC_OUT
10
GND
OSC_IN
A2051
YYWW
PIN 1
0.99
(0.039)
22.30
(0.878)
9.10
(0.358)
3.18
(0.125)
5.15
(0.203)
LEAD WIDTH
0.50
(0.020)
0.25
(0.010)
1.42
(0.056)
5 TYP.
KAPTON TAPE
6.17
(0.243)
2.54
LEAD PITCH
(0.100)
12.34
(0.486)
6.02
(0.237)
13.38
(0.527)
4.55
(0.179)
5.60
(0.220)
0.80
(0.032)
NOTES:
1. DIMENSIONS IN MILLIMETERS (INCHES).
2. DIMENSIONAL TOLERANCE: 0.1 mm.
3. COPLANARITY OF LEADS: 0.1 mm.
4. LEAD PITCH TOLERANCE: 0.15 mm.
5. CUMULATIVE PITCH TOLERANCE: 0.15 mm.
6. ANGULAR TOLERANCE: 3.0 DEGREES.
7. MAXIMUM FLASH + 0.2 mm.
8. CHAMFER (25 DEGREES x 2) ON THE TAPER SIDE OF THE LEAD.
40.53
(1.596)
39.39
(1.551)
30.32
(1.194)
1.27
(0.050)
3.50
(1.38)
2.32
(0.091)
5.10
(0.201)
12.60
(0.498)
13.88
(0.546)
11.38
(0.448)
0 REF.
1.28
(0.050)
7.50
(0.295)
1.22
(0.048)
CLEAR ZONE
0 REF.
TOP VIEW
44.29
(1.744)
+x
19.10
(0.752)
+y
BASE PLATE
ESD LENS RING
SIDE VIEW
PLASTIC SPRING
14.58
(0.574)
13.82
(0.544)
10.58
(0.417)
7.45
(0.293)
SENSOR
PCB
CLIP
BASE PLATE
ALIGNMENT POST
HDNS-2200 (CLIP)
HLMP-ED80 (LED)
ADNS-2051 (SENSOR)
HDNS-2100 (LENS)
SCLK
OSC_IN
SERIAL PORT
SERIAL PORT
OSCILLATOR
SDIO
YA
YB
R_BIN
LED
REFA
POWER ON
RESET
IMAGE
PROCESSOR
LED
DRIVE
VOLTAGE REGULATOR
AND POWER CONTROL
QUADRATURE
OUTPUTS
QUADRATURE
OUTPUT
XA
XB
RESONATOR
OSC_OUT
XY_LED
REFB
VOLTAGE
REFERENCE
PD
VDD
GND
5 VOLT
POWER
GND
Typical Distance
Creepage
Clearance
Millimeters
16.0
2.1
SENSOR
CLIP
PCB
LENS/LIGHT PIPE
BASE PLATE
SURFACE
LED
0.1 F
4.7 F
13
VDD
0.1 F
VDD
13
D+
11
VDD
VPP
D+
1.3 k
GND
GND QA
SHLD
VDD
VDD
QB
VREG
5 P1.0
14
10
CYPRESS
CY7C63723A-PC
12 D-
D-
12
P1.1
Z-WHEEL
ENCODER
P0.5
P0.6
P0.7
R
P0.2
P0.0
15
P0.4 18
P0.1
16
17
PD
OSC_IN
SDIO
ADNS
2051
REFA
R_BIN
M
R
BUTTONS
XA
2
XB
3
VSS 6
XTALOUT
CERAMIC RESONATOR
11
XTALIN
YB
4
YA
5
AVX
MURATA
KBR-18-00-MSA
CSALS18M0X55-B0
7
0.1 F
REFB
Z LED
SCLK
18 MHz
OSC_OUT
16
15
HLMP-ED80
SURFACE
GND
XY_LED
P0.3
GND
HDNS-2100
LENS
INTERNAL
IMAGE
SENSOR
2.2 F
8
14
R1
R1 VALUE
(k)
LED
BIN
15.0
15.0
15.0
15.0
15.0
15.0 ~ 18.0
15.0 ~ 22.0
15.0 ~ 27.0
15.0 ~ 33.0
15.0 ~ 37.0
K
L
M
N
P
Q
R
S
T
U
Regulatory Requirements
Passes FCC B and worldwide
analogous emission limits
when assembled into a mouse
with unshielded cable and following Agilent recommendations.
Passes EN61000-4-4/IEC801-4
EFT tests when assembled into
a mouse with unshielded cable
and following Agilent recommendations.
UL flammability level UL94 V-0.
Provides sufficient ESD creepage/clearance distance to avoid
discharge up to 15 kV when
assembled into a mouse according to usage instructions
above.
For eye safety consideration,
please refer to the technical
report available on the web site,
http://www.agilent.com
The 15.0 k resistor is determined by the absolute maximum rating of 50 mA for the
HLMP-ED80. The other resistor values for brighter bins will
guarantee good signals with
reduced power.
4.7 F
1.5 M
9
12
VDD
10
CYPRESS
CY7C63001A-PC
VDD
14
10
GND
SHLD
16
15
15
P0.3
6 MHz
P1.1
11
6
M
19
R
L
P0.1 2
P0.2
XTALIN
20
XTALOUT
P1.3
P1.2
P1.0
P0.5
P0.6 17
P0.4
P0.7 18
BUTTONS
GND
HDNS-2100
LENS
INTERNAL
IMAGE
SENSOR
VSS VPP
7
8
XA
OSC_IN
6
9
ADNS-2051
XB
OSC_OUT
YB
REFA
11
CERAMIC RESONATOR
18 MHz AVX
KBR-18-00-MSA
MURATA CSALS18M0X55-B0
YA
0.1 F
PD
REFB
SCLK
R_BIN
2.2 F
8
14
16 SDIO
HLMP-ED80
SURFACE
GND
XY_LED
P0.0
D+
13 D
13
VDD
12
CEXT
0.33 F
D+
0.1 F
R1
PANASONIC
EVQ SERIES ENCODER
R1 VALUE
(k)
LED
BIN
15.0
15.0
15.0
15.0
15.0
15.0 ~ 18.0
15.0 ~ 22.0
15.0 ~ 27.0
15.0 ~ 33.0
15.0 ~ 37.0
K
L
M
N
P
Q
R
S
T
U
Z-WHEEL
D- RESISTOR CONNECTION
1.5 k
7.5 k
3.3 V REGULATOR
LP2950AC
Z-3.3
Symbol
TS
TA
Supply Voltage
ESD
VDD
Input Voltage
VIN
Input Voltage
VIN
Min.
40
15
Max.
85
55
260
Units
C
C
C
5.5
2
V
kV
0.5
VDD + 0.5
0.5
3.6
0.5
Notes
VRT
VN
Clock Frequency
Serial Port Clock Frequency
Resonator Impendance
Distance from Lens Reference
Plane to Surface
Speed
Acceleration
Light Level onto IC
fCLK
SCLK
XRES
Z
tHOLD
80
100
100
tSWW
100
tSWR
100
tSRW
120
tSRR
120
tCOMPUTE
3.2
tSETUP
60
PD Pulse Width
(to power down the chip)
tPDW
700
PD Pulse Width
(to reset the serial port)
tPDR
100
Frame Rate
FR
Bin Resistor
R1
S
A
IRRINC
Min.
0
4.25
Typ.
5.0
17.4
18.0
2.3
2.4
Max.
40
5.5
Units
C
volts
100
100
ms
mV
18.7
fCLK/4
55
2.5
MHz
MHz
mm
14
0.15
25,000
30,000
Notes
Register values retained for
voltage transients below
4.25 V but greater than 4 V.
Peak to peak within
0-100 MHz.
Set by ceramic resonator.
Refer to Figure 8.
Parameter
Operating Temperature
Power Supply Voltage
1500
15 K
15 K
37 K
ADNS-2051
HDNS-2100
OBJECT SURFACE
AC Electrical Specifications
Electrical Characteristics over recommended operating conditions. Typical values at 25C, VDD = 5.0 V, 1500 fps, 18 MHz.
SDIO
ILED
Max.
Units
s
tPUPD
50
ms
tPU
30
ms
tr
30
ns
tf
16
ns
tr
50
ns
tf
20
ns
tr
40
ns
tf
200
ns
tSPTT
IDDT
Typ.
700
0.7
0.9
1.0
20
37
mA
Notes
From PD
Time uncertainty due to firmware delay. (Refer to Figure 12.)
From PD to valid quad signals
705 sec + 75 frames. (Refer to
Figure 12.)
From VDD to valid quad
signals
705 sec + 40 frames
CL = 30 pF (the rise time is
between 10% and 90%)
CL = 30 pF (the fall time is
between 10% and 90%)
CL = 30 pF (the rise time is
between 10% and 90%)
CL = 30 pF (the fall time is
between 10% and 90%)
With HLMP-ED80 LED (the rise
time is between 10% and 90%)
With HLMP-ED80 LED (the fall
time is between 10% and 90%)
Serial port will reset if current
transaction is not complete
within tSPTT. (Refer to Figure 36.)
Max. supply current during a
VDD ramp from 0 to 5.0 V with
> 500 s rise time. Does not
include charging current for
bypass capacitors.
Min.
Power Up from PD
Symbol
tPD
Parameter
Power Down
DC Electrical Specifications
Electrical Characteristics over recommended operating conditions. Typical values at 25C, VDD = 5.0 V, 18 MHz.
Parameter
DC Supply Current
(mouse moving)
Symbol
IDD AVG
IDD PEAK
20
DC Supply Current
(mouse not moving)
IDD
12
25
mA
DC Supply Current
(power down)
SCLK, SDIO, PD
Input Low Voltage
Input High Voltage
Output Low Voltage
Output High Voltage
Output Low Voltage
(XA, XB, YA, YB)
Output High Voltage
(XA, XB, YA, YB)
Output Low Voltage
(XY_LED)
XY LED Current
IDDPD
170
240
0.8
V
V
V
V
V
@ IOH = 0.5 mA .
VIL
VIH
VOL
VOH
VOL
Min.
Typ.
15
Max.
25
Units
mA
mA
0.5 * VDD
0.7
0.6 * VDD
0.4
VOH
0.6 * VDD
VOL
1.1
ILED
Typ15% 630/R1
Typ + 15% A
ILED
VREFA
3.3
VREFA
3.3
500
NORMALIZED ILED %
R1 Value
LED current (typical)
80
60
40
20
R = 15 k
R = 30 k
0
0.5
1.0
1.5
2.0
2.5
3.0
VOL (V)
10
100
XY LED Current
(fault mode)
REF_A (normal mode)
Notes
No load on XA, XB, YA, YB,
SCLK, SDIO. Excluding LED
current.
No load on XA, XB, YA, YB,
SCLK, SDIO. Excluding LED
current.
No load on XA, XB, YA, YB,
SCLK, SDIO. Excluding LED
current.
PD = high; SCLK, SDIO = GND
or VDD; V DD = 4.25 V to 5.25 V.
3.5
k
mA
15
42
18
35
22
29
27
23
33
19
37
17
PD Pin Timing
PD
IDD
75 FRAMES
tpd
705 s
tpupd
tCOMPUTE (SEE FIGURE 15)
PD
I LED
PD
tPDW
SCLK
700 s
REGISTER
READ OPERATION
tCOMPUTE
(POWER DOWN)
PD
OSCILLATOR
START
250 s
RESET
COUNT
INITIALIZATION
455 s
NEW ACQUISITION
2410 s
LED
CURRENT
SCLK
705 s
SPI TRANSACTIONS
WITH NEW IMAGE DATA
tCOMPUTE
133 s
133 s
133 s
133 s
133 s
133 s
133 s
133 s
133 s
133 s
XB/YB
XA/YA
FOUR
267 s
XB/YB
XA/YA
THREE
400 s
XB/YB
XA/YA
TWO
133 s
533 s
XB/YB
XA/YA
ONE
667 s
XB/YB
ONE FRAME
12
XA/YA
TEN OR MORE
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
XB/YB
XA/YA
NINE
133 s
XB/YB
XA/YA
EIGHT
200 s
XB/YB
XA/YA
SEVEN
266 s
XB/YB
XA/YA
SIX
XB/YB
ONE FRAME
13
333 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
66.7 s
400 s
XB/YB
XA/YA
FOUR
476 s
XB/YB
XA/YA
THREE
XB/YB
XA/YA
TWO
66.7 s
XB/YB
XA/YA
ONE
XB/YB
ONE FRAME
14
PD
PD
+1
STATE 0
STATE 2
-1
STATE
+1
-1
-1
+1
PD
A
0
0
1
1
0
1
2
3
-1
STATE 1
X AND Y
OUTPUT
B
0
1
0
1
STATE 3
+1
PD
YA
XA
DOWN MOTION
(- DIRECTION)
LEFT MOTION
(-DIRECTION)
XB
YB
-1
-1
-1
-1
MOTION COUNT
-1
-1
-1
-1
MOTION COUNT
YA
XA
RIGHT MOTION
(+ DIRECTION)
XB
UP MOTION
(+ DIRECTION)
YB
+1
+1
+1
+1
15
MOTION COUNT
-1
-1
-1
-1
MOTION COUNT
Symbol
PERROR
Min.
Typ.
0.5
Max.
Units
%
Notes
Path Error (Deviation) is the error from the
ideal cursor path. It is expressed as a
percentage of total travel and is measured
over standard surfaces.
The following graphs (Figures 21, 22, 23, and 24) are the typical performance of the ADNS-2051 sensor,
assembled as shown in the 2D assembly drawing with the HDNS-2100 Lens/Prism, the HDNS-2200 clip, and the
HLMP-ED80 LED (page 3, Figure 4).
TYPICAL RESOLUTION vs. HEIGHT
1.0
450
0.9
400
0.8
350
300
250
200
150
100
DOF
DOF
RECOMMENDED
OPERATING
REGION
WHITE PAPER
MANILA FOLDER
RELATIVE RESPONSE
500
0.7
0.6
0.5
0.4
0.3
50
BURL FORMICA
0.2
DARK WALNUT
0.1
BLACK COPY
0
400
-50
1.3 1.5 1.7 1.9 2.1 2.3 2.5 2.7 2.9 3.1 3.3 3.5
600
700
800
900
1000
400
400
Z
300
250
200
DOF
DOF
RECOMMENDED
OPERATING
REGION
150
100
50
100%
75%
50%
0
1.3 1.5 1.7 1.9 2.1 2.3 2.5 2.7 2.9 3.1 3.3 3.5
HEIGHT mm (2.4 = NOMINAL FOCUS)
350
COUNTS PER INCH
350
COUNTS PER INCH
500
WAVELENGTH (nm)
300
250
200
150
Z
DOF
DOF
100
50
0
RECOMMENDED
OPERATING
REGION
-50
1.3 1.5 1.7 1.9 2.1 2.3 2.5 2.7 2.9 3.1 3.3 3.5
HEIGHT mm (2.4 = NOMINAL FOCUS)
Note:
1. The ADNS-2051 is designed for optimal performance when used with the HLMP-ED80 (red LED 639
nm). For use with other LED colors (i.e., blue, green), please consult factory. When using alternate
LEDs, there may also be performance degradation and additional eye safety considerations.
2. Z = Distance from Lens Reference plane to Surface.
3. DOF = Depth of Field.
16
100%
75%
50%
SDIO:
PD:
SCLK
CYCLE #
Write Operation
Write operations, where data is
going from the micro-controller
to the ADNS-2051, is always initiated by the micro-controller and
consists of two bytes. The first
byte contains the address (seven
bits) and has a 1 as its MSB to
indicate data direction. The second byte contains the data. The
transfer is synchronized by SCLK.
The micro-controller changes
SDIO on falling edges of SCLK.
The ADNS-2051 reads SDIO on
rising edges of SCLK.
10
11
12
13
14
15
16
A6
A5
A4
A3
A2
A1
A0
D7
D6
D5
D4
D3
D2
D1
D0
SCLK
SDIO
120 ns 120 ns
SCLK
SDIO
120 ns, MIN.
tsetup = 60 ns, MIN.
17
DON'T
CARE
Read Operation
A read operation, which means
that data is going from the
ADNS-2051 to the microcontroller, is always initiated by
the micro-controller and consists
of two bytes. The first byte
contains the address, is written
by the micro-controller, and has a
0 as its MSB to indicate data
SCLK
CYCLE #
direction. The second byte contains the data and is driven by the
ADNS-2051. The transfer is synchronized by SCLK. SDIO is
changed on falling edges of SCLK
and read on every rising edge of
SCLK. The micro-controller must
go to a high Z state after the last
address data bit. The ADNS-2051
will go to the high Z state after
A6
A5
A4
A3
A2
A1
10
11
12
13
14
15
16
D7
D6
D5
D4
D3
D2
D1
D0
SCLK
SDIO
A0
DETAIL "B"
DETAIL "A"
SCLK
MICROCONTROLLER
TO ADNS-2051
SDIO HANDOFF
60 ns, MIN.
SDIO
A1
0 ns, MIN.
A0
120 ns, MIN.
Hi-Z
D7
D6
0 ns, MIN.
DETAIL "B"
ADNS-2051 TO
MICROCONTROLLER
SDIO HANDOFF
10 ns, MAX.
SDIO
D0
RELEASED BY 2051
DRIVEN BY MICRO
Note:
The 120 ns high state of SCLK is the minimum data hold time of the ADNS-2051. Since the falling edge of SCLK
is actually the start of the next read or write command, the ADNS-2051 will hold the state of D0 on the SDIO line
until the falling edge of SCLK. In both write and read operations, SCLK is driven by the micro-controller.
Serial port communications is not allowed while PD (power down) is high. See Error Detection and
Recovery regarding re-synchronizing via PD.
18
100 s
PD
Hi-Z
SDIO
SCLK
ADDRESS
DATA
WRITE OPERATION
ADDRESS
DATA
WRITE OPERATION
tSWR >100 s
SCLK
ADDRESS
DATA
WRITE OPERATION
19
ADDRESS
NEXT READ OPERATION
tHOLD >100 s
SCLK
ADDRESS
DATA
ADDRESS
READ OPERATION
Figure 33. Timing between read and either write or subsequent read commands.
SCLK
DATA
PD
>1 s
20
NEXT READ
OR WRITE OPERATION
5. In case of synchronization
failure, both the ADNS-2051
and the micro-controller may
drive SDIO. The ADNS-2051
can withstand 30 mA of short
circuit current and will withstand infinite duration short
circuit conditions.
6. Termination of a transmission
by the micro-controller may
sometimes be required (for
example, due to a USB suspend interrupt during a read
operation). To accomplish this
the micro-controller should
raise PD. The ADNS-2051 will
not write to any register and
will reset the serial port (but
This diagram shows the VDD rising to valid levels, at some point
the microcontroller starts its program, sets the SCLK and SDIO
lines to be outputs, and sets them
high. It then waits to ensure that
the ADNS-2051 has powered up
and is ready to communicate. The
microprocessor then tries to read
from location 0x00, Product_ID,
VDD
PD
SCLK
ADDRESS = 0x00
SDIO
PROBLEM AREA
21
DATA = 0x02
SCLK
ADDRESS = 0x00
DATA = 0x02
SDIO
VDD
PD
SCLK
Two Solutions
There are two different ways to
solve the problem, waiting for the
serial port watchdog timer to
time out, or using the PD line to
reset the serial port.
ADDRESS = 0x00
22
DATA = 0x02
SDIO
Resync Note
If the microprocessor and the
ADNS-2051 get out of sync, then
the data either written or read
from the registers will be incorrect. An easy way to solve this is
to output a PD pulse to resync
the parts after an incorrect read.
Notes:
; I/O port
Port1_Data:
equ
Port1_Interrupt: equ
Port1_Pullup:
equ
01h
05h
09h
;
; Port bit definitions
SDIO:
equ 01h
PD:
equ 02h
SCLK:
equ 08h
Pt1_Current:
equ 00h
;
; GPIO Isink registers
Port1_Isink:
equ 38h
Port1_Isink0:
equ 38h
Port1_Isink1:
equ 39h
Port1_Isink3:
equ 3Bh
;
;
; data memory variables
spi_addr:
equ 40h
spi_data:
equ 41h
bit_counter:
equ 44h
port1_wrote:
equ 45h
;
;
;
;
;
;
;
;
bit 0
bit 1
bit 3
port1 current setting
;
;
;
;
address
data of
SPI bit
what we
mov A, Pt1_Current
iowr Port1_Isink0
iowr Port1_Isink1
iowr Port1_Isink3
;
;
;
;
mov A, 0h
iowr Port1_Pullup
mov A, ~(PD|SDIO)
mov [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
Resync_sensor:
23
of spi writes
spi writes
counter
wrote last
initialize Port 1
mov A, 0
iowr Port1_Interrupt
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
delay700us
delay700us
delay700us
delay700us
delay700us
delay700us
mov A, (SCLK|SDIO|PD
or [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
call delay700us
mov A, ~PD
and [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
call
call
call
call
call
call
delay700us
delay700us
delay700us
delay700us
delay700us
delay700us
ReadSPI routine
Includes delays for long traces or cables between the uP and ADNS-2051
Has correct timing of SCLK and SDIO
On entry:
spi_addr = Address of SPI register in the ADNS-2051
spi_data = undefined
On exit
spi_addr = undefined
spi_data = register contents from ADNS-2051
ReadSPI:
Waitrspi:
mov
mov
nop
nop
nop
nop
nop
nop
dec
jnz
A, 64
[bit_counter], A
Waitrspi2:
mov
mov
nop
nop
nop
nop
nop
nop
dec
jnz
[bit_counter]
Waitrspi
mov A,~80h
and [spi_addr], A
call writeaddr
24
A,64
[bit_counter], A
[bit_counter]
Waitrspi2
; read address
; lower MSB of address (read)
; wait 200us (about 3us per loop)(100us minimum required)
; wait for data to be ready
nextr:
rd1:
rdx:
;
;
;
;
;
;
;
;
;
;
;
;
mov A, 0h
mov [spi_data], A
mov A, 08h
mov [bit_counter], A
mov A, SDIO
or [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
mov A, ~SCLK
and [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
nop
nop
nop
nop
nop
nop
nop
mov A,[spi_data]
asl
mov [spi_data], A
iord Port1_Data
and A, SDIO
jz rdx
mov A, 01h
or [spi_data], A
mov A, SCLK
or [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
nop
nop
nop
nop
nop
nop
nop
dec [bit_counter]
jnz nextr
ret
; write a 1 to SDIO
; lower SCLK
;
;
;
;
;
; raise SCLK
WriteSPI routine
Includes delays for long traces or cables between the uP and ADNS-2051.
Has correct timing of SCLK and SDIO
On entry:
spi_addr = Address of SPI register in the ADNS-2051
spi_data = Data to be written to the SPI register
On exit
spi_addr = undefined
spi_data = undefined
WriteSPI:
Waitspi:
mov
mov
nop
nop
nop
nop
nop
nop
dec
jnz
A, 64
[bit_counter], A
[bit_counter]
Waitspi
mov A, 80h
or [spi_addr], A
25
; write address
; set MSB of address (write)
call writeaddr
jmp wrdata
writeaddr:
nexta:
addr1:
addr0:
addrx:
wrdata:
nextw:
wr1:
wr0:
wrx:
26
mov A, 08h
mov [bit_counter], A
mov A, ~SCLK
and [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
mov A, [spi_addr]
asl
mov [spi_addr], A
jnc addr0
mov A, SDIO
or [port1_wrote], A
jmp addrx
mov A, ~SDIO
and [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
nop
nop
nop
nop
nop
nop
nop
mov A, SCLK
or [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
nop
nop
nop
nop
nop
nop
nop
dec [bit_counter]
jnz nexta
ret
mov A, 08h
mov [bit_counter], A
mov A, ~SCLK
and [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
mov A, [spi_data]
asl
mov [spi_data], A
jnc wr0
mov A, SDIO
or [port1_wrote], A
jmp wrx
mov A, ~SDIO
and [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
nop
nop
nop
nop
nop
nop
nop
mov A, SCLK
or [port1_wrote], A
; raise SDIO
; lower SDIO
; wait for cable to settle
; raise SCLK
; ADNS-2051 reads the address bit
; wait for cable to settle
; 8 bits of data
; lower SCLK
; raise SDIO
; lower SDIO
; wait for cable to settle
; raise SCLK
mov A, [port1_wrote]
iowr Port1_Data
nop
nop
nop
nop
nop
nop
nop
dec [bit_counter]
jnz nextw
ret
delay700us:
waitd0:
mov A, ffh
mov [bit_counter], A
nop
nop
nop
nop
nop
nop
dec [bit_counter]
jnz waitd0
ret
; 2us
WriteSPI
Set register 0a to 40h, LED blink mode
mov A, 0ah
mov [spi_addr], A
mov A, 40h
mov [spi_data], A
call WriteSPI
;
;
;
;
ReadSPI
Read register 02h, the motion register
mov A, 02h
mov [spi_addr], A
call ReadSPI
27
;
;
;
;
;
;
;
;
;
;
Registers
The ADNS-2051 can be programmed through registers, via the serial port, and configuration and motion
data can be read from these registers.
Address
0x00
0x01
0x02
0x03
0x04
0x05
Register
Product_ID
Revision_ID
Motion
Delta_X
Delta_Y
SQUAL
Address
0x06
0x07
0x08
0x09
0x0a
0x0b
Register
Average_Pixel
Maximum_Pixel
Reserved
Reserved
Configuration_bits
Reserved
Product_ID
Address: 0x00
Access: Read
Reset Value: 0x02
Bit
7
6
5
4
3
2
Field PID7
PID6 PID5
PID4 PID3
PID2
Data Type: Eight bit number with the product identifier.
1
PID1
Address
0x0c
0x0d
0x0e
0x0f
0x10
0x11
Register
Data_Out_Lower
Data_Out_Upper
Shutter_Lower
Shutter_Upper
Frame_Period_Lower
Frame_Period_Upper
0
PID0
USAGE: The value in this register does not change, it can be used to verify
that the serial communications link is OK.
Revision_ID
Address: 0x01
Access: Read
Reset Value: 0xNN
Bit
7
6
5
4
3
2
Field RID7
RID6 RID5
RID4 RID3
RID2
Data Type: Eight bit number with current revision of the IC.
1
RID1
0
RID0
Motion
Access: Read
Bit
7
Field
MOT
Data Type: Bit field
6
Reserved
Address: 0x02
Reset Value: 0x00
5
4
FAULT
OVFY
3
OVFX
2
Reserved
1
Reserved
0
RES
USAGE: Register 0x02 allows the user to determine if motion has occurred since the last time it was read. If so, then the
user should read registers 0x03 and 0x04 to get the accumulated motion. It also tells if the motion buffers have
overflowed and whether or not an LED fault occurred since the last reading. The current resolution is also shown.
28
Field Name
MOT
Reserved
FAULT
OVFY
OVFX
Reserved
Reserved
RES
Description
Motion since last report or PD
0 = No motion
1 = Motion occurred, data ready for reading in Delta_X and Delta_Y registers
Reserved for future
LED Fault detected set when R_BIN is too low or too high, shorts to VDD or Ground
0 = No fault
1 = Fault detected
Motion overflow Y, Y buffer has overflowed since last report
0 = No overflow
1 = Overflow has occurred
Motion overflow X, X buffer has overflowed since last report
0 = No overflow
1 = Overflow has occurred
Reserved for future
Reserved for future
Resolution in counts per inch
0 = 400
1 = 800
Delta_X
Address: 0x03
Access: Read
Reset Value: 0x00
Bit
7
6
5
4
3
2
Field
X7
X6
X5
X4
X3
X2
Data Type: Eight bit 2s complement number.
1
X1
0
X0
29
MOTION
-128
-127
-2
-1
+1
+2
+126
+127
DELTA_X
80
81
FE
FF
00
01
02
7E
7F
Delta_Y
Address: 0x04
Access: Read
Reset Value: 0x00
Bit
7
6
5
4
3
2
Field
Y7
Y6
Y5
Y4
Y3
Y2
Data Type: Eight bit 2s complement number.
1
Y1
0
Y0
-128
-127
-2
-1
+1
+2
+126
+127
DELTA_Y
80
81
FE
FF
00
01
02
7E
7F
Address: 0x05
Reset Value: 0x00
4
3
2
SQ4
SQ3
SQ2
1
SQ1
Surface_Quality
Access: Read
Bit
7
6
Field
SQ7
SQ6
Data Type: Eight bit number.
5
SQ5
0
SQ0
192
128
64
0
25
50
75
100
125
150
The focus point is important and could affect the squal value, the
graph below showing another setup with various z-height. The graph
clearly shows that the squal count is dependent on focus distance.
Note:
This graph is obtained by getting multiple readings over different heights.
175
200
225
250
1.4
NORMALIZED SQUAL COUNTS
SQUAL VALUE
256
1.2
1.0
0.8
0.6
0.4
X+ 3
X
X 3
0.2
0
-1.0 -0.8 -0.5 -0.3
0.25
0.5
0.75 1.0
30
Average_Pixel
Access: Read
Bit
7
6
Field
0
0
Data Type: Six bit number.
5
AP5
Address: 0x06
Reset Value: 0x00
4
3
2
AP4
AP3
AP2
1
AP1
0
AP0
25
50
Maximum_Pixel
Access: Read
Bit
7
6
Field
0
0
Data Type: Six bit number.
75
5
MP5
100
Address: 0x07
Reset Value: 0x00
4
3
2
MP4 MP3
MP2
125
150
1
MP1
175
200
225
250
175
200
225
250
0
MP0
25
50
75
100
Reserved
Address: 0x08
Reserved
Address: 0x09
31
125
150
Configuration_bits
Access: Read/Write
Bit
7
Field
RESET
Data Type: Bit field
6
LED_MODE
Address: 0x0a
Reset Value: 0x00
5
4
Sys Test
RES
3
PixDump
2
Reserved
1
Reserved
0
Sleep
USAGE: Register 0x0a allows the user to change the configuration of the sensor. Shown below are the bits, their
default values, and optional values.
Field Name
RESET
LED_MODE
Sys Test
RES
Pix Dump
Reserved
Reserved
Sleep
Reserved
32
Description
Power up defaults (bit always reads 0)
0 = No effect
1 = Reset registers and bits to power up default settings (bold entries)
LED Shutter Mode
0 = Shutter mode off (LED always on) (even if no motion up to 1 sec.)
1 = Shutter mode on (LED only on when the electronic shutter is open)
System Tests (bit always reads 0)
0 = No tests
1 = perform all system tests, output 16 bit CRC via Data_Out_Upper and Data_Out_Lower registers.
Note: Since part of the system test is a RAM test, the RAM will be overwritten with the default values
when the test is done. If any configuration changes from the default are needed for operation, make
the changes AFTER the system test is run. This operation requires substantially more time to
complete than other register transactions.
Resolution in counts per inch
0 = 400
1 = 800
Dump the pixel array through Data_Out_Upper and Data_Out_Lower, 256 bytes
0 = disabled
1 = dump pixel array
Reserved
Reserved
Sleep Mode
0 = Normal, fall asleep after one second of no movement (1500 frames/s)
1 = Always awake
Address: 0x0b
Data_Out_Lower
Access: Read
Bit
7
Field DO7
6
DO6
5
DO5
Data_Out_Upper
Access: Read
Bit
7
6
5
Field DO15 DO14 DO13
Data Type: Sixteen bit word.
Address: 0x0c
Reset Value: undefined
4
3
2
1
DO4
DO3
DO2
DO1
0
DO0
Address: 0x0d
Reset Value: undefined
4
3
2
1
DO12 DO11 DO10
DO9
0
DO8
USAGE: Data can be written to these registers from the system self test, or the
pixel dump command. The data can be read out 0x0d, or 0x0d first, then 0x0c.
Data_Out_Upper
FE
4D
Data_Out_Lower
D4
10
Pixel Address
Once the pixel dump command is given, the sensor writes the address
and the value for the first pixel into the Data_Out_Upper and
Data_Out_Lower registers. The MSB of Data_Out_Lower is the status
bit for the data. If the bit is high, the data are NOT valid. Once the MSB
is low, the data for that particular read are valid and should be saved.
The pixel address and data will then be incremented on the next frame.
Once the pixel dump is complete, the PixDump bit in register 0x0a
should be set to zero. To obtain an accurate image, the LED needs to
be turned on by changing the sleep mode of the configuration register
0x0a to always awake.
33
Note
One of two results returned. These
values are subject to change with
each device design revision.
POSITIVE Y
LB
RB
16
1
A2051
YYWW
POSITIVE X
Figure 39. Directions are for a complete mouse, with the HDNS-2100 lens.
34
35
Shutter_Lower
Access: Read
Bit
7
Field
S7
6
S6
Shutter_Upper
Access: Read
Bit
7
6
Field
S15
S14
Data Type: Sixteen bit word.
5
S5
Address: 0x0e
Reset Value: 0x64
4
3
2
S4
S3
S2
1
S1
0
S0
5
S13
Address: 0x0f
Reset Value: 0x00
4
3
2
S12
S11
S10
1
S9
0
S8
USAGE: Units are clock cycles; default value is 64. Read Shutter_Upper first,
then Shutter_Lower. They should be read consecutively. The shutter is
adjusted to keep the average and maximum pixel values within normal
operating ranges. The shutter value can be adjusted to a new value on every
frame. When the shutter adjusts, it changes by 1/16 of the current value.
Shown below is a graph of 250 sequentially acquired shutter values, while the
sensor was moved slowly over white paper.
SHUTTER VALUES (WHITE PAPER)
SHUTTER VALUE
(CLOCK CYCLES)
800
600
400
200
0
25
50
75
100
125
150
The focus point is important and could affect the shutter value. The
graph below shows another setup with various z-height. This graph
clearly shows that the shutter value is dependent on focus distance.
TYPICAL SHUTTER vs. Z (WHITE PAPER)
3.5
3.0
X+ 3
X
X 3
2.5
2.0
1.5
1.0
0.5
0
-1.0 -0.8 -0.5 -0.3
0.25
0.5
0.75 1.0
36
175
200
225
250
The maximum value of the shutter is dependent upon the frame rate
and clock frequency. The formula for the maximum shutter value is:
Max. Shutter Value =
Clock Frequency
2816
Frame Rate
For a clock frequency of 18 MHz, the following table shows the maximum shutter value. 1 clock cycle is 55.56 nsec.
Frames/second
2300
2000
1500
1000
500
Max Shutter
Decimal
5010
6184
9184
15184
33184
Frame_Period_Lower
Access: Read/Write
Bit
7
6
Field
FP 7
FP 6
Shutter
Upper
13
18
23
3B
81
Hex
0x1392
0x1828
0x23E0
0x3B50
0x81A0
Address: 0x10
Reset Value: 0x20
4
3
2
FP 4
FP 3
FP 2
5
FP 5
Frame_Period_Upper
Address: 0x11
Access: Read/Write
Reset Value: 0xd1
Bit
7
6
5
4
3
2
Field FP15
FP14
FP13
FP12 FP11
FP10
Data Type: Sixteen bit 2s complement word.
Lower
92
28
E0
50
A0
1
FP 1
0
FP 0
1
FP 9
0
FP 8
USAGE: The frame period counter counts up until it overflows. Units are clock
cycles. The formula is:
Counts (hex)
Clock Rate
= Counts (decimal)
Frame Rate
For an 18 MHz clock, here are the Frame_Period values for popular frame rates.
Frames/second
2300*
2000*
1500
1000
500
Counts
Decimal
7826
9000
12000
18000
36000
Hex
0x1E92
0x2328
0x2EE0
0x4650
0x8CA0
2s Comp
0xE16E
0xDCD8
0xD120
0xB9B0
0x7360
Frame_Period
Upper
Lower
E1
6E
DC
D8
D1
20
B9
B0
73
60
*Note:
To optimize tracking performance on dark surfaces, it is recommended that an adaptive frame
rate based on shutter value be implemented, for frame rates greater than 1500. Changing the
frame rate results in changes in the maximum speed, acceleration limits, and dark surface
performance.
To read from the registers, read Frame_Period_Upper first followed by Frame_Period_Lower.
To write to the registers, write Frame_Period_Lower first followed by Frame_Period_Upper.
37
0x09
Reserved
0x0a
Configuration_bits
0x00
Part is not Reset
LED Shutter Mode is off
No System tests
Resolution = 400 counts per inch
Pixel Dump is disabled
Sleep mode is enabled
0x0b
Reserved
0x0c
Data_Out_Lower
undefined
No data to read
0x0d
Data_Out_Upper
undefined
No data to read
0x0e
Shutter_Lower
0x64
Initial shutter value
0x0f
Shutter_Upper
0x00
Initial shutter value
0x10
Frame_Period_Lower 0x20
Initial frame period value (corresponds to 1500 fps)
0x11
Frame_Period_Upper 0xd1
Initial frame period value (corresponds to 1500 fps)
38
39
www.agilent.com/semiconductors
For product information and a complete list of
distributors, please go to our web site.
For technical assistance call:
Americas/Canada: +1 (800) 235-0312 or
(408) 654-8675
Europe: +49 (0) 6441 92460
China: 10800 650 0017
Hong Kong: (+65) 271 2451
India, Australia, New Zealand: (+65) 271 2394
Japan: (+81 3) 3335-8152(Domestic/International), or 0120-61-1280(Domestic Only)
Korea: (+65) 271 2194
Malaysia, Singapore: (+65) 271 2054
Taiwan: (+65) 271 2654
Data subject to change.
Copyright 2002 Agilent Technologies, Inc.
January 9, 2002
5988-4289EN