HLMP-ED80-XX000 AVAGO [AVAGO TECHNOLOGIES LIMITED], HLMP-ED80-XX000 Datasheet - Page 24
![no-image](/images/no-image-200.jpg)
HLMP-ED80-XX000
Manufacturer Part Number
HLMP-ED80-XX000
Description
Optical Mouse Sensor
Manufacturer
AVAGO [AVAGO TECHNOLOGIES LIMITED]
Datasheet
1.HLMP-ED80-XX000.pdf
(40 pages)
24
SPI communication code for the Cypress CY7C63000 or CY7C63001
(Please consult factory for the CY7C63722 or CY7C63723 codes.)
Note: This programming sequence is not covered in Avago's product warranty. It is only a recommended example when using the mentioned
Cypress microcontrollers. For the latest updates on Cypress microcontrollers, please contact Cypress at email: usbapps@cypress.com or call (858)
613-7929 (US).
The following code can be used to implement the SPI data communications. See the schematic in Figure 9.
;
;
;
;
;
;
;
Port1_Data:
Port1_Interrupt:
Port1_Pullup:
;
;
SDIO:
PD:
SCLK:
Pt1_Current:
;
;
Port1_Isink:
Port1_Isink0:
Port1_Isink1:
Port1_Isink3:
;
;
;
spi_addr:
spi_data:
bit_counter:
port1_wrote:
;
;
;
;
;
;
;
;
Notes:
CY7C63001 20pin package
ADNS-2051
SDIO line connected to pin5 (P1.0)
PD connected to pin 16 (P1.1)
SCLK line connected to pin15 (P1.3)
I/O port
Port bit definitions
GPIO Isink registers
data memory variables
initialize Port 1
There are possible problems with the SPI port if the microcontroller starts executing
instructionsbefore the ADNS-2051 sensor has powered up. See page 18 for details.
It is assumed that power to the microcontroller is OK if the next instructions can be executed.
These instructions will reset the SPI port of the sensor.
equ
equ 05h
equ 09h
equ 01h
equ 02h
equ 08h
equ 00h
equ 38h
equ 38h
equ
equ
equ 40h
equ 41h
equ 44h
equ 45h
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
mov A, 0
iowr Port1_Interrupt
01h
39h
3Bh
mov A, Pt1_Current ; select DAC setting
; GPIO data port 1
; Interrupt enable for port 1
; Pullup resistor control for port 1
; bit 0
; bit 1
; bit 3
; port1 current setting
; address of spi writes
; data of spi writes
; SPI bit counter
; what we wrote last
; isink current Port 1 bit[0]
; isink current Port 1 bit[1]
; isink current Port 1 bit[3]
; enable Port 1 bit [7:0] pullups
; turn on the ADNS-2051
; PD low, SCLK, SDIO
; disable port 1 interrupts