Top Banner
CHARLES UNIVERSITY IN PRAGUE http://d3s.mff.cuni.cz/~jezek faculty of mathematics and physics Principles of Computers 9 th Lecture Pavel Ježek, Ph.D. [email protected]ff.cun i.cz
40

Principles of Computers 9th Lecture

Jan 08, 2018

Download

Documents

Anabel Baker

Inside RS-232 Ball & Wheel Mouse
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 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]

Page 2: Principles of Computers 9th Lecture

Inside RS-232 Ball & Wheel Mouse

Page 3: Principles of Computers 9th Lecture

Inside RS-232 Ball & Wheel Mouse (higher contrast for lecture)

Page 4: Principles of Computers 9th 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

Page 5: Principles of Computers 9th Lecture

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

HistoryUNIVAC(1951)

Page 33: Principles of Computers 9th Lecture

HistoryUNIVAC(1951)

Altair 8800(1974)

Intel 8080

Page 34: Principles of Computers 9th Lecture

HistoryUNIVAC(1951)

Altair 8800(1974)

Apple I(1976)

Intel 8080

MOS 6502

Page 35: Principles of Computers 9th Lecture

HistoryUNIVAC(1951)

Altair 8800(1974)

Apple I(1976)

Apple II(1977)

Intel 8080

MOS 6502

Page 36: Principles of Computers 9th Lecture

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

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

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

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

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