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
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
- 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
KEYBOARD ENCODER
bit 4~ bit 0typematic rate ± 20%bit 4~ bit 0typematic rate ± 20%