Download - Principles of Computers 9th Lecture
CHARLES UNIVERSITY IN PRAGUE
http://d3s.mff.cuni.cz/~jezek
faculty of mathematics and physics
Principles of Computers9th Lecture
Pavel Ježek, [email protected]
Inside RS-232 Ball & Wheel Mouse
Inside RS-232 Ball & Wheel Mouse (higher contrast for lecture)
Opto-mechanical Axis Sensors
11
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
11
11
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
11
1 11 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
01
1 1 11 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
01
0 1 1 11 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
01
0 0 1 1 11 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
00
0 0 0 1 1 11 1 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
00
0 0 0 0 1 1 10 1 1 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
00
0 0 0 0 0 1 1 10 0 1 1 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
10
0 0 0 0 0 0 1 1 10 0 0 1 1 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
10
1 0 0 0 0 0 0 1 1 10 0 0 0 1 1 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
10
1 1 0 0 0 0 0 0 1 1 10 0 0 0 0 1 1 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
11
1 1 1 0 0 0 0 0 0 1 10 0 0 0 0 0 1 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
11
1 1 1 1 0 0 0 0 0 0 11 0 0 0 0 0 0 1 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
11
1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
11
1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
01
1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
Opto-mechanical Axis Sensors
01
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0
Opto-mechanical Axis Sensors
01
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 0 0
Opto-mechanical Axis Sensors
00
sens
or 1 c
urren
t valu
e
sens
or 1 v
alue h
istory
sensor 2 current value
sensor 2 value history
0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0
ball & wheel mouse logic
RS-232 bus interface
RS-232 Mouse Structure
registers (packet data)
byte1
byte2
byte3
byte4
X axis
Y axis
wheel
Right Button
Middle Button
Left Button
RS-232data out
“magic”done via
wiring
ball & wheel mouse logic
RS-232 bus interface
RS-232 Mouse Firmware – Using GPIO RegistersGPIO(2)
DATA OUTGPIO(0)
X sensor 1
X sensor 2
Y sensor 1
Y sensor 2
W sensor 1
W sensor 2
GPIO(1)
Middle Btn
Right Btn
Left Btn
registers (packet data)
byte1
byte2
byte3
byte4
X axis
Y axis
wheel
Right Button
Middle Button
Left Button
RS-232data out
“magic”done via
wiring
ball & wheel mouse logic
RS-232 bus interface
RS-232 Mouse Firmware – Two Distinct AlgorithmsGPIO(2)
DATA OUTGPIO(0)
X sensor 1
X sensor 2
Y sensor 1
Y sensor 2
W sensor 1
W sensor 2
GPIO(1)
Middle Btn
Right Btn
Left Btn
registers (packet data)
byte1
byte2
byte3
byte4
X axis
Y axis
wheel
Right Button
Middle Button
Left Button
RS-232data out
data (bit) transmit
algorithm(B) gathering (measuring) input
changes& calculating deltas
algorithm (A)
ball & wheel mouse logic
RS-232 bus interface
RS-232 Mouse Firmware – Implementing Algorithm B (Specific for RS-232 Bus, BUT NOT Specific for Ball Mouse – Would Work for Optical Mouse As Well)
GPIO(2)
DATA OUTGPIO(0)
X sensor 1
X sensor 2
Y sensor 1
Y sensor 2
W sensor 1
W sensor 2
GPIO(1)
Middle Btn
Right Btn
Left Btn
registers (packet data)
byte1
byte2
byte3
byte4
X axis
Y axis
wheel
Right Button
Middle Button
Left Button
RS-232data out byteId
bitId
gathering (measuring) input changes
& calculating deltasalgorithm (A)
ball & wheel mouse logic
RS-232 bus interface
Ball Mouse Firmware – Implementing Algorithm A (part 2)(IS NOT RS-232 Specific!)
GPIO(2)
DATA OUTGPIO(0)
X sensor 1
X sensor 2
Y sensor 1
Y sensor 2
W sensor 1
W sensor 2
GPIO(1)
Middle Btn
Right Btn
Left Btn
registers (packet data)
byte1
byte2
byte3
byte4
X axis
Y axis
wheel
Right Button
Middle Button
Left Button
current change data
x
y
w
buttons
RS-232data out
data (bit) transmit
algorithm(B)
ball & wheel mouse logic
RS-232 bus interface
Ball Mouse Firmware – Implementing Algorithm A (parts 1 & 2)(IS NOT RS-232 Specific!)
GPIO(2)
DATA OUTGPIO(0)
X sensor 1
X sensor 2
Y sensor 1
Y sensor 2
W sensor 1
W sensor 2
GPIO(1)
Middle Btn
Right Btn
Left Btn
registers (packet data)
byte1
byte2
byte3
byte4
X axis
Y axis
wheel
Right Button
Middle Button
Left Button
newX
newY
newW
oldX
oldY
oldW
current change data
x
y
w
buttons
RS-232data out
data (bit) transmit
algorithm(B)
prevPacketButtons
ball & wheel mouse logic
RS-232 bus interface
RS-232 Mouse Firmware Structure (All Together)GPIO(2)
DATA OUTGPIO(0)
X sensor 1
X sensor 2
Y sensor 1
Y sensor 2
W sensor 1
W sensor 2
GPIO(1)
Middle Btn
Right Btn
Left Btn
registers (packet data)
byte1
byte2
byte3
byte4
X axis
Y axis
wheel
Right Button
Middle Button
Left Button
newX
newY
newW
oldX
oldY
oldW
current change data
x
y
w
buttons
byteId
bitId
RS-232data out
prevPacketButtons
ball & wheel mouse logic
RS-232 bus interface
RS-232 Mouse Firmware AlgorithmsGPIO(2)
DATA OUTGPIO(0)
X sensor 1
X sensor 2
Y sensor 1
Y sensor 2
W sensor 1
W sensor 2
GPIO(1)
Middle Btn
Right Btn
Left Btn
registers (packet data)
byte1
byte2
byte3
byte4
X axis
Y axis
wheel
Right Button
Middle Button
Left Button
newX
newY
newW
oldX
oldY
oldW
current change data
x
y
w
buttons
byteId
bitId
RS-232data out
data (bit) transmit
algorithm
prevPacketButtons
gathering (measuring) input changes
& calculating deltasalgorithm
HistoryUNIVAC(1951)
HistoryUNIVAC(1951)
Altair 8800(1974)
Intel 8080
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Intel 8080
MOS 6502
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Apple II(1977)
Intel 8080
MOS 6502
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Apple II(1977)
Atari 2600(1977)
Atari 800(1979)
Intel 8080
MOS 6502 MOS 6502
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Apple II(1977)
Atari 2600(1977)
Atari 800(1979)
Atari 800XE(1985)
Intel 8080
MOS 6502 MOS 6502
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Apple II(1977)
Atari 2600(1977)
Atari 800(1979)
CommodoreZX Spectrum
Tesla PMD 85Intel 8080
MOS 6502
6502Zilog Z80
8080
Atari 800XE(1985)
MOS 6502
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Apple II(1977)
Atari 2600(1977)
Atari 800(1979)
Atari 800XE(1985)
IBM PC(1981)
CommodoreZX SpectrumIntel 8080
MOS 6502 MOS 6502
Intel 8088
Tesla PMD 85
6502Zilog Z80
8080
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Apple II(1977)
Atari 2600(1977)
Atari 800(1979)
Atari 800XE(1985)
IBM PC(1981)
PC2015
CommodoreZX SpectrumIntel 8080
MOS 6502 MOS 6502
Intel 8088 Intel i3/i5/i7
Tesla PMD 85
6502Zilog Z80
8080