MAN-AMIKey13 AMIKey-3 38813 Keyboard Controller Users Guide Jun97
MAN-AMIKey13 AMIKey-3 38813 Keyboard Controller Users Guide Jun97
American
~~ Megatrends
AMIKey-3 38813 Keyboard
Controller
User's Guide
MAN-AMIKey13
6119/97
© Copyright 1994- 1997 American Megatrends, Inc.
Al! rights reserved.
American Megatrends, Inc.
Limited Warranty
Buyer agrees if this product proves to be defective, that American Megatrends, Inc. is only
obligated to replace or refund the purchase price of this product at American Megatrend's
discretion. American Megatrends shall not be liable in tort or contract for any loss or damage,
direct, incidental or consequential. Please see the Warranty Registration Card shipped with
this product for full warranty details.
Limitations of Liability
In no event shall American Megatrends be held liable for any loss, expenses, or damages of
any kind whatsoever, whether direct, indirect, incidental, or consequential, arising from the
design or use of this product or the support materials provided with the product.
Trademarks
Revision History
Index ............................................................................57
Preface iii
Preface
Phone Numbers The BBS requires no parity, eight data bits, and one stop
bit. The characteristics of the American Megatrends
technical support, BSS, and other important phone
numbers are:
Phone Number/Address Characteristics
Tech SUPIJort Voice 770-246-8645
Tech Support Fax 770- 246-8772
Sales 800-828-9264
Internet Address [email protected]
Web Site http://www.meKatrends.com
770-246-8780 28,800 baud rate. Supports v.34.
770-246-8781 28,800 baud rate. Supports v.34.
770-246-8782 Supports HST and v.42.
770-246-8783 Supports HST and v.42.
Preface v
vi AMIKey 38813 Keyboard Controller User's Guide
1 AMIKey/38813 Keyboard
Controller Features
The AMIKey/38813 keyboard controller firmware features
include:
• based on the Megakey keyboard controller code,
• supports ISA, EISA, and MCA® architecture,
• provides transparent software Gate A20 support,
• supports an internal keyboard,
• supports auxiliary devices,
• supports an internal scan code controller,
• supports internal pointing devices,
• supports an internal numeric keypad,
• supports direct LED control, and
• supports the smart battery 5MBus interface.
Chapter 1 Features 1
Features, Continued
Password and Hot Key Support The firmware supports: a BIOS password
and general and function hot keys.
Based on Megakey Code AMIKey has a modular set of features. This has
come from the previous versions of American Megatrends
keyboard controllers. This has been brought to give
optimum performance and flexibility to include future
enhancements in keyboard controller computer designs.
ISA, EISA, and MCA Support The AMIKey/ 38813 firmware supports a
superset of IBM PS/2 keyboard and auxiliary device
controller host interface. The system BIOS can configure
the AMIKey as an AT 8042 with no PS/2 support. The
default is PS/2 support. The IRQ12 line is not normally
connected on the AT schematic but is connected on the
MCA and EISA schematics. If the IRQ12 line is connected
on the AT schematic, mouse support can be achieved
through port swapping with only one external keyboard
connector.
Cont'd
Chapter 1 Features 3
Features, Continued
Direct LED Support The firmware uses the LED drive port to show the
Scroll Lock, Caps Lock, and Num Lock status by driving
the corresponding LEDs directly. When the corresponding
bit is set, the LED glows unless it is Off. Up to four LEDs
can be driven directly from the keyboard controller, freeing
up an additional port pin. This pin can be used for the
function bit status.
External PS/2 Device are Hot Pluggable The firmware tracks the external
PS/2 devices status. It knows if the device has been
plugged in or unplugged. If the device has been plugged in
recently, it first checks for port swapping and later
initializes the device that has been plugged in to the same
state as the internal device (if the internal device is already
present). It maintains the controller configuration to handle
both internal and external devices. Hot pluggability is a
user convenience.
This feature is useful when hot docking the computer to a
docking station with external devices already attached to it.
Hot Port Swapping Usually two ports connect the keyboard and auxiliary
devices. With port swapping, any port can be used for the
keyboard or the mouse. Ports can be interchanged while
the computer is up and running. Only one external
keyboard or mouse can be present at one time. Both ports
cannot be occupied by two keyboards or mice. Port
swapping can be done during power-on or while the
computer is up and running.
WAIT Mode AMIKey supports the power saving mode (W AIT) during
idle condition. All the keyboard controller events are
handled by interrupts, so when there is no work to be done
by the keyboard controller, it automatically enters WAIT
mode. While WAIT mode is active, all RAM locations,
ports, and registers maintain the same status they had
before WAIT Mode. The keyboard controller returns to
normal operating mode (so the generated interrupt can be
processed) when any interrupt event (such as a key press)
occurs.
Cont'd
Chapter 1 Features 5
Features, Continued
Quick Lock Support The keyboard and mouse are locked until the user
enters the correct password. The keyboard controller
password is 6 bytes long with a null character at the end.
The password must be loaded before this feature can be
used. By default, either <Function key> <Backspace> or
<Ctrl> <Alt> <Backspace> locks the keyboard and mouse
under the Quick Lock enabled state. The keystroke
combinations can be changed to any other keystroke
combination, if desired.
The keyboard and mouse can be locked without leaving the
user application. The faceplate LEDs are flashed when the
keyboard controller enters the quick lock state. LED
flashing is disabled automatically after a predefined time.
LED flashing stops after the user enters the correct
keystroke combination.
Cont'd
Function Hot Keys Function hot keys are invoked by pressing a <Function
key> <Function key> keystroke combination. A function
key is any key from FI to F12. When this key combination
is pressed, the function task is set pending and is executed
when the function key is released.
Pulse Hot Keys The pulse hot keys are invoked by pressing <Function
key> <pulse hot keyX> keystroke combination on the
internal keyboard. Any key on the internal keyboard can be
configured as a pulse hot key. The keyboard controller
sends low-going pulses at the typematic rate to the
designated port pin when the specified keystroke
combination is pressed. The pulses are used for controlling
brightness, contrast and volume.
General Hot Keys General hot keys are invoked by pressing either <Ctrl>
<Alt> <hot key> or <Function key> <hot key>. The hot
key is any non-extended key. A non-extended key is a key
that produces only one scan code per MakelBreak). The
scan code value of the key used as a general hot key is
stored in the RAM location by the system BIOS. The
corresponding task is stored in the corresponding Keytask
RAM location. For <Ctrl> <Alt> <hot key> keystroke
combinations, the corresponding task is set pending and is
executed when all hot key keys are released. For all
<Function key> <hot key> keystroke combinations, the
task is executed when the Hot key is released.
Cont'd
Chapter 1 Features 7
Features, Continued
Downloadable Function Key Table The firmware can down load the
function modifiable keys. Any value from OOh through BFh
can be put in this table. The table stores the scan code
value of a specific key when it is pressed alone (unshifted
value) and if it is used in conjunction with the function key
(fn_shifted value). These key values include standard keys,
hot keys, and special handled keys for full functionality.
Sends a keyboard
Make/Break scan code
Keyboard Controller
Sends a Make/Break
system scan code
BIOS
Receives Data from the Keyboard The keyboard sends data in an ii-bit
serial format to the keyboard controller:
Step By Action
I keyboard The data begins with a start bit (low level) followed
by 8 data bits (least significant data bit first), an odd
parity bit, and a stop bit (high level).
2 keyboard Data sent is synchronized with the keyboard clock.
3 keyboard On receiving a byte of data from the keyboard, the
controller keyboard controller places the data in its one-byte
receive-data buffer and disables the keyboard
interface until that data is picked up by the computer
microprocessor. This avoids data overrun.
4 system Reads the data from the keyboard controller receive-
CPU data buffer.
5 keyboard On parity error, the controller requests that the
controller keyboard resend the data. If the error is repeated, the
controller sets the parity error bit in its status
register.
The keyboard controller sets the timeout bit in the
status register if all eleven bits are not received
within two milliseconds from the start of the
transmission. If either error occurs, FFh is placed in
the receive-data buffer.
Cont'd
Possible Errors When Sending Data to the Keyboard Data is sent to the
keyboard in the same serial format as data received from
the keyboard. Some errors that may occur include:
Cont'd
Access The 512 byte RAM area is divided into four 128 byte
pages. Each page can be accessed by two variables:
• MEM_INDEX, and
• KBC_FLAGS (Bits 7 and 6).
Changing the Function Key Table To change the function key table, set
bits 7-6 ofKBC]LAGS to 10 or 01 (preferably 10).
Memory index values from COh - FFh refer to 100h-
13Fh for the function shift key table.
Smart Battery Memory locations above 1COh are used for smart battery
interface handling. This memory can be accessed by setting
bits 7 and 6 ofKBC_Flags to 11 and setting Mem_index to
80h ... FFh.
You should set the page index bits to the default (00) once
either the function key table has been modified or the smart
battery related data has been accessed.
09Ah Num Lock Numlock OBAh Func. 19h Pulse Low P2.3
acts as pad
lock
09Bh Unused OBBh Func. IAh Pulse Low PS.O
09Ch Unused OBCh Func. IBh Pulse Low PS.I
09Dh Unused OBDh Func. ICh Pulse Low P 5.2
09Eh Unused OBEh Func.IDh Pulse Low P5.3
09Fh Unused OBFh Unused Unused
Fn Shifted Scan Codes If the matrix value is from COh to DFh, the current
status of the function shift flag is checked and the scan
code is chosen between the unshifted and Fn-shifted values
as shown below. The selected scan code value goes
through the same steps as the standard scan code values (0-
BFh) and arrives at the final scan code sequence according
to the specification. The scan code values from CO through
DFh, which are not used by default, can be used for any
key combination.
Cont'd
Numeric keypad lock = OFF In this configuration, the numeric keypad can
be used as number keys only by pressing Fn + numeric pad
key while the system Num Lock status is On.
To get this mode of operation:
Step Action
1 Define Num Lock as the standard system Num Lock (77111
2 Clear the num_padlock flag (Bit 3 of the KI3C FLAGS register).
Code Protocol
85h WRITE_WORD
86h READ_WORD
87h WRITE_BLOCK
88h READ_BLOCK
Data Formats The data format for the protocols for DAh is:
Command/Data Destination Description
Protocol: READ WORD
DAh 1/0 port 64h
xxh I/O port 60h Protocol
YYh I/O port 60h Slave Address
ZZh 1/0 port 60h Device Command
Protocol: READ BLOCK
DAh I/O port 64h
xxh I/O port 60h Protocol
YYh I/O port 60h Slave Address
ZZh I/O port 60h Device Command
Protocol: WRITE WORD
DAh I/O port 64h
xxh I/O port 60h Protocol
YYh I/O j)ort 60h Slave Address
ZZh I/O port 60h Device Command
Data I/O port 60h Byte 0
Data I/O j)ort 60h Byte 1
Protocol: WRITE BLOCK
DAh I/O port 64h
xxh I/O port 60h Protocol
YYh I/O port 60h Slave Address
ZZh I/O port 60h Device Command
Data I/O port 60h byteO (COUNT (n))
I/O port 60h Bytel
... ... .. .
... ... ...
Data I/O port 60h Byte (n)
Data Formats The data format for the protocols for DBh is:
CommandlData Destination Description
Protocol: READ WORD
DBh I/O port 64h
Status Byte I/O J:lort 60h
Byte 0 I/O port 60h
Byte 1 I/O port 60h
Protocol: READ BLOCK
DAh I/O port 64h
Status Byte I/O port 60h If the previous
transaction was
erroneous, the status
byte contains an error
code.
Byte 0 1/0 jlort 60h Number of bytes
Byte 1 1/0 port 60h
... ... ...
... ... ...
Byten I/O port 60h
Protocol: WRITE WORD
DBh I/O port 64h
Status Byte I/O port 60h
Protocol: WRITE BLOCK
DBh I/O port 64h
Status Byte I/O jlort 60h
The valid error codes for commands DAh and DBh are:
Error Code Description
IOh Slave address not acknowledged
llh device detected error/data byte not acknowledged
ISh Timeout error
19h Unsupported protocol specified
IAh 5MBus busy
Index 59
Stop bit, 18 Translation, 17
STOP Mode, 6 Typematic rate., 12
System and Keyboard Controller
Command Interface, 20 U
System Flag, 21, 23 User RAM, 10
System Stack, 9 User-defined scan code set_2 table,
14
T
Technical support, iv W
Temporary subroutine scratch WAIT Mode, 5
registers, 9 Wakeup task storage register, 10
Test auxiliary device clock and data Web Site, v
(interface test XE Windows, 3
"Interface test" ), 25 Write Port 2, 26
Test keyboard clock and data lines, Write the memory location pointed
25 by MEM_INDEX, 26
Test password installed, 25 WRITE_BLOCK, 50
Time-out bit, 18 WRITE_WORD, 50
Timeout Error, 21