HLMP-ED80-XX000 AVAGO [AVAGO TECHNOLOGIES LIMITED], HLMP-ED80-XX000 Datasheet - Page 25

no-image

HLMP-ED80-XX000

Manufacturer Part Number
HLMP-ED80-XX000
Description
Optical Mouse Sensor
Manufacturer
AVAGO [AVAGO TECHNOLOGIES LIMITED]
Datasheet
25
Resync_sensor:
;
;
;
;
;
;
;
;
;
;
;
;
ReadSPI:
Waitrspi:
Waitrspi2:
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_data = undefined
On exit
spi_data = register contents from ADNS-2051
mov A,~(SCLK|SDIO|PD)
and [port1_wrote], A
mov A, [port1_wrote]
iowr Port1_Data
call delay700us
call delay700us
call delay700us
call delay700us
call delay700us
call 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 delay700us
call delay700us
call delay700us
call delay700us
call delay700us
call delay700us
spi_addr = Address of SPI register in the ADNS-2051
spi_addr = undefined
mov A, 64
mov [bit_counter], A
nop
nop
nop
nop
nop
nop
dec [bit_counter]
jnz Waitrspi
mov A,~80h
and [spi_addr], A
call writeaddr
mov A,64
mov [bit_counter], A
nop
nop
nop
nop
nop
nop
dec [bit_counter]
jnz Waitrspi2
mov A, 0h
; set the SCLK, SDIO and PD lines low
; If the power to the sensor needs more time
; to stabilize, insert a delay here
; wait about 4 milliseconds for the sensor
; oscillator to stabilize
; set the SCLK, SDIO and PD lines high
; this shuts down the oscillator and
; resets the SPI port
; wait for the PD to reset the part
; set the PD line low to put the sensor
; back into normal operation
; wait about 4 milliseconds for the sensor
; oscillator to stabilize
; sensor SPI port now in sync
; wait 200us (optional)
; (about 3us per loop)
; read address
; lower MSB of address (read)
; wait 200us (about 3us per loop)(100us minimum required)
; wait for data to be ready
; clear the data

Related parts for HLMP-ED80-XX000