28560 Parallax Inc, 28560 Datasheet - Page 15

Interface Modules & Development Tools Mouse Sensor Kit

28560

Manufacturer Part Number
28560
Description
Interface Modules & Development Tools Mouse Sensor Kit
Manufacturer
Parallax Inc
Datasheet

Specifications of 28560

Interface Type
Serial
Operating Supply Voltage
5 V
Product
Interface Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
CONF
LORES CON $80
CHNG
OFLOW CON $18
NEG
' -----[ Variables ]---------------------------------------------------------
addr
i
dat
sd
q
ovfl
x
y
' -----[ Program ]-----------------------------------------------------------
'Initialize clock, depending on polarity.
#IF (NEG_CLK) #THEN
#ELSE
#ENDIF
PAUSE 100
#IF (USE_500DPI) #THEN
#ENDIF
#IF (USE_DEBUG) #THEN
#ENDIF
'Main program loop.
DO
LOOP
' -----[ Subroutines ]-------------------------------------------------------
' DumpXYQ outputs X, Y, and Quality data to the programming port, for use with
' either DEBUG or an external program.
DumpXYQ:
Copyright © Parallax Inc.
HIGH sclk
LOW sclk
addr = CONF
dat = LORES
GOSUB WriteAddr
DEBUG CLS
#IF (DO_XYQ_ONLY) #THEN
#ELSE
#ENDIF
addr = STAT
GOSUB ReadAddr
#IF (USE_DEBUG) #THEN
GOSUB DumpXYQ
GOSUB DumpALL
IF (dat & CHNG = 0) THEN
CON $1B
CON $80
CON $80
VAR Byte
VAR Byte
VAR Byte
VAR Byte
VAR Byte
VAR Byte
VAR Word
VAR Word
'Configuration register.
'Value to write to CONF for 500 dpi resolution.
'Bitmask for STAT to see if position changed.
'Bitmask for STAT to detect X/Y overflow.
'Sign bit for DX and DY.
'Address value for mouse sensor register.
'General counter.
'Data value to/from mouse sensor register.
'Scratch register.
'Quality value from mouse sensor.
'Overflow counter.
'Current cumulative X position.
'Current cumulative Y position.
'Wait for mouse sensor to come out of reset.
'Change resolution to 500 dpi.
'Clear the screen if using DEBUG window.
'Use this to monitor X, Y, and Quality only.
'Use this to dump all registers.
Mouse Sensor Kit (#28560)
v1.0 6/1/2010 Page 15 of 18

Related parts for 28560