TransKey-II (TK-II) PS/2 Keyboard Interface

Type
DIY project
Category
Keyboard interface
Manufacturer
Michael St. Pierre (MyTek / AtariBits), open design
Close-up inside an Atari XL motherboard: a small TK-II-PBJ board plugged on top of the POKEY chip, with coloured jumper wires running to the joystick-input resistors and console-switch inputs

Overview

TransKey started in 1990 as one of the first commercial products to let an Atari 8-bit use an IBM PC keyboard. It was a bulky board built from a 6504 CPU, a 6520 PIA, a 2732 EPROM, 6116 static RAM and some glue logic, and it was fussy about which keyboards it would accept. Its original schematics are now available on the AtariBits site.

About 25 years later, Michael St. Pierre (MyTek) reworked the idea as the TK-II. Everything now runs on a single Microchip PIC16F1847 microcontroller, and any PS/2 keyboard works. The TK-II is also built into his 1088XEL/1088XLD and 576NUC+ motherboards.

How it works

The Atari keyboard is a passive switch matrix that POKEY scans continuously: it counts through the 64 key positions on its K0–K5 outputs and watches the KR1/KR2 response lines. The TK-II's PIC watches the same scan counter and, when the code for a key that is "pressed" on the PS/2 keyboard comes round, pulls the response line exactly as a real key would. To the Atari it is indistinguishable from the stock keyboard. That's why the TK-II needs no driver, and why it works with all software. It was designed for a genuine POKEY and may not work correctly with FPGA replacements.

Versions

Board Installation
TK-II-GS (and the earlier TK-II-XEGS) a tiny plug-in adapter for the XE Game System's keyboard socket (also the 7800XM). No soldering for basic use
TK-II-PB / TK-II-PBJ piggy-backs on POKEY inside a 400/800, XL or XE. A separate small PS/2-INTFC board carries the Mini-DIN socket, which can be mounted in the hole left by a removed RF modulator. The PBJ, the third generation, adds Arrow-to-Joy and three auxiliary outputs
TK-II-STEREO TK-II plus a second POKEY with electronic stereo/mono switching, comparable to Candle's discontinued Simple Stereo/AKI combination

The PBJ board's parts list is short: the PIC (SOIC), a 74LS156 decoder, an LED, a resistor, a diode, two capacitors, headers and a 40-pin machined socket. All connections and programming go through one header, so ready-made Dupont jumper leads can be used.

Features (firmware 2.7J, June 2021)

  • Console and special keys: F1–F4 act as the 1200XL function keys. F2–F5 act as START, SELECT, OPTION and RESET (earlier firmware used F5–F8), which needs wires to the console-switch inputs on the board. A selectable AKI mode (CTRL+ALT+E) copies the function-key layout of Lotharek's AKI interface and the Altirra emulator.
  • Macros: record up to 30 keystrokes on F5–F12 with CTRL+ALT+F-key and play them back with ALT+F-key, including delays and repeats.
  • Insert mode (ALT+Insert) for PC-style line editing in BASIC and the Assembler Editor. Turn it off in word processors.
  • U1MB hotkeys: F11 opens the Loader, F12 the setup menu, and F9 resets a hot-plugged CF card.
  • Arrow-to-Joystick (ALT+J) on PBJ and ARROW2JOY hardware: arrow keys act as joystick 1 for games that don't know about keyboards.
  • Keyboard layouts: US, DE, UK and A8 (ISO).

Firmware 2.6 is still available for hardware that needs dual PS/2 keyboards or the delayed-reset feature. 2.7J drops those to fit new features into the PIC. Neither version is for the 576NUC+, which has its own.

Building and setup

  1. Flash the PIC first, with POKEY removed. Use St. Pierre's JOY2PIC (an Atari joystick-port PIC programmer, with ATR and XEX flashing files) or a Microchip PICkit with the HEX file.
  2. Install the board. Machines with unsocketed POKEYs, such as most XEs, need a socket fitted first.
  3. A freshly flashed TK-II starts in XEGS mode, which assumes no stock keyboard and drives the KR lines actively, because some boards lack POKEY's KR pull-up resistors. If your computer has its own keyboard, press CTRL+ALT+X once to switch to dual-keyboard mode. The setting is saved. A 1200XL used without its stock keyboard also needs XEGS mode on.

See also

The AKI interface is another PIC-based PS/2 solution. The Atari in a PC case entry describes the original 1990 TransKey in its period setting.

Credits