Principles of Computers 9th Lecture Pavel Ježek, Ph.D. pavel.jezek@d3s.mff.cuni.cz
Inside RS-232 Ball & Wheel Mouse
Inside RS-232 Ball & Wheel Mouse (higher contrast for lecture)
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 0 1 1 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 0 0 1 1 1 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 0 0 0 1 1 1 1 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 0 0 0 0 1 1 1 0 1 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 0 0 0 0 0 1 1 1 0 0 1 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 1 0 0 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 0 0 sensor 2 current value sensor 2 value history
Opto-mechanical Axis Sensors sensor 1 current value sensor 1 value history 0 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 0 0 0 sensor 2 current value sensor 2 value history
ball & wheel mouse logic registers (packet data) RS-232 Mouse Structure RS-232 data out RS-232 bus interface X axis Y axis ball & wheel mouse logic “magic” done via wiring registers (packet data) byte1 byte2 byte3 byte4 wheel Middle Button Right Button Left Button
RS-232 Mouse Firmware – Using GPIO Registers DATA OUT GPIO(0) X sensor 1 X sensor 2 Y sensor 1 Y sensor 2 W sensor 1 W sensor 2 RS-232 data out RS-232 bus interface X axis Y axis ball & wheel mouse logic “magic” done via wiring registers (packet data) byte1 byte2 byte3 byte4 wheel Middle Button GPIO(1) Middle Btn Right Btn Left Btn Right Button Left Button
RS-232 Mouse Firmware – Two Distinct Algorithms GPIO(2) DATA OUT GPIO(0) X sensor 1 X sensor 2 Y sensor 1 Y sensor 2 W sensor 1 W sensor 2 data (bit) transmit algorithm (B) RS-232 data out RS-232 bus interface X axis Y axis ball & wheel mouse logic gathering (measuring) input changes & calculating deltas algorithm (A) registers (packet data) byte1 byte2 byte3 byte4 wheel Middle Button GPIO(1) Middle Btn Right Btn Left Btn Right Button Left Button
gathering (measuring) input changes & calculating deltas algorithm (A) 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 OUT GPIO(0) X sensor 1 X sensor 2 Y sensor 1 Y sensor 2 W sensor 1 W sensor 2 RS-232 data out RS-232 bus interface byteId bitId X axis Y axis ball & wheel mouse logic gathering (measuring) input changes & calculating deltas algorithm (A) registers (packet data) byte1 byte2 byte3 byte4 wheel Middle Button GPIO(1) Middle Btn Right Btn Left Btn Right Button Left Button
ball & wheel mouse logic registers (packet data) Ball Mouse Firmware – Implementing Algorithm A (part 2) (IS NOT RS-232 Specific!) GPIO(2) DATA OUT GPIO(0) X sensor 1 X sensor 2 Y sensor 1 Y sensor 2 W sensor 1 W sensor 2 data (bit) transmit algorithm (B) RS-232 data out RS-232 bus interface X axis Y axis ball & wheel mouse logic registers (packet data) byte1 byte2 byte3 byte4 wheel Middle Button current change data x y w buttons GPIO(1) Middle Btn Right Btn Left Btn Right Button Left Button
ball & wheel mouse logic registers (packet data) Ball Mouse Firmware – Implementing Algorithm A (parts 1 & 2) (IS NOT RS-232 Specific!) GPIO(2) DATA OUT GPIO(0) X sensor 1 X sensor 2 Y sensor 1 Y sensor 2 W sensor 1 W sensor 2 data (bit) transmit algorithm (B) RS-232 data out RS-232 bus interface X axis Y axis ball & wheel mouse logic oldX oldY oldW newX newY newW registers (packet data) byte1 byte2 byte3 byte4 wheel Middle Button current change data x y w buttons GPIO(1) Middle Btn Right Btn Left Btn Right Button Left Button prevPacketButtons
RS-232 Mouse Firmware Structure (All Together) GPIO(2) DATA OUT GPIO(0) X sensor 1 X sensor 2 Y sensor 1 Y sensor 2 W sensor 1 W sensor 2 RS-232 data out RS-232 bus interface byteId bitId X axis Y axis ball & wheel mouse logic oldX oldY oldW newX newY newW registers (packet data) byte1 byte2 byte3 byte4 wheel Middle Button current change data x y w buttons GPIO(1) Middle Btn Right Btn Left Btn Right Button Left Button prevPacketButtons
RS-232 Mouse Firmware Algorithms GPIO(2) DATA OUT GPIO(0) X sensor 1 X sensor 2 Y sensor 1 Y sensor 2 W sensor 1 W sensor 2 data (bit) transmit algorithm RS-232 data out RS-232 bus interface byteId bitId X axis Y axis ball & wheel mouse logic oldX oldY oldW newX newY newW gathering (measuring) input changes & calculating deltas algorithm registers (packet data) byte1 byte2 byte3 byte4 wheel Middle Button current change data x y w buttons GPIO(1) Middle Btn Right Btn Left Btn Right Button Left Button prevPacketButtons
History UNIVAC (1951)
History UNIVAC (1951) Altair 8800 (1974) Intel 8080
History UNIVAC (1951) Altair 8800 (1974) Intel 8080 Apple I (1976) MOS 6502
History UNIVAC (1951) Altair 8800 (1974) Intel 8080 Apple I (1976) Apple II (1977) MOS 6502
History UNIVAC (1951) Altair 8800 (1974) Intel 8080 Apple I (1976) Apple II (1977) MOS 6502 MOS 6502 Atari 2600 (1977) Atari 800 (1979)
History UNIVAC (1951) Altair 8800 (1974) Intel 8080 Apple I (1976) Apple II (1977) MOS 6502 MOS 6502 Atari 2600 (1977) Atari 800 (1979) Atari 800XE (1985)
History UNIVAC (1951) Altair 8800 (1974) Commodore 6502 ZX Spectrum Zilog Z80 Intel 8080 Tesla PMD 85 8080 Apple I (1976) Apple II (1977) MOS 6502 MOS 6502 Atari 2600 (1977) Atari 800 (1979) Atari 800XE (1985)
History UNIVAC (1951) Altair 8800 (1974) Commodore 6502 ZX Spectrum Zilog Z80 Intel 8080 Tesla PMD 85 8080 Apple I (1976) Apple II (1977) MOS 6502 MOS 6502 Atari 2600 (1977) Atari 800 (1979) Atari 800XE (1985) IBM PC (1981) Intel 8088
History UNIVAC (1951) Altair 8800 (1974) Commodore 6502 ZX Spectrum Zilog Z80 Intel 8080 Tesla PMD 85 8080 Apple I (1976) Apple II (1977) MOS 6502 MOS 6502 Atari 2600 (1977) Atari 800 (1979) Atari 800XE (1985) IBM PC (1981) PC 2015 Intel 8088 Intel i3/i5/i7