Sub-pages
Keyboard Overview
The Amiga keyboard is an intelligent keyboard — it contains its own microprocessor that handles all key scanning and delivers only validated key codes to the main computer. Several keyboard revisions exist across the A500, A1000, and A2000, differing mainly in the number of keys and their physical layout. The diagrams below show the American (QWERTY) and French (AZERTY) layouts with their corresponding raw key codes.
The keyboard transmits exclusively raw key codes, not ASCII characters. The operating system translates these codes into ASCII using a keymap table. The raw key code space is organized as follows:
The keyboard processor can distinguish between key down (pressed) and key up (released) states. Key codes occupy 7 bits ($00–$7F), with the 8th bit serving as the key up/down flag. When bit 7 is 0, the key is pressed; when bit 7 is 1, the key has been released. The keyboard also supports multiple simultaneous key presses — some music software exploits this capability to play chords.
Caps Lock Exception
The Caps Lock key is a special case — the keyboard simulates a toggle switch. Pressing Caps Lock activates it and turns on the LED. No key up code is sent until the key is pressed a second time, at which point the key up code is transmitted and the LED turns off. In effect, the up/down flag tracks the lock state rather than the physical key position.
Keyboard Electronics
The MOS 6500/1 Microprocessor
The heart of the keyboard is the MOS 6500/1, a single-chip microcomputer based on the 6502 CPU core. It integrates everything needed to operate independently:
The 6500/1 requires only a 5V supply and a crystal. The Amiga keyboard uses a 3 MHz quartz crystal, yielding an internal clock frequency of 1.5 MHz.
A 556 dual timer IC generates the RESET signal for the 6500/1.
Key Matrix
The keys are organized into two groups:
Direct keys: The seven modifier keys — Left Shift, Right Shift, Left Alt, Right Alt, Left Amiga, Right Amiga, and Control — are connected directly to the lower bits of port PB.
Matrix keys: All other keys are arranged in a 6-column by 15-row matrix. The six columns connect to port PA signals PA2–PA7, configured as inputs. The 15 rows are driven by ports C and D (pin PD7, which would be a 16th row, is disconnected in later revisions).
Scanning Process
When the 6500/1 scans the keyboard, it activates each row by driving it LOW. Since the port C and D outputs are open-collector without internal pull-up resistors, outputs set to 1 are effectively inactive (high-impedance). With a row driven LOW, the processor reads the six column inputs. The column inputs have internal pull-up resistors, so an unpressed key reads HIGH.
Each key connects a column to a row at the intersection point. When a key in the active row is pressed, the corresponding column input is pulled LOW. After scanning all rows, the processor knows the complete state of every key. If any state has changed since the previous scan, the corresponding key codes are transmitted to the Amiga.
Serial Data Transfer
Physical Connection
The keyboard connects to the Amiga via a four-wire cable. Two wires carry the 5V power supply for the keyboard electronics. Data transfer uses the remaining two lines:
Transfer Protocol
Data transfer is unidirectional — from the keyboard to the Amiga. The 6500/1 places each data bit on the KDAT line and accompanies it with a LOW clock pulse on KCLK.
Timing per bit: - KCLK LOW pulse duration: 20 microseconds - Interval between clock pulses: 40 microseconds - Total time per bit: 60 microseconds - Time for one complete byte (8 bits): 480 microseconds - Effective baud rate: 16,666 baud
The data signals are active-low (LOW = logic 1, HIGH = logic 0).
Bit Transmission Order
The bits are not sent in standard MSB-first order (7-6-5-4-3-2-1-0). Instead, the byte is rotated left by one position before transmission, yielding the order: 6-5-4-3-2-1-0-7. The key up/down flag (bit 7) is always transmitted last.
For example, the raw key code for 'J' is 10100110. After left rotation, it is transmitted as 01001101.
This rotation ensures that during synchronization errors, the last bit received is always the up/down flag. Since the keyboard sends all 1s during resynchronization, any garbled byte will appear as a key up code — which is harmless. A false key down would be far more disruptive.
CIA Shift Register Reception
The CIA-A shift register captures one bit on each clock pulse from KCLK. After eight pulses, a complete byte is available and the CIA generates a level 2 interrupt. The operating system's interrupt handler then:
- Reads the serial data register
- Inverts and rotates the byte right to recover the original key code
- Sends the handshake pulse
- Processes the key code
Handshake Protocol
After transmitting all 8 bits, the keyboard waits for a handshake from the Amiga. The Amiga acknowledges by pulling the KDAT line LOW for approximately 75 microseconds. This signals the keyboard that the byte was received and it may send the next code.
Synchronization Recovery
Proper data transfer requires that the transmitter and receiver are in sync — the bit positions must align. A loss of synchronization can occur if the Amiga is powered off while the keyboard is sending, or if the keyboard is plugged in while the Amiga is running. The Amiga itself has no way to detect a sync error; this responsibility falls entirely on the keyboard.
After each byte transfer, the keyboard waits a maximum of 145 milliseconds for the handshake signal. If no handshake arrives within this time, the keyboard assumes a transmission error and enters a special resynchronization mode:
- The keyboard sets KDAT to 1 and sends a single clock pulse
- It waits another 145 ms for a handshake
- This is repeated until a handshake is received, confirming synchronization is restored
During resynchronization, the keyboard transmits only 1-bits. Since the last bit received is always the up/down flag (due to the left rotation), any incorrectly received byte will be interpreted as a key up event — which is safe to ignore.
Special Codes
The keyboard communicates several special conditions to the Amiga using reserved key codes in the range $F9–$FE:
Power-Up Sequence
When the Amiga is powered on, the keyboard processor performs its self-test (briefly lighting the Caps Lock LED). Once complete, it transmits the codes of any keys held down during power-up, bracketed by $FD (start) and $FE (end). If no keys were pressed, only $FD followed immediately by $FE is sent.
Keyboard Reset
The keyboard can trigger a hardware reset of the entire Amiga. Pressing both Amiga keys and the Control key simultaneously causes the keyboard processor to hold the KCLK line LOW for approximately 0.5 seconds. This generates a RESET signal that forces a complete system reboot. The reset is triggered when any one of the three keys is released.
The Caps Lock LED blinks during the reset sequence as a visual confirmation.
Since the KCLK signal is connected to the CIA-A CNT pin, it is theoretically possible to trigger a reset through software by appropriately programming the CIA — though this is not a recommended practice.