The EM83049 microcontroller is dedicated to a keyboard encoder ,specially designed for IBM PC AT,XT and
all compatible machines. The EM83049 controll all scan codes, three LEDs status, scan timing and communications
between the keyboard and PC. It is easy to implement a high performance, low cost keyboard with the minimal
external components.
FEATURES
• Low cost - eliminate need external components.
• Phantom key detects.
• RC oscillator ( 1.8432MHz ).
• Support scan code set 1 ,2 and 3.
• Support PC AT,XT and PS/2 keyboard .
• Low power CMOS device technology.
• Internal pull-up resistor.
• Tri-state outputs for easy board application.
• 40 Pin DIP package.
• Built-in 4K ROM.
• Support WINDOWS
• 101/102/104 keys or other special application keyboard encoder.
• WINDOWS is registered trademarks of Microsoft corperation.
TM
keys.
EM83049
EM83049
KEYBOARD ENCODER
KEYBOARD ENCODER
APPLICATION
• IBM PC/AT,XT or compatible machine keyboard.
• IBM PS/2 model 30,50,60,80 or compatible machine keyboard.
OSCOOCLOCK output
OSCRIConnect 51K OHM resistor for 1.8432 MHz oscillation
XTI"1" or Floating=AT, "0"=XT, internal pull high.
I+5V Power Supply
EM83049
* This specification are subject to be changed without notice.
5.2.1997
2
Page 3
KEYBOARD ENCODER
FUNCTION DESCRIPTIONS
Keyboard buffer
The keyboard will buffer 16 bytes in a first-in-first-out order when the system is able to receive scan codes
from the keyboard. The response codes and repeated codes will not be buffered. If keystrokes generate a
multiple-byte sequence, the entire sequence must fit into the buffer or the keystroke is discarded and a bufferoverrun condition occurs.
Power-on Reset and self test
The duration of the keyboard Power-on-Reset(POR) should be within 150 milliseconds and 2 seconds after
the power is applied to the keyboard.
After executing POR , the keyboard executes a self test. The LEDs are turned on at the beginning and off at
the end of the self test. The self test takes a minimum 300 milliseconds and a maximum 500 milliseconds.
If the self test is successful, a completion code AA hex is sent to the system and the keyboard starts scanning.
If the self test fails, and error code is sent, the keyboard is disabled and waits for a command from the system.
The completion codes are sent between 450 milliseconds and 2.5 seconds after POR, and between 300 and
500 milliseconds after a RESET command is acknowledged.
EM83049
Keyboard data output
When the keyboard is ready to send data to the system, it first checks clock and data lines. If either one is in
the low state, data is stored in the keyboard buffer. If both are in the high state, keyboard starts clocking data
out. Data will be valid before the trailing edge and after the leading edge of the clock pulse. During the
transmission the keyboard checks the clock line at least every 60 microseconds . If the system lowers the clock
lines before the leading edge of the 10th clock, the keyboard should stop sending, then buffer the data and
return clock and data lines to high state.
Keyboard data input
When the system is ready to send data to the keyboard, it first checks clock line to see if keyboard is sending
data. If keyboard is not sending data or it is sending data but has not reached the 10th clock, the system can
inhibit the interface by forcing the clock line low for more than 60 microseconds and prepares to send data.
The keyboard checks clock line status at least every 5 milliseconds. If a system Request to Send(RTS) is
detected, the keyboard clocks 11 bits in. After the 10th bit, the keyboard checks for a high state in data line
then pulls it low and clocks one more bit to signal the system that data has been received. If data is low after
the 10th bit, it indicates a frame error. The keyboard should continue to count until data line goes high, then
pulls it low and issues a RESEND to the system.
Command from the system
The system can send commands to the keyboard at any time. The keyboard needs to respond within 20
milliseconds, unless the system prevents keyboard output, when doing self test or executing a RESET.
The following are the keyboard input commands and the actions that keyboard needs to take.
Set /Reset Status indicators ( Hex ED )
- Responds ACK.
- Receives option byte.
* This specification are subject to be changed without notice.
5.2.1997
3
Page 4
- Responds ACK.
- Updates status indicators.
- Returns to previous scanning state.
Echo ( Hex EEH )
- Responds with EE hex.
- Returns to previous scanning state.
Invalid commands ( Hex EF and F1 )
- Returns a RESEND command.
- Returns to previous scanning state.
Select Alternate Scan Codes ( Hex F0 )
- Responds ACK.
- Clears output buffer.
- Sets the default typematic rate/delay.
- Clears last typematic key.
- Receives option byte.
- Responds ACK.
- Option byte =
01 : selects scan code set 1
02 : selects scan code set 2
03 : selects scan code set 3
- Returns to previous scanning rate.
EM83049
KEYBOARD ENCODER
Read ID (F2)
- Responds with ACK.
- Discontinues scanning.
- Sends two ID bytes. The second byte will be sent within 500 uS after first byte.
- Resumes scanning.
Set Typematic Rate/Delay ( Hex F3 )
- Responds ACK.
- Receives rate/delay value byte
- Responds ACK.
- Set rate/delay (* Note 1)
- Returns to previous scanning state.
* Note 1
1. Repeat period = ( 8+A ) x ( 2B) x 0.00417 seconds
A : binary value of bits 2, 1, and 0.
B : binary value of bits 4 and 3.
2. Delay = ( C +1 ) x 250 milliseconds
C : binary value of bits 6 and 5. Bit 7 is always 0.
* This specification are subject to be changed without notice.
5.2.1997
4
Page 5
KEYBOARD ENCODER
bit 4~ bit 0typematic rate ± 20%bit 4~ bit 0typematic rate ± 20%
- Sets the default key type ( scan code set 3 only ).
- Set the default typematic rate/delay.
- Clears last typematic key.
- Stops scanning,
Set Default (Hex F6 )
- Responds with ACK.
- Resets all conditions to power-on state.
- Clears output buffer.
- Sets the default key type ( scan code set 3 only ).
- Set the default typematic rate/delay.
- Clears last typematic key.
- Continues scanning,
Set All Keys ( Hex F7,F8,F9,FA )
* This specification are subject to be changed without notice.
5.2.1997
5
Page 6
- Responds ACK.
- Clears output buffer.
- Sets all key type (affect only scan code set 3 operation).
F7 : Typematic
F8 : Make/Break
F9 : Make
FA : Typematic/Make/Break
- Returns to previous scanning rate.
Set Key Type ( Hex FB,FC,FD )
- Responds ACK.
- Clears output buffer.
- Receives key ID byte
- Responds ACK.
- Sets key ID type (affect only scan code set 3 operation).
FB : Typematic
FC : Make/Break
FD : Make
- Returns to previous scanning rate.
EM83049
KEYBOARD ENCODER
Resend ( Hex FE )
- Sends the previous output again. If the previous byte is RESEND, the last byte before RESEND shall be sent.
Reset ( Hex FF )
- Responds ACK.
- Checks clock and data lines - Reset in the high state for at least 500 microseconds or receives another command.
- Default to scan code set 2.
Command to the system
The following are the keyboard output commands.
Acknowledge ( Hex FA )
The keyboard sends an acknowledge in response to any valid command from the system except for RESEND
and ECHO.
BAT Completion Code ( Hex AA )
This command is issued after successful completion of keyboard self test.
Echo ( Hex EE )
The keyboard sends this code in response to an ECHO command.
* This specification are subject to be changed without notice.
5.2.1997
6
Page 7
EM83049
KEYBOARD ENCODER
Keyboards ID ( Hex 83AB )
The 2 byte ID is issued to respond to READ ID command. The low byte is sent first, followed by the high byte.
Keyboard buffer Overrun ( Hex 00 or FF )
If keyboard buffer overflows, the overrun code will replace the last byte in the buffer. If the keyboard is using
scan code set 1 , the code is hex FF. For sets 2 and 3, the code is hex 00.
Resend ( Hex FE )
When the keyboard receives an invalid input or any input with incorrect parity, the RESEND command is sent.
Keyboard Scan Code Table
The keyboard contains 3 scan code sets. The system defaults to scan code set 2, but can be switched to set 1 or
set 3 . The following tables show the key numbers and three scan code sets in hexadecimal values. All the keys
are typematics except for the pause key. When a key is pressed down, the make scan code is sent to the
system. When the key is released, its break code is sent. If two or more keys are held down, only the last key
pressed repeats at the typematic rate. Typematic operation stops when the last pressed key is released, even if
other keys are being released or some other keys are still held down.
The following table shows three scan code sets used in the keyboard.
@1 : 101-key keyboard only.
@2 : 102-key keyboard only.
@3 : If the left Shift key is held down, the AA/2A shift make and break is sent with the other scan codes.
If the right Shift key is held down, B6/36 is sent. If both Shift keys are down, both sets of codes are
sent with the other scan code.
@4 : This key is not typematic. All associated scan codes occur on the make of the key.
Key No.Scan Code Make/BreakShift Case Make/Break @7
95E0 4A / E0 F0 4AE0 F0 12 E0 4A / E0 F0 4A E0 12
Key No.Scan CodeCtrl Case, Shift CaseAlt Case
Make/BreakMake/ BreakMake/Break
124E0 12 E0 7CE0 7C / E0 F0 7C84 / F0 84
/ E0 F0 7C E0 F0 12
* This specification are subject to be changed without notice.
5.2.1997
10
Page 11
Key No.Make CodeCtrl Key Pressed
126 @8E1 14 77 E1 F0 14 F0 77E0 7E E0 F0 7E
Note .
@5 : 101-key keyboard only.
@6 : 102-key keyboard only.
@7 : If the left Shift key is held down, the F0 12/12 shift make and break is sent with the other scan codes.
If the right Shift key is held down, F0 59/59 is sent. If both Shift keys are down, both sets of codes
are sent with the other scan code.
@8 : This key is not typematic. All associated scan codes occur on the make of the key.
461AF0 1ATypematic
4722F0 22Typematic
4821F0 21Typematic
492AF0 2ATypematic
5032F0 32Typematic
5131F0 31Typematic
523AF0 3ATypematic
5341F0 41Typematic
5449F0 49Typematic
554AF0 4ATypematic
5759F0 59Make/Break
5811F0 11Make/Break
6019F0 19Make/Break
6129F0 29Typematic
6239 F0 39Make only
6458 F0 58Make only
7567F0 67Make only
7664F0 64Typematic
7961F0 61Typematic
806EF0 6EMake only
8165F0 65Make only
8363F0 63Typematic
8460F0 60Typematic
856FF0 6FMake only
866DF0 6DMake only
896AF0 6ATypematic
9076F0 76Make only
916CF0 6CMake only
926BF0 6BMake only
9369F0 69Make only
9577F0 77Make only
9675F0 75Make only
9773F0 73Make only
9872F0 72Make only
9970F0 70Make only
1007EF0 7EMake only
1017DF0 7DMake only
10274F0 74Make only
1037AF0 7AMake only
* This specification are subject to be changed without notice.
5.2.1997
12
Page 13
EM83049
KEYBOARD ENCODER
Key numberMake CodeBreak CodeDefault Key State
10471F0 71Make only
10584F0 84Make only
1067CF0 7CTypematic
10879F0 79Make only
11008F0 08Make only
11207F0 07Make only
1130FF0 0FMake only
11417F0 17Make only
1151FF0 1FMake only
11627F0 27Make only
1172FF0 2FMake only
11837F0 37Make only
1193FF0 3FMake only
12047F0 47Make only
1214FF0 4FMake only
12256F0 56Make only
1235EF0 5EMake only
12457F0 57Make only
1255FF0 5FMake only
12662F0 62Make only
Note .
@9 : 101-key keyboard only
@10 : 102-key keyboard only
New key codes for scan set 1:
New keyMakeBreak
LWINE05BE0DB
RWINE05CE0DC
APPE05DE0DD
N-CHG (131)7BFB
CHG (132)79F9
ROMA (133)70F0
0147DFD
05673F3
1077EFE
KLF1X
KRF0X
* This specification are subject to be changed without notice.
5.2.1997
13
Page 14
New key codes for scan set 2:
New keyMakeBreak
LWINE01FE0F01F
RWINE027E0F027
APPE02FE0F02F
N-CHG (131)67F067
CHG (132)64F064
ROMA (133)13F013
0146AF06A
05651F051
1076DF06D
KLF1X
KRF2X
New key codes for scan set 3:
EM83049
KEYBOARD ENCODER
New keyMakeBreak
LWIN8BF08B
RWIN8CF08C
APP8DF08D
N-CHG (131)85F085
CHG (132)86F086
ROMA (133)87F087
0145DF05D
05651F051
1077BF07B
KLF1X
KRF2X
* This specification are subject to be changed without notice.
5.2.1997
14
Page 15
EM83049
KEYBOARD ENCODER
126
120
112110
113
115114
119
118117116
123122121
125124
1
23 45
17
16
30
44
58
1
16
30
44
58
181920
3233
31
4647
60
112110
113
2345
17
181920
3233
31
4647
60
112110
113
2122
34
35
484950
115114
2122
34
35
484950
115114
876
9
23
24
36
37
51
52
61
11
10
26
25
39
38
53
27
41
40
55
54
62
29
28
43
57
64
15
13
12
Fig 1. The 101-key keyboard layout
120
119
118117116
12
876
9
23
24
36
37
51
52
61
11
10
26
25
39
38
53
27
41
40
55
54
62
123122121
15
13
28
43
42
57
64
Fig 2. The 102-key keyboard layout
120
119
118117116
123122121
75
76
75
76
85
86
89
126
89
126
90
91
92
93
85
90
86
91
92
93
80
81
83
8479
125124
80
81
83
8479
125124
100
101
102
103
104
103
100
101
102
104
105
106
108
105
106
108
95
96
97
98
99
95
96
97
98
99
2345
1
17
16
30
44
58
181920
31
4647
LWIN
3233
60
2122
34
35
484950
876
9
23
24
36
37
38
51
52
61
Fig 3. The 104-key keyboard layout
* This specification are subject to be changed without notice.
13
RWIN
15
28
42
APP
57
64
75
76
43
85
80
81
83
89
8479
90
86
91
92
93
99
100
95
101
96
102
97
103
98
104
5.2.1997
105
106
108
15
12
11
10
26
25
39
53
27
41
40
55
54
62
Page 16
ABSOLUTE MAXIMUM RATINGS
ParameterSym.Ratings
EM83049
KEYBOARD ENCODER
Supply VoltageV
Input VoltageV
Output VoltageV
Temperature under biasT
Storage temperatureT
CC
IN
OUT
B
S
-0.5V to +7V
-0.3V to +6V
-0.3V to +6V
0°C to 70°C
-65°C to 150°C
DC ELECTRICAL CHARACTERISTICS
ParameterSym.Min.Typ.Max.UnitCondition
Operating voltageV
Operating supply currentI
Input leakageI
Input high voltageV
Input low voltageV
Output high voltageV
Output low voltageV
Output low voltage for LEDSV
Internal Pull-high resistance ( port 6,9 )R
Internal Pull-high resistance forR
DATA, CLK
CCI
IL
PH1
PH2
4.555.5V
CC
3mAFosc=1.8432MHz
±1µAVIN=VCC ,V
2.0V
IH
IL
2.4VI
OH1
OL1
OL3
0.8V
0.4VIOL = 3.0 mA
3.2VIOL = 10 mA
4.710KΩ
1.52.23KΩ
= - 6.0 mA
OH
SS
AC ELECTRICAL CHARACTERISTICS
ParameterSym.Min.Typ.Max.Unit
Time from DATA transition to falling edge of CLKT1525µS
Time from rising edge of CLK to DATA transitionT25T4 - 5µS
Duration of CLK inactiveT3304050µS
Duration of CLK activeT4304050µS
Time to auxiliary device inhibit after clock 11 to ensureT550µS
the auxiliary device does not start another transmission
Time from inactive to active CLK transition, used to timeT6525µS
when auxiliary device samples DATA
System clockFCLK1.843MHz
* This specification are subject to be changed without notice.