0% found this document useful (0 votes)
269 views10 pages

PS2 Keyboard Atmega32

The document discusses the PS/2 keyboard and mouse interface used in IBM PC compatible computers. It describes the PS/2 mini-DIN 6 connector used to connect keyboards and mice, and the synchronous serial communication protocol. Commands and codes are explained for communicating with keyboards from the host computer to read input and control settings like caps lock. The mouse protocol is also summarized, explaining the 3 byte packet format sent by the mouse.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
269 views10 pages

PS2 Keyboard Atmega32

The document discusses the PS/2 keyboard and mouse interface used in IBM PC compatible computers. It describes the PS/2 mini-DIN 6 connector used to connect keyboards and mice, and the synchronous serial communication protocol. Commands and codes are explained for communicating with keyboards from the host computer to read input and control settings like caps lock. The mouse protocol is also summarized, explaining the 3 byte packet format sent by the mouse.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

The PS/2 Keyboard and Mouse Interface

CSEE W4840
Prof. Stephen A. Edwards [email protected] Columbia University Spring 2011
The PS/2 Keyboard and Mouse Interface p.

The IBM PC/XT and /AT Keyboards

The PS/2 Keyboard and Mouse Interface p.

IBM PC Enhanced (101-key) Keyboar

Original keyboard connector: DIN-5

The PS/2 Keyboard and Mouse Interface p.

The PS/2 Mini-DIN 6 Connector

6 VCC = 4

5 = Clk 3 = GND

1 = Data 2 Female Socket


The PS/2 Keyboard and Mouse Interface p.

Synchronous Serial Interface

Clk

Start LSB B1 B2 B3 B4 B5 B6 MSB Parity Stop

Data

Like RS-232, but with a clock. Odd parity, one start, one stop. Keyboard-to-host shown: keyboard initiates everything.

The PS/2 Keyboard and Mouse Interface p.

Codes (Keyboard to Host)

00/FF Error or buffer overow F0 Key-up FA Acknowledge EE Echo response FE Resend E0 Extended code coming
The PS/2 Keyboard and Mouse Interface p.

Communicating to the Keyboard


Host-generated

Data
Clk
Start LSB B1 B2 B3 B4 B5 B6 MSB Parity Stop Ack Host-generated data

Keyboard-generated clock

Keyboard-generated

Host brings Clock low, then Data low to indicate transfer to keyboard, then releases Clock (rises). Keyboard starts generating clock signals. Host supplies serial data, changing after each falling edge. After stop bit, host releases Data. Keyboard pulls Data low for one more clock signal to indicate it received the byte.

The PS/2 Keyboard and Mouse Interface p.

Commands (Host to Keyboard)


ED LED control Caps lock Num lock Scroll lock EE Echo Keyboard will respond with EE F0 Set scan code set Keyboard will respond with FA and wait for another byte 0103. 00 leaves scan code unchanged. F3 Set key repeat rate Keyboard responds with FA and waits for second byte, indicating repeat rate.
The PS/2 Keyboard and Mouse Interface p.

Commands (Host to Keyboard)


F4 Enable keyboard Responds with FA, clears buffer, enables scanning. F5 Disable keyboard Responds with FA, disables keyboard. FE Resend Retransmit the last byte. FF Reset Keyboard

The PS/2 Keyboard and Mouse Interface p.

PS/2 Mouse Protocol


Three bytes sent every time mouse moves or button clicked: MSB LSB Y X Y X 1 Middle Right Left Overow Sign Buttons X movement Y movement Movement values are since last transmission: 9-bit twos-complement (signed) numbers. Many more variants, modes, and other junk.

The PS/2 Keyboard and Mouse Interface p. 1

You might also like