principles of computers 9th lecture
DESCRIPTION
Inside RS-232 Ball & Wheel MouseTRANSCRIPT
![Page 1: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/1.jpg)
CHARLES UNIVERSITY IN PRAGUE
http://d3s.mff.cuni.cz/~jezek
faculty of mathematics and physics
Principles of Computers9th Lecture
Pavel Ježek, [email protected]
![Page 2: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/2.jpg)
Inside RS-232 Ball & Wheel Mouse
![Page 3: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/3.jpg)
Inside RS-232 Ball & Wheel Mouse (higher contrast for lecture)
![Page 4: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/4.jpg)
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
![Page 5: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/5.jpg)
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
![Page 6: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/6.jpg)
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
![Page 7: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/7.jpg)
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
![Page 8: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/8.jpg)
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
![Page 9: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/9.jpg)
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
![Page 10: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/10.jpg)
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
![Page 11: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/11.jpg)
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
![Page 12: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/12.jpg)
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
![Page 13: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/13.jpg)
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
![Page 14: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/14.jpg)
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
![Page 15: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/15.jpg)
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
![Page 16: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/16.jpg)
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
![Page 17: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/17.jpg)
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
![Page 18: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/18.jpg)
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
![Page 19: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/19.jpg)
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
![Page 20: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/20.jpg)
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
![Page 21: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/21.jpg)
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
![Page 22: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/22.jpg)
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
![Page 23: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/23.jpg)
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
![Page 24: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/24.jpg)
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
![Page 25: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/25.jpg)
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
![Page 26: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/26.jpg)
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)
![Page 27: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/27.jpg)
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)
![Page 28: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/28.jpg)
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)
![Page 29: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/29.jpg)
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
![Page 30: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/30.jpg)
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
![Page 31: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/31.jpg)
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
![Page 32: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/32.jpg)
HistoryUNIVAC(1951)
![Page 33: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/33.jpg)
HistoryUNIVAC(1951)
Altair 8800(1974)
Intel 8080
![Page 34: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/34.jpg)
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Intel 8080
MOS 6502
![Page 35: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/35.jpg)
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Apple II(1977)
Intel 8080
MOS 6502
![Page 36: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/36.jpg)
HistoryUNIVAC(1951)
Altair 8800(1974)
Apple I(1976)
Apple II(1977)
Atari 2600(1977)
Atari 800(1979)
Intel 8080
MOS 6502 MOS 6502
![Page 37: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/37.jpg)
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
![Page 38: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/38.jpg)
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
![Page 39: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/39.jpg)
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
![Page 40: Principles of Computers 9th Lecture](https://reader033.vdocuments.us/reader033/viewer/2022052606/5a4d1af27f8b9ab05997f0d4/html5/thumbnails/40.jpg)
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