beautypg.com

Digilent Pegasus Board User Manual

Page 5

background image

Pegasus Reference Manual

Digilent, Inc. ™

www.digilentinc.com

Page

5

570ms). When releasing a key that was
pressed for more than 570ms, an “F0” key-up
code is sent, followed immediately by the key
scan code. If a key can be “shifted” to produce
a new character (like a capital letter), then the
shift character is sent before the key scan
code. Some keys, called extended keys, send
an “E0” ahead of the scan code (and they may
send more than one scan code). When an
extended key is released, an “E0 F0” key-up
code is sent, followed by the scan code.
Signals timings and scan codes for most keys
are shown in the figure below.

A host device can also send data to the
keyboard. Below is a short list of some often-
used commands.

ED

Set Num Lock, Caps Lock, and Scroll Lock
LEDs. After receiving an “ED”, the keyboard
returns an “FA”. Then the host sends a byte
to set LED status: bit 0 sets Scroll Lock, bit 1
sets Num Lock, and bit 2 sets Caps Lock.
Bits 3 to 7 are ignored.

EE

Echo. Upon receiving an echo command, the
keyboard replies with “EE”.

F3

Set scan code repeat rate. The keyboard
acknowledges receipt of an “F3” by returning
an “FA”, after which the host sends a second
byte to set the repeat rate.

FE

Resend. Upon receiving FE, the keyboard re-
sends the last scan code sent.

FF

Reset. Resets the keyboard.


The keyboard should send data to the host
only when both the data and clock lines are
high (or idle). Since the host is the “bus
master”, the keyboard should check to see
whether the host is sending data before driving
the bus. To facilitate this, the clock line can be
used as a “clear to send” signal. If the host
pulls the clock line low, the keyboard must not
send any data until the clock is released.

Mouse

The mouse outputs a clock and data signal
when it is moved; otherwise, these signals

remain at logic ‘1’. Each time the mouse is

'

0

'

start bit

'

1

'

stop bit

T

SU

T

HLD

DATA

CLK

Edge 0

Edge 10

T

CK

T

CK


T

C K

T

SU

Clock time

Data-to-clock setup time

30us

5us

50us

25us

Symbol

Parameter

Min

Max

T

HLD

Clock-to-data hold time

5us

25us


Timing for a two-byte

scan code

Scan code repeat timing

(key pressed and held)

~3.1ms

~570ms

~104ms

Figure 9. PS/2 timings