Track: By me composed! Xe-xe.. :)
Author: Macros, 14 July 2K1.
-----------------------------------------
Разъем клавиатур:
Со стороны контактов 5-контактная ро-
зетка DIN имеет нумерацию:
U u
3 1 6 | 5
o o
5 4 o o
2 4 3
> <
o o
2 1
Контроллер 8242B supports and inter-
PS/2-Mouse face.
Purpose of the keyboard controller registers
i8042
+===+--+--------------------------------+
|060|RW|Data port 8042 |
+---+--+--------------------------------+
|064|R |Status register 8042 |
| | |Bit 7 - parity error |
| | |Bit 6 - receiver timeout/ |
| | | general timeout* |
| | |Bit 5 - transmitter timeout/ |
| | | output buffer optional |
| | | body interface |
| | | full* |
| | |Bit 4 - 1=keypad locked |
| | |Bit 3 - 1=command, 0=data |
| | |Bit 2 - 0=Power ON, 1=Reset |
| | | OK - status completed |
| | | system reset |
| | |Bit 1 - 1=input buffer full, |
| | | 0=ready to receive |
| | | command/data |
| | |Bit 0 - 1=output buffer full |
+---+--+--------------------------------+
|064|W |Command register 8042 |
+===+--+--------------------------------+
*The second purpose of the bit relates to
controller 8242BB, which has additional
interface for connection
PS/2-Mouse.
Controller data register in download modewriting is used to issue commands from
rushing to the keyboard and actually
controller. A sign of readiness
controller to perceive commands is
zero value of bit 1 of the status register
niya (port 064h in PC)
General commands of the 8042 controller:
+-------------------------------------+
|DFh - enable control of line A20|
|DDh - disable control of line A20|
|D1h - writing to output port 8042 |
|DOh - reading output port 8042 |
|COh - read input port 8042 |
|AEh - keyboard resolution |
|ADh - keyboard prohibition |
|ACh - read controller RAM |
|ABh - synchronization and data test |
|AAh - internal controller test |
|60h - writing to the controller |
|20h - reading the controller |
+-------------------------------------+
AT keyboard control commands
FF - Reset - keyboard reset and test
FE - Resend - repeat the last transmission
FB-FD - Set Key Types - setting auto-
repeat individual keys
F7-FA - Set All Keys - operating system installation
Keyboard auto-repeat options
F6 - Set Default - reset to initial
scanning status and resolution
F5- Default Disable - reset to
initial
scan status and prohibition
F4 - Enable KB - the keyboard will respond
buy-
ACK volume and continue
scanning
F3 - Set Typical Rate/Delay - task
- delays and code repetition rates.
The subsequent data byte has
the following format:
- Bit 7=0
- Bits 6-5 - delay, ms
00 - 250
01 - 500
10 - 750
11 - 1000
- Bits 4-0=00-1Fh - repetition speed,
1/s:
00h=30.0 08h=15.0 OAh=12.0 12h=6.0
01h=26.7 09h=13.3 Och=10.0 14h=5.0
02h=24.0 05h=18.5 Odh=9.2 17h=4.0
03h=21.8 06h=17.1 Ofh=8.0 1ah=3.0
04h=20.0 07h=16.0 10h=7.5 1fh=2.0
F2 - Read ID Code - 2-byte request
ID.
EE - Echo - echo diagnostics: returns
K#EEh
ED - Set/Reset Mode Indicators - control
Keyboard indicators. I will follow-
current byte of data:
- Bit 0: 1=enable Scroll Lock
- Bit 1: 1=enable Num Lock - Bit 2: 1=enable Caps Lock
AD - scan prohibition
AE - scanning resolution
From the controller data register except
scan codes, it is possible to receive answers to
commands, key release code prefix
shi (F0) or special case codes:
FA - ACK - confirmation of command receipt
d AA - Test OK - internal test passed
ED - Diag. Failure - internal error
from the test
EE - Echo Response - response to
echo command 00,FF - Buffer Error -
buffer overflow or
unidentified key
BUS-mouse connector
1
>o o<
o o o o
o o o
9
+=========+=========+
| Contact | Signals |
+=========+=========+
| 1 | Vcc=5V |
| 2 | Xa |
| 3 | Xb |
| 4 | Ya |
| 5 | Yb |
| 6 | Lb |
| 7 | Mb |
| 8 | Rb |
| 9 | GND |
+---------+---------+
Active mice parcel format: 1200
bit/s, with one stop bit, without control
parity. Microsoft Mouse (PC-mouse) is used
uses 7 bits of data, and the Mouse System
Mouse (MS-mouse) - 8 bits. The mouse sends
packet every time the state changes.
Microsoft Mouse transfers 3 bytes, and
MS-Mouse - 5 bytes (see table). Here
bits X and Y - bits of relative movement
mouse movement since the previous sending.
Active mouse connectors:
+========+===========+============+
|Signal |Contact DB9|Contact DB25|
+========+===========+============+
| Data | 2 | 3 |
| GND | 5 | 7 |
| +V | 4.7 | 4.20 |
| -V | 3 | 9 |
+--------+-----------+------------+ Разъем DB9P: Разъем DB25P:
5 13
. 9 . 25
. .
. .
. .
. .
. .
. .
. .
. 6 .
.
1 .
.
. 14
1
Разъем DB9S Разъем DB25S
1 1
o 6 o 14
o o
o o
o o
o o
o o
o o
o o
o 9 o
5 o
o
o
o 25
13
На задней панели пц установлены следую-
щие разъёмы:
вилка DB9P COM-порт
розетка DB9S Mono, CGA, EGA
розетка DB15S(2рядн) Game, MIDI
розетка DB15S(Зрядн) VGA/SVGA
вилка DB25P COM-порт
socket DB25S LPT
Microsoft Mouse package format:
+=====+----+----+----+----+----+----+--+
|Bit | D6 | D5 | D4 | D3 | D2 | D1 |D0|
+-----+----+----+----+----+----+----+--+
|1byte| 1 | lb | rb | y7 | y6 | x7 |x6|
|2bytes| 0 | x5 | x4 | x3 | x2 | x1 |x0|
|Zbyte| 0 | y5 | y4 | y3 | y2 | y1 |y0|
+=====+----+----+----+----+----+----+--+
Mouse System Mouse package format
+======+----+---+----+---+---+---+--+--+
|Bit | D7| D6| D5 |D4 |D3 |D2 |D1|D0|
+------+----+---+----+---+---+---+--+--+
|1byte | 1 | 0 | 0 |0 |0 |lb |mb|rb|
|2bytes | x7| x6| x5 |x4 |x3 |x2 |x1|x0|
|Zbyte | y7| y6| y5 |y4 |y3 |y2 |y1|y0|
+------+----+---+----+---+---+---+--+--+
|Hbyte | matches byte 2 |
|Sbyte | matches byte 3 |
+======+---------------------------------+
PS/2-Mouse connector and interface is similar
6-pin mini-DIM keyboard connector.
6 u 5
o | o
4 o o 3
o o
2 > < 1
The PS/2 interface uses unipolar
signal with TTL levels, mouse power -
unipolar, 5 V. RS-232C interface,
used in active mice, using
There is a bipolar signal with trigger levels
+3 V and -3 V and requires
bipolar mouse nutrition.
The PS/2 interface uses two divided
nal signal lines, one for transmission,
the other is for synchronization signals.
Serial Mouse uses asynchronous
data transmission over one line.
Share your thoughts about the article