NC
PINH
VX
NC
IRQ
RESET
VCC
OSCI
OSC0
EKC1
NC
RP
NC
NC
EKC
EKD
DR
PD0
PD1
PD2
PD3
PD4
ID4
NC
ID3
ID2
ID1
RTS
TXD
RXD
CTS
NC
SW5
NC
PD5
PD6
PD7
GND
NC
SW0
SW1
SW2
SW3
SW4
40
1
6
7
12
1718 23 28
29
34
39
PLCC
product specifications
Interpreter UR6HCPCS
PS/2 Keyboard to RS232/Parallel
Protocol Interpreter
Interpreter UR6HCPCS
USAR DATA BOOK 1994
Description
The UR6HCPCS is an easy-to-use
single chip protocol interpreter that can
link a AT/PS2-compatible User Input
Device (UID), such as a keyboard,
mouse, bar-code reader, etc., to any
host system equipped with a serial or
parallel port. The UR6HCPCS emulates
all the functions of the 8042 keyboard
controller which typically resides on the
AT/PS2 motherboard. In addition, the
protocol interpreter implements all
levels of the keyboard BIOS protocol
that handles two-way communication
with the keyboard, performs error
detection and elimination, and can
translate all scan code information into
an ASCII format understandable to
application programs.
The UR6HCPCS also supports a set of
commands from the host system that
can be used to control communication
and functional characteristics of the
UID. In a single chip, the UR6HCPCS
offers the input device functionality
previously achieved only by utilizing
several ICs and BIOS modules set on a
AT/PS2 motherboard.
127
The UR6HCPCS is ideal for proprietary system designs needing to interface PC-
compatible UIDs for data entry purposes.
Because the UR6HCPCS allows any system with a serial or parallel port to interface
inexpensive, off-the-shelf UIDs without regards to that system’s architecture or
firmware, system designers and integrators can achieve maximum data entry
performance without needing to spend the development time and costs associated
with custom input device designs.
As the UR6HCPCS implements all levels of input device protocol, no complicated
software drivers are needed - translating in further savings for the system developer.
The UR6HCPCS is also highly suitable for use in systems where multiple, concurrently
operable UIDs are needed, such as Point of Sales Terminals, multi-user systems,
industrial control systems, etc.
Features
PC Keyboard Emulation Port Auto repeat or single action mode
Full-duplex Serial interface (RS232) Single chip solution
Strobed Parallel Output Port HCMOS Technology
Pass-Through or ASCII Translation Mode 40 pin DIP or 44 pin PLCC packages
Jumper selectable baud rate
Applications
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
RESET
IRQ
VX
PINH
NC
RP
NC
NC
EKC
EKD
DR
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PD7
VSS
VCC
OSCI
OSCO
EKC1
ID4
NC
ID3
ID2
ID1
RTS
TXD
RXD
CTS
NC
SW5
SW4
SW3
SW2
SW1
SW0
DIP
Pin Configurations
USAR DATA BOOK 1994
UR6HCPCS
product specifications
128
Ordering Code
RTS
Baud Rate
Selection
Mode Control
Keyboard
Controller
Emulation
Port
(8042)
Serial
Communication
Port
Parallel
Output
Port
EKD EKC EKC1
SW1 SW2 SW3SW4 SW5
PD0
PD1
PD2
PD3
PD4
PD5
PD6
Rx
Tx
CTS
PD7
IRQ
Reset
DR
UR6HCPCS
T0 PS2 Compatible Device
Configuration Pins
Oscillator
Circuit
OSCO
OSCI
Serial Port
Parallel Port
PACKAGES TA = 0°C TO +70°C TA = -40°C TO +85°C
40 pin, Plastic DIP UR6HCPCS-P UR6HCPCS-CP
44 pin, Plastic PLCC UR6HCPCS-FN UR6HCPCS-CFN
Block Diagram
USAR DATA BOOK 1994
product specifications
UR6HCPCS
129
Keyboard Input Port
The UR6HCPCS provides a fully
functional keyboard controller (8042)
emulation port. Keyboard-compatible
devices connected to this port will
receive all the signals, commands and
responses as if they were connected to
a PS/2-compatible system. Furthermore,
when the UR6HCPCS is set in the ASCII
mode, it will perform all the BIOS
functions necessary to interface the
input device all the way up to the
application level. If, for example, the
user presses the Num Lock key, the IC
will set the NumLock LED properly and
will start interpreting scan codes into
their capital ASCII equivalent.
Communication with the keyboard-
compatible device is achieved through
the EKC, EKC1 and EKD Lines.
EKC and EKC1 are both connected to
the Clock Line of the keyboard-
compatible device. EKD is connected to
the Data Line.
Upon power-on, the UR6HCPCS will set
the keyboard to the default Scan Code
Set 2, which is the most widely
supported mode for AT keyboards.
Output Modes
The UR6HCPS provides two output
modes: Strobed Parallel and Serial.
Data from the keyboard-compatible
device is presented simultaneously on
both the parallel and the serial output
ports. The serial port also supports
bidirectional communication between
the host system and the keyboard.
Parallel Output Mode
In this mode the UR6HCPCS provides a
Strobed Parallel Output of the equivalent
ASCII data input entered from the
keyboard-compatible device. The DR
Output Line provides an active low
signal to the host whenever new data is
present on the output port. The host
system can disable the DR line by
holding the PINH line low. For parallel
output, RTS and CTS should be tied
together.
Pin Description
Pin Number
Mnemonic DIP PLCC TYPE NAME AND FUNCTION
Vcc 40 44 I PPoowweerr SSuuppppllyy::+5V.
Vss 20 22 I GGrroouunndd
OSCI 39 43 I OOsscciillllaattoorr IInnppuutt//OOuuttppuutt::these pins
OSCO 38 42 O provide input for an on-chip clock
oscillator circuit. A 4MHZ crystal or
ceramic resonator or an external signal
(OSCI) connects to these pins providing
the converter clock.
RST 1 1 I RReesseett::used to reset the converter to the
default start-up state. The reset signal is
active low.
EKC 9 10 I/O These three open collector bidirectional
EKC1 37 41 I/O pins implement the electrical interface
EKD 10 11 I/O with the keyboard-compatible device.
EKD is connected to the Data Line, while
both EKC and EKC1 are connected to
the Clock Line of the keyboard
compatible device.
TxD 30 33 I/O These four pins implement the RS232
RxD 29 32 I/O Protocol. TxD and RxD are used to
CTS 28 31 O Transmit data in an NRZ format.
RTS 31 34 I CTS (Clear to Send) is an output pin.
When it is high, data can be transferred
to the converter from the host. RTS
(Request to Send) is an active low signal
input. A high level on this pin prohibits
the converter from sending data to the
host.
SW0 21 24 RReesseerrvveedd::for future applications.
SW1-SW5 22-26 25-29 I The SW1-SW3 input pins are used to
select the baud rate of the serial
transmission. SW4 input selects Pass-
Through or ASCII Ttranslation Mode.
SW5 determines whether keys will be
repeating or not.
PD0-PD4 12-16 13-17 O These seven output lines comprise the
PD5-PD7 17-19 19-21 Parallel Output Port.
DR 11 12 O DDaattaa RReeaaddyy::an active low output pin that
is sued to signal the host system when
new data is present on the Parallel
Output Port.
PINH 4 5 I An active low input pin that can be used
to inhibit the DR Line from going low,
disabling communications for both serial
and parallel port.
ID1-ID4 32-34, 35-37, I DDeevviiccee iiddeennttiittyy ppiinnss::reserved.
USAR DATA BOOK 1994
UR6HCPCS
product specifications
130
PD0-PD7
DR
td
PINH tl tb
Characteristic Symbol Minimum Type Maximum Unit
Data Ready to DR strobe td1 2 us
DR low tl1* ms
Parallel Output Port TimingSerial Output Mode
The UR6HCPCS provides a full-duplex
bidirectional serial port to exchange
command and data information with the
host system. The serial port has two
functional modes of operation: the Pass-
Through and the ASCII Modes. In the
Pass-Through Mode, scan code data is
passed to the host system without any
translation. In the ASCII Mode, scan
code data from the keyboard-compatible
device is translated into the equivalent
extended ASCII characters. In both
modes, the default repeat action of keys
is either determined during power-on or
after a reset command, by the setting of
pin SW5, as shown in Table 1.
The RTS and CTS pins can be used to
control traffic flow between the host and
the system. A high level on the RTS
input indicates that the host is
requesting data from the converter.
A low signal on this pin will inhibit the
converter from sending data to the host.
CTS is an output pin, normally in a high
state, indicating that the converter is
ready to accept data from the host.
Use of these two lines is optional.
Typematic Control
The repeating action of key input from
the keyboard-compatible device can be
enabled or disabled by switch SW5.
Table 1: Repeat Action Control
SW5 Action
0Repeat enable
1 Repeat disable
Data Format
The NRZ data format in the serial mode
is one start bit, 8 data bits, no parity and
one stop bit. The signals are at HCMOS
levels. A level converter, such as the
Maxim 232, can be used to convert the
Tx and Rx signals into RS232 levels, if
that is required for off board
connections. The data format is shown
in Figure 2.
Figure 2: Serial Data Format
Baud Rate Selection
The Baud rate of communication is
selected through the SW1-SW3 bank of
switches, as shown below.
Table 2: Baud Rate Selection
Higher baud rates are recommended
whenever possible in order to avoid data
loss from a high throughput keyboard-
compatible devices.
SW1 SW2 SW3 Baud Rate
0 0 0 300
0 0 1 1200
0 1 0 2400
0 1 2 3 4 5 6 7
Start
bit
Stop
bit
Next
start bit
Power-on Defaults
After power on, the converter is set with
the following status:
Scan code mode (SW4=0).
ASCII mode (SW4=1).
Repeat enable (SW5=0).
Repeat disable (SW5=1).
Reset the baud rate according to the
switch settings.
Keyboard uses Scan Set 2.
If in the ASCII mode, the Num Lock
LED is on and the Caps Lock and
Scroll Lock are off.
Typematic rate and delay are both
default settings of the external
keyboard, and are usually set with
a10cps and 500ms initial delay.
Mode Selection During Power-on
ASCII or Pass-Through Mode of
operation is determined during power-on
by the setting of SW4. The mode can
also be changed dynamically by a
command from the host system.
Table 3: Mode Selection
SW1 Mode
0Pass-Through
1 ASCII
USAR DATA BOOK 1994
product specifications
UR6HCPCS
131
Commands from the System
In serial mode, the UR6HCPCS supports
the following set of commands issued by
the system.
Commands Supported in Both ASCII and
Pass-Through Mode
The following table lists the commands
from the system supported in both the
ASCII and Pass-Through Modes:
Table 4: Commands Supported in Both the
ASCII and Pass-Through Modes
Software Reset
The reset command (Hex FF) resets
everything just as power-on does,
except the baud rate. If the default
mode is the Pass-Through Mode
(SW4=0), then the UR6HCPCS will
respond with a BAT completion code
(Hex AA), the same as after power-on.
Set Default and Default Disable Command
Set Default Command will set default key
types (affects Scan Set 3 operation only)
and typematic rate/delay.
Commands in ASCII Mode Only
The following set of commands is
supported only in ASCII Mode.
Table 5: Commands Supported in ASCII Mode
Only
Hex Code Command
EC Disable repeat
EA Enable repeat
Hex Code Command
FF Reset
F6 Set default
F5 Default disable
F4 Enable
E7 Set ASCII mode
E6 Set Scan Code mode
Commands in Pass-Through Mode Only 1
The following set of commands is
supported only when the UR6HCPCS is
set in pass-through mode. These
commands correspond to the AT/PS2 set
of commands. A detailed description
can be found in the IBM Technical
Reference Manual.
Table 6: Commands Supported in Pass-Through
Mode Only
1. These commands are part of the standard AT/PS2
keyboard protocol. Some keyboard-compatible
devices may not support all of them. Please check
your device manual for more details.
2. The keyboard responds with ACK, but affects only
the operation of Scan Code Set 3
Hex Code Command
FE Resend
FD Set key make
FC Set key make/break2
FB Set key typematic2
FA Set all key typematic/
make/break2
F9 Set all key make2
F8 Set all key make/
break2
F7 Set all key typematic2
F3 Set typematic rate/
delay
F2 Read ID
F1 Invalid command
F0 Select alternate scan
codes
EF Invalid command
EE Echo
ED Set/Reset status
indicators
Acknowledge (Hex FA):
The keyboard responds to the system
with an Acknowledge (ACK) for any valid
input other than an Echo and Resend
command.
Special Commands in Pass-Through Mode
Only
The following commands to the system
are supported in Pass-Through Mode
only. They correspond one to one to the
set of commands from the keyboard in
the AT/PS2 protocol. A detailed
description can be found in the IBM
Technical Reference Manual.
Table 7: Special Commands Supported in
Pass-Through Mode Only
Hex Code Command
FF Key detection error/
overrun (Code Set 1)
FE Resend
EE Echo
FC BAT failure
AA BAT completion code
86AB 122 key keyboard ID
84AB 84/85 key keyboard ID
83AB 101/102 key keyboard
ID
00 Key detection error/
overrun
(Code Sets 2 & 3)
Commands to the
System
USAR DATA BOOK 1994
UR6HCPCS
product specifications
132
Functional Description
Scan Code Data Translation in ASCII Mode (Parallel & Serial ASCII Output)
PC-compatible keyboard devices encode key press and key release information into scan codes. There are typically three scan
code sets supported by these keyboards. A detailed description of the scan code sets can be found in the IBM Technical Reference
Manual. The UR6HCPCS in both the Serial ASCII and the Parallel Output Mode, will translate scan code information into its extended
ASCII equivalent. The UR6HCPCS sets the keyboard-compatible device into the default Scan Code Set 2, which is the default scan
code set for AT-compatible systems.
Scan Codes to ASCII Translation Table
The following table lists the extended ASCII equivalents of the keys on a standard 101 AT-type of keyboard. The key numbers on the
first column correspond to the key numbers in the IBM Technical Reference Manual. When the user presses the Caps Lock Key or
the Num Lock Key, the UR6HCPCS will set the keyboard Status LEDs (Caps Lock, Num Lock) and will output the shifted version of the
relevant ASCII codes.
KEY # KEY ASCII ASCII ASCII L ASCII
LEGEND NORMAL SHIFTED CONTROL ALT
11 `~ 60 7E
221! 31 21 00 78
332@ 32 40 00 03 00 79
44 3# 33 23 00 7A
554$ 34 24 00 7B
66 5% 35 25 00 7C
776^ 36 5E 1E 00 7D
887& 37 26 00 7E
998* 38 2A 00 7F
11009( 39 28 00 80
11110) 30 29 00 81
1122-_ 2D 5F 1F 00 82
1133 =+ 3D 2B 00 83
1155BKSP 08 08 7F
1166TAB 09 00 0F
1177Q 71 51 11 00 10
1188W 77 57 17 00 11
1199E 65 45 05 00 12
2200R 72 52 12 00 13
2211T 74 54 14 00 14
2222Y 79 59 19 00 15
2233U 75 55 15 00 16
2244I 69 49 09 00 17
2255O 6F 4F 0F 00 18
KEY # KEY ASCII ASCII ASCII L ASCII
LEGEND NORMAL SHIFTED CONTROL ALT
22 66P 70 50 10 00 19
2277[{ 5B 7B 1B
2288]} 5D 7D 1D
2299\ 5C 7C 1C
3300CAPSLK
3311A 61 41 01 00 1E
3322S 73 53 13 00 1F
3333D 64 44 04 00 20
3344F 66 46 06 00 21
3355G 67 47 07 00 22
3366H 68 48 08 00 23
3377J 6A 4A 0A 00 24
3388K 6B 4B 0B 00 25
3399L 6C 4C 0C 00 26
4400;: 3B 3A
4411‘“ 27 22
4433ENTER 0D 0D 0A
4444L SHIFT
4466Z 7A 5A 1A 00 2C
4477X 78 58 18 00 20
4488C 63 43 03 00 2E
4499V 76 56 16 00 2F
5500B 62 42 02 00 30
5511N 6E 4E 0E 00 31
USAR DATA BOOK 1994
product specifications
UR6HCPCS
133
KEY # KEY ASCII ASCII ASCII L ASCII
LEGEND NORMAL SHIFTED CONTROL ALT
552M 6D 4D 0D 00 32
53 ,< 2C 3C
54 .> 2E 3E
55 /? 2F 3F
57 R SHIFT
58 L CTRL
60 L ALT
61 SPACE 20 20 20 20
62 R ALT
64 R CTRL
75 INSERT 00 52 00 52
76 DEL 00 53 00 53
79 LEFT 00 4B 00 4B 00 73
80 HOME 00 47 00 47 00 77
81 END 00 4F 00 4F 00 75
83 UP 00 48 00 48
84 DOWN 00 50 00 50
85 Pg Up 00 49 00 49 00 84
86 Pg Dn 00 51 00 51 00 76
89 RIGHT 00 4D 00 4D 00 74
90 Num Lk
91 7 HOME 00 47 37 00 77
92 4 LEFT 00 4B 34 00 73
93 1 END 00 4F 31 00 75
95 / 2F 2F
96 8 UP 00 48 38
97 5 00 4C 35
KEY # KEY ASCII ASCII ASCII L ASCII
LEGEND NORMAL SHIFTED CONTROL ALT
9982 DOWN 00 50 32
99 0 INS 00 52 30
100 * 2A 2A
101 9 PGUP 00 49 39 00 84
102 6 RIGHT 00 4D 36 00 74
103 3 PGDN 00 51 33 00 76
104 .DEL 00 53 2E
105 - 2D 2D
106 + 2B 2B
108 ENTER 0D 0D 0A
110 ESC 1B 1B 1B
112 F1 00 3B 00 54 00 5E 00 68
113 F2 00 3C 00 55 00 5F 00 69
114 F3 00 3D 00 56 00 60 00 6A
115 F4 00 3E 00 57 00 61 00 6B
116 F5 00 3F 00 58 00 62 00 6C
117 F6 00 40 00 59 00 63 00 6D
118 F6 00 41 00 5A 00 64 00 6E
119 F8 00 42 00 5B 00 65 00 6F
120 F9 00 43 00 5C 00 66 00 70
121 F10 00 44 00 5D 00 67 00 71
122 F11 00 85 00 87 00 89 00 8B
123 F12 00 86 00 88 00 8A 00 8C
124 PrSc 00 72
125 ScLk
126 PAUSE 00 00
VCC
R7
10K
TToo PPSS22 CCoommppaattiibbllee DDeevviiccee
R2
4.7K R1
4.7K
VCC
CR1 CR2
1N914
GND GND
C3
1uF C4
.01uF
VCC
10K X 6
VCC
GND
C12
10uF C11
10uF/6.3V
C1+
1
C1-
3 C2+
4
C2-
5 T1IN
11
T2IN
10
R1OUT
12
R2OUT
9
V+ 2
V- 6
T1OUT14
T2OUT 7
R1IN 13
R2IN 8
V
C
C
1
6
G
N
D
1
5U2
MMAAXX223322
GND
1
2
3
4
5
6
12
11
10
9
8
7
S1
DIP-6
SW0
SW1
SW2
SW3
SW4
SW5
V
C
C
4
0
G
N
D
2
0
EKD
10
EKC
9
EKC1
37
IRQ
2
PINH
4
NC 5
RP 6
NC 7
NC 8
DR
11
PD0
12 PD1
13 PD2
14 PD3
15 PD4
16 PD5
17 PD6
18 PD7
19
O
S
C
I
3
9
O
S
C
0
3
8
V
X
3
RTS 31
RXD 29
TXD 30
CTS 28
NC 27
I
D
1
3
2
I
D
2
3
3
I
D
3
3
4
NC 35
I
D
4
3
6
SW5 26
SW4 25
SW3 24
SW2 23
SW1 22
SW0 21
S
T
1
U1
UR6HCPCS-P
VCC
CR8 CR7
1N914
R6 47
R5 47
C9
47pF
C8
47pF
VCC
2
5
3 1
4
J1 DIN5
VCC
C15
10uF/6.3V
GND
GND
DATA OUT
TXD
CTS
C14
10uF/16V
C13
10uF/6.3V
GND
CTS
TXD
RxD
C10
1OuF/16V
RTS
GND
RxD
RTS
GND
DATA READY
INHBIT
GNDGND
VCC
C7
22pF C6
22pF
R14
10MEG
Y1
4.00 MHz
JP1 CLOSED FOR OTP PARTS
OPEN FOR MASKED ROM PARTS
R
TToo RRSS223322 ppoorrtt
GND
Parallel Port
USAR DATA BOOK 1994
UR6HCPCS
product specifications
134
Sample Schematic
SWITCH SETTINGS
SW0 Reserved
Baud Rate Selection
SW1 SW2 SW3
0 0 0 300
0 0 1 1200
0 1 0 2400
0 1 1 4800
1 0 0 9600
Mode Selection
SW4 0 Scan Codes
1 ASCII Codes
Repeat Enable
SW5 0 Enable
1 Disable
USAR DATA BOOK 1994
product specifications
UR6HCPCS
135
Absolute Maximum Ratings
Ratings Symbol Value Unit
Supply Voltage V
DD
-0.3
TO
+7.0 V
Input Voltage V
IN
V
SS
-0.3 to V
DD
+0.3 V
Current Drain per Pin I 25 mA
(not including V
SS
or V
DD
)
Operating Temperature T
A
T
LOW
to T
HIGH
° C
UR6HCPCS-
XX
0 to +70
UR6HCPCS-C
XX
-40 to +85
Storage Temperature Range T
STG
-65 to +150 ° C
Thermal Characteristics
Characteristic Symbol Value Unit
Thermal Resistence Tj
A
° C per W
Plastic 60
Cerdip -60
Plcc 70
DC Electrical Characteristics (Vdd=5.0 Vdc +/-10%, Vss=0 Vdc, Temperature range=T low to T high unless otherwise noted)
Characteristic Symbol Min Typ Max Unit
Output Voltage (I
LOAD
<10uA) V
OL
0.1 V
V
OH
V
DD
–0.1
Output High Voltage (I
LOAD
=.0.8mA) V
OH
V
DD
–0.8 V
Output Low Voltage (I
LOAD
=1.6mA) V
OL
:0.4 V
Input High Voltage V
IH
0.7xV
DD
V
DD
V
Input Low Voltage V
IL
V
SS
0.2xV
DD
V
User Mode Current I
PP
510 mA
Data Retention Mode (0 to 70°C) V
RM
2.0 V
Supply Current (Run) I
DD
4.7 7.0 mA
I/O Ports Hi-Z Leakage Current I
IL
+/-10 uA
Input Current I
IN
+/- 1 uA
I/O Port Capacitance C
IO
812 pF
Control Timing (Vdd=5.0 Vdc +/-10%, Vss=0 Vdc, Temperature range=T low to T high unless otherwise noted)
Characteristic Symbol Min Max Unit
Frequency of Operation f
OSC
MH
Z
Crystal Option 4.0
External Clock Option dc 4.0
Internal Operating Frequency f
OP
MH
Z
Crystal (f
OSC
/ 2) 2.0
External Clock (f
OSC
/ 2) dc 2.0
Cycle Time tcyc 500 ns
Crystal Oscillator Startup Time t
OXOV
100
MS
Stop Recovery Startup Time t
ILCH
100 ms
RESET Pulse Width t
RL
8tcyc
Interrupt Pulse Width Low t
LIH
125 ns
Interrupt Pulse Period t
ILIL
*tcyc
OSC1 Pulse Width t
OH
, t
OL
90 ns
*The minimum period t
LIL
should not be less than the number of cycle times it takes to execute the interrupt service routine plus 21 tcyc.
Electrical Specifications
USAR DATA BOOK 1994
UR6HCPCS
product specifications
136
Copyright 1997 USAR Systems. All
rights reserved. No part of this
datasheet may be reproduced in any
way without the express written consent
of USAR Systems. SPICoder is a
trademark of USAR Systems, Inc.
PC/XT/AT/PS/2 are trademarks of IBM.
USAR Systems reserves the right to
make changes without further notice to
any products herein to improve
reliability, function or design. USAR
Systems does not assume any liability
arising out of the application or use of
any product or circuit described herein;
neither does it convey any license under
its patent and copyright rights nor the
rights of others.
For more information, contact:
USAR Systems
568 Broadway #405
New York, NY 10012
Tel: 212.226.2042
Fax: 212.226.3215
e-mail: info@usar.com
www.usar.com