EM84502
EM84502

PS/2 MOUSE CONTROLLER

PS/2 MOUSE CONTROLLER

GENERAL DESCRIPTION
The EM84502 Mouse Controller is specially designed to control PS/2 mouse device.This single chip caninterface three key-switches and four photo-couples direct to 8042. EM84502 can receive command and echo
status or data format which are compatible with IBM PS/2 mode mouse. Key debouncing circuit is provided
to prevent false entry and improve the accuracy.
In the conventional mouse, a great number of noises are generated when the grid is partially closed or opened.
These noise are usually mistaken for movement signals by conventional mouse controller and the cursor of thedispaly screen is thus moved frequently up and down or back and forth. This will consumes a great amount ofenergy.The EM84502 PS/2 mouse controller provides noise immunity circuits to eliminate these noisein order to reduce energy consumption.

FEATURES• Being compatiable with PS/2 mouse mode.
• Built-in noise immunity circuit.
• Low power dissipation.
• RC oscillation.
• Three key-switches and four photo-couples inputs.
• Both key-press and key-release debounce interval 12 ms.
• Through three key-switches input, EM84502 can exert seven different output.
• The motion detector of the EM84502 could sense 8 m/sec maximun with 200 DPI wheels.

APPLICATIONS• Optical mouse or pen-mouse.
• Mechanical mouse or pen-mouse.
• Optomechanical mouse or pen-mouse.
• Mechanical track ball.
• Optomechanical track ball.

PIN ASSIGNMENT
EM84502AP
VDD
OP
OSC.OUT
CLK
DATA
VSS
R

1
23
4
567

1413
12111098

OSCR
Y2
Y1
X2X1LM

EM84502AM
VDD
OP
OSC.OUTCLKDATA
VSS
R

EM84502BP
VDD
OP
NC
NC
OSC.OUTCLKDATA
VSS

12345678161514131211109OSCR
Y2
Y1X2X1L
M
R

1234567141312111098OSCR
Y2
Y1X2X1L
M

EM84502BM*
VDD
OP
NC
NC
OSC.OUT
CLK
DATA
VSS

12345678161514131211109

OSCR
Y2
Y1X2X1L
M
R* (Under developed)* This specification are subject to be changed without notice.

6.18.1998

1EM84502
PS/2 MOUSE CONTROLLERFUNCTIONAL BLOCK DIAGRAMOP
X1X2Y1Y2L
M
ROSCR
OSC OUT

DI

M E
O T
T E
I C
O T
N O
R

NMOM
I U
S N
E ITY

DE
B
OUNC
E

COUNTERTIMINGCONTROLLERSYSTEM
CLOCK
GENERATOR

DA
TA

CO
NVE
RTE
R

C D
O E
MC
MO
A D
N E
D R

DATA
I/O

DATA
CLK

PIN DESCRIPTIONS
Symbol
VDD
OP

I/O
I

OSCOUT
CLK
DATA
VSS
R
M
L

X1
X2
Y1
Y2
OSCR

O
I/O
I/O
I

I

I

FunctionPower
X, Y inputs.
Floating : Comparator input.
GND : Schmitt trigger input.
Short to OSC OUT : Testing Mode.
Clock output.
8042 auxiliary port CLK line.
8042 auxiliary port DATA line.
GroundThree key-switches exert seven different combinations totally. Both key-pressed
and key-released signals will be sent accomplanied with horizontal and verticalstate. The status of the key-switches will be preserved, whenever the value ofhorizontal or vertical counters will present at DATA. And the debounce interval
for both key-press and key-release is 12 ms.
Four photo-couple signals denote UP, DOWN, LEFT, and RIGHT state.
During the scaning period, as long as the photo-couples change their states, thevalue of vertical or horizontal counter will increase or decrease accordingly.
30 Kohm ±5% pull low for 35 KHz oscillation.

FUNCTION DESCRIPTIONSA) Operating mode
There are four operating modes in PS/2 mouse:i). Reset Mode:In this mode a self-test is initiated during power-on or by a Reset command. After reset signal, PS/2
mouse will send:1). Completion code AA & ID code 00.

* This specification are subject to be changed without notice.

6.18.1998

2EM84502
PS/2 MOUSE CONTROLLER

2). Set default:
sampling rate: 100 reports/s
non-autospeed
stream mode
2 dot/countdisableii). Stream Mode:
The maximum rate of transfer is the programmed sample rate.
Data report is transmitted if1). switch is pressed2). movement has been detectiii). Remote Mode:
Data is transmitted only in response to a Read Data command.
iv). Wrap Mode:Any byte of data sent by the system, except hex EC ( Reset wrap mode ) or hex FF ( Reset ), is returned
by EM84502.
B). PS/2 Mouse Data Report:i). In stream mode: A data report is sent at the end of a sample interval.
ii). In remote mode: A data report is sent in response to Read Data command.
iii). Data report format:
Byte
123Bit012345670-70-7Description
Left button status; 1 = pressed
Right button status; 1 = pressed
Middle button status; 1 = pressed
Reserve
X data sign; 1 = negative
Y data sign; 1 = negative
X data overflow; 1 = overflow
Y data overflow; 1 = overflow
X data ( D0 - D7 )Y data ( D0 - D7 )C) PS/2 mouse Data Transmission:i). EM84502 generates the clocking signal when sending data to and receiving data from the system.
ii). The system requests EM84502 receive system data output by forcing the DATA line to an inactive
level and allowing CLK line to go to an active level.
iii). Data transmission frame:* This specification are subject to be changed without notice.

6.18.1998

3EM84502
PS/2 MOUSE CONTROLLER

Bit
12-9
1011

FunctionStart bit ( always 0 )Data bits ( D0 - D7 )Parity bit ( odd parity )Stop bit ( always 1 )iv). Data Output ( data from EM84502 to system ):If CLK is low ( inhibit status ) , data is no transmission.
If CLK is high and DATA is low ( request-to-send ), data is updated. Data is received from the systemand no transmission are started by EM84502 until CLK and DATA both high. If CLK and DATA are bothhigh, the transmission is ready. DATA is valid prior to the falling edge of CLK and beyond the rising edgeof CLK. During transmission, EM84502 check for line contention by checking for an inactive level on CLKat intervals not to exceed 100u sec. Contention occurs when the system lowers CLK to inhibit EM84502
output after EM84502 has started a transmission. If this occurs before the rising edge of the tenth clock,EM84502 internal store its data in its buffer and returns DATA and CLK to an active level. If the contention
does not occur by the tenth clock, the transmission is complete.
Following a transmission, the system inhibits EM84502 by holding CLK low until it can service the input
or until the system receives a request to send a response from EM84502.
v). Data Input ( from system to EM84502 ):System first check if EM84502 is transmitting data. If EM84502 is transmitting, the system can override
the output forcing CLK to an inactive level prior to the tenth clock. If EM84502 transmission is beyond
the tenth clock, the system receives the data. If EM84502 is not transmitting or if the system choose tooverride the output, the system force CLK to an inactive level for a period of not less than 100µ sec while
preparing for output. When the system is ready to output start bit (0), it allows CLK go to active level. If
request-to-send is detected, EM84502 clocks 11 bits. Following the tenth clock EM84502 checks foran active level on the DATA line, and if found, force DATA low , and clock once more. If occurs framingerror, EM84502 continue to clock until DATA is high, then clocks the line control bit and request aResend. When the system sends out a command or data transmission that requires a response, the system
waits for EM84502 to response before sending its next output.
D). PS/2 Mouse Error Handling:i). A Resend command ( FE ) following receipt of an invalid input or any input with incorrect parity.
ii). If two invalid input are received in succession, an error code of hex FC send to the system.
iii). The counter accumulators are cleared after receiving any command except “Resend”.
iv). EM84501 receives a Resend command ( FE ), it transmit its last packet of data.
v). In the stream mode “Resend” is received by EM84502 following a 3-byte data packet transmission
to the system. EM84502 resend the 3-byte data packet prior to clearing the counter.
vi). A response is sent within 25 ms if* This specification are subject to be changed without notice.

6.18.1998

4EM84502
PS/2 MOUSE CONTROLLERa). The system requires a responseb). An error is detected in the transmissionvii). When a command requiring a response is issued by the system ,another command should not be issue
until either the response is received or 25ms has passed.
E). PS/2 Mouse Commands Description:
There are 16 valid commands that transmits between the system and EM84502. The “FA” code is always thefirst response to any valid input received from the system other than a Set Wrap Mode or Resend command.
The following table list the commands:
Hex CodeFFFE
F6F5F4F3,XX
F2F0EEEC
EB
EA
E9E8,XX
E7E6CommandResetResend
Set Default
DisableEnable
Set Sampling Rate
Read Device TypeSet Remote Mode
Set Wrap Mode
Reset Wrap Mode
Read Data
Set Stream Mode
Status Request
Set Resolution
Set Autospeed
Reset Autospeed

EM84502 echo code
FA,AA,00
XX,(XX,XX)
FA
FA
FA
FA,FA
FA,00
FA
FA
FA
FA,XX,XX,XX
FA
FA,XX,XX,XX
FA,FA
FA
FA

The following describes valid commands:a). Reset ( FF )EM84502 operation:i). Completion the reset.
ii). Transmitted FA,AA,00 to the system.
iii). Set default:
sampling rate: 100 reports/s
non-autospeed
stream mode
2 dots/countdisableb). Resend ( FE )i). Any time EM84502 receives an invalid command, it returns a Resend command to the system.
ii). When EM84502 receives a Resend command, it retransmits its last packet of data. If the last packet wasa Resend command, it transmits the packet just prior to the Resend command.
iii). In stream mode, if a Resend command is received by EM84502 immediately following a 3-byte data
packet transmission to the system.

* This specification are subject to be changed without notice.

6.18.1998

5EM84502
PS/2 MOUSE CONTROLLERc). Set Default ( F6 )The command reinitializes all conditions to the power-on defaults.
d). Disable ( F5 )This command is used in the stream mode to stop transmissions from EM84502.
e). Enable ( F4 )Begins transmissions, if in stream mode.
f). Set Sampling Rate ( F3,XX )In the stream mode, this command sets the sampling rate to the value indicated by byte hex XX,
shown in following:
Second byte XX0A
1428
3C
50
64
C8Sample Rate
10/sec20/sec40/sec
60/sec80/sec100/sec
200/secg). Read Device Type ( F2 )EM84502 always echoes “ FA,00 “ following this command.
h). Set Remote Mode ( F0 )Data value are reported only in response to a Read Data command.
i). Set Wrap Mode ( EE )Wrap mode remains until Reset ( FF ) or Reset Wrap Mode( EC ) is received.
j). Reset Wrap Mode ( EC )EM84502 returns to the previous mode of operation after receiving this command.
k). Read Data ( EB )This command is executed in either remote or stream mode. The data is transmitted even if there has been
no movement since the last report or the button status is unchanged. Following a Read Data command,
the registers are cleared after a data transmission.
l). Set Stream Mode ( EA )This command sets EM84502 in stream mode.
m). Status Request ( E9 )When this command is issued by the system, EM84502 respond with a 3-byte status report as follows:
Byte
1Bit
0
1
2

Description
1 = Right button pressed
1 = Middle button pressed
1 = Left button pressed* This specification are subject to be changed without notice.

6.18.1998

6EM84502PS/2 MOUSE CONTROLLER

23345670-70-7Reserved
0 = Normal speed, 1 = Autospeed
0 = Disabled, 1 = Enabled
0 = Stream mode, 1 = Remote mode
Reserved
Current resolution setting ( D0 - D7 )Current sampling rate ( D0 - D7 )n). Set Resolution ( E8,XX )EM84502 provides four resolutions selected by the second byte of this command as follows:
Second Byte XX00
010203

Resolution
8 dot/count4 dot/count2 dot/count1 dot/counto). Set Autospeed ( E7 )At the end of a sample interval in the stream mode, the current X and Y data values are converted new values.
The sign bits are not involved in this conversion. The conversion is only in stream mode. The relationshipbetween the input and output count follows:
Input
01
2
3
45N(≥6 )

Ouput
01
1
3
6
92.0*Np). Reset Autospeed ( E6 )This command restore normal speed.
F) Testing mode
Whenever OPT is connected to OSC OUT, the chip will enter buyer's testing mode. The X direction output
signals of comparators will present to L and M pin. Pressing "R" key can toggle the output from X direction
to Y direction.

ABSOLUTE MAXIMUM RATINGS
Parameter
Temperature under bias
Storage temperature range
Input voltage
Output voltage

Sym.
TOPRTSTR
VINVO* This specification are subject to be changed without notice.

Ratings
0~70-65~150-0.3~6.0-0.3~6.0

Unit°C°C
VV
6.18.1998

7

EM84502
PS/2 MOUSE CONTROLLER

DC ELECTRICAL CHARACTERISTICS (TA=25°C to 70°C)
Parameters
Operating voltage
Operating current(no load)
X,X2,Y1,Y2 low input reference current
X,X2,Y1,Y2 high input reference currentX,X2,Y1,Y2 input current
Schmitt trigger input(76µA)
X,X2,Y1,Y2 input current
Comparator input(80µA)
X,X2,Y1,Y2 input current
Comparator input(500µA)
CLK, DATA postive-goingthreshold voltage
CLK, DATA negative-goingthreshold voltage
Low input voltage, other pins
High input voltage, other pins
L, M, R input current(pull low resistor Vin=5V)
PS/2 mouse mode DATA, CLK input Current(pull up resistor)(VIN=0V)
PS/2 mouse mode DATA, CLK low output voltage(Iprl=-2mA)
L, M, R, X1, X2, Y1, Y2 input leakage current(Vin=0V)

Sym.

Min.

Typ.

Max.

Unit

VDD
IOp
IPL
IPh
VPI

4.5
70
0.85-

5.5
1.2
106
1.2

V
mA
µA
µA
V

VPI

0.8-

1.2

V

VPI

1.5-

2.1

V

Vt+

3.2

-

3.8

V

Vt -

1.2

-

1.9

V

Vail
VaihImi

3.5
16.6-

1.5
50

V
V
µA

Idc

0.56-

1.86

mA

Vprl--

0.4

V

Iil0-

1.0

µA

* All voltages in above table are compared with VSS.
* All parameters in above table are tested under VDD=5V.
* CLK & DATA output gates are open drains that connect to pull up resistors.
* X1, X2,Y1,T2 Input Impedance
MAX.

16.0K
15.0K
14.0K

TYP.

13.0K
12.0K

MIN.

11.0K
10.0.K
9.0K
8.0K
7.0K
6.0K
5.0K
4.0K
3.0K
2.0K
1.0K
0

1.0
10.0M

* This specification are subject to be changed without notice.

2.0

3.0

4.0

5.0

VOLTS (LIN)

6.18.1998

8

EM84502
PS/2 MOUSE CONTROLLER

AC ELECTRICAL CHARACTERISTICS (TA=0°C to 70°C)
Parameters
Oscillating Frequency
Key Debounce
Rising Edge Crossed Width Fosc=35 KHz
Falling Edge Crossed Width Fosc=35 KHz
Mouse CLK Active Time
Mouse CLK Inactive Time
Mouse Sample DATA from
CLK rising Edge
System CLK Active Time
System CLK Inactive TimeTime from DATA Transition to Falling Edge of CLKTime from rising Edge of CLK to DATA Transition
Time to mouse Inhibit after the 11th CLK toensure mouse does not start another Transmission

Sym.

Min.

Typ.

Max.

Unit

Fosc
Tkd
Tr
Tf
Tmca
Tmci
Tmdc

34.3-10%
14.3
14.3
-34.3
1242.942.9
14.3

34.3+10%
-KHz
msus
us
us
us
us

Tsca
Tsci
Tsdc
Tscd
Tpi042.9
42.9
14.3
28.6-50us
us
us
us
us

PS. The AC timings are measured under using 35 KHz system clock signal.

TIMING DIAGRAM(1) Photo-couples pulse width :X1 (Y1)X2 (Y2)TfTr(2) PS/2 Mouse(A) Receiving DATA
1st
CLK

Inhibit

2nd
CLK

9th
CLK

10th
CLK

11th
CLK

CLK>
>

<Tmca<>•••••<Tmci

Tmdc
DATA
Start
Bit

•••••••••
Bit0 -Bit7••••••••ParityBit* This specification are subject to be changed without notice.

StopBitLineControlBit••

6.18.1998

9EM84502
PS/2 MOUSE CONTROLLER(B) Sending DATA
1stCLK

2nd
CLK

10th
CLK

11th
CLK

CLK>

<Tsci><Tsdc>>•••••••••••<>

Tsca<<Tpi

Tscd

DATA

•••••••••StartBit••••••••ParityBit

Bit0 -Bit7•••••••••Stop
Bit

AC Timing point:
Output:DATA,
CLK PIN (PS/2 mouse mode)

VDD -2.6

V

SS+0.448.4 µA
+1.6V
µA
V39.6
SS

Input:
X1,X2,Y1,Y2 PIN

VDD -0.8
CLK, DATA PIN

V

SS

L,M,R PIN

+0.8
VDD
VSS

EM84502 I/O pin equivalent circuit :R,M,L :DATA :
VCC(R,M,L)(R,M,L)
INTERNAL SIGNALVCCDATAPS2 MOUSE ENABLE
DATA OUTPUT SIGNALDATA INPUT SIGNAL

CLK :X1,X2,Y1,Y2 :X1,X2,Y1,Y2-VCC+PHASE DIGITAL SIGNAL

VCC

13.2K
12.5K

VDD

VDD

PS2 MOUSE ENABLE
CLK
CLK OUTPUT SIGNAL
VDD
4CLK INPUT SIGNAL+-80µA

30K* This specification are subject to be changed without notice.

13.2K
12.5K

6.18.1998

10EM84502
PS/2 MOUSE CONTROLLER

78M

RVSS
69L
DATA

510EM84502A
CLK4* This specification are subject to be changed without notice.

GROUNDDATA

CLK30K

3X111X212Y1OSC.OUT

13Y2OSC.DR

OP

214

1EM84501 VDD

PS/2 MOUSE ONLY

510

510

10µf+5V

APPLICATION CIRCUIT

6.18.1998

11EM84502
PS/2 MOUSE CONTROLLER

14 PDIP

E11D

F
15°(2X)
E1C

A
A15°(2X)

L115°(4X)

L
ϑ
B
B1eeB

InchesSymbol
A
A1B
B1C
D
E1F
L
L1eeB
ϑ

MIN.
.059
.740
.259
.290
.345
0°

TYP.
.130
.060
.018
.060
.010
.750
.260
.300
.130.020
.100
.355
7.5°

Milimeters
MAX.
.061
.760
.310
.365
15°

* This specification are subject to be changed without notice.

MIN.
1.499
18.796
6.579
7.366
8.763
0°

TYP.
3.302
1.524
0.457
1.524
0.254
19.050
6.604
7.620
3.302
0.506
2.540
9.017
7.5°

MAX.
1.549
19304
7.874
9.271
15°

6.18.1998

12