IBM PC Keyboard ConverterThe converter translates IBM PC keyboard protocols to use classic keyboards with modern computer with USB ports. It supports both IBM XT and AT protocols(PS/2 and Terminal), and all of scan code set 1, 2 and 3 with one firmware.
Pin configuration is compatible for Soarer's, this firmaware works on existent Soarer's converter hardwares.
Keyboards that should be supported-
PC XT keyboard of IBM 5150 5160
- 83-key: 1501100 1501105
-
PC AT keyboard of IBM 5170
- 84-key: 6450200 6450225
-
Terminal keyboard of IBM 5271(3270 PC)
- 122-key: 6110344 6110345 1397000
- 102-key: 1390680 1395764 1392595
-
PS/2 keyboards
- and many clones
This project is intended to integrate and supersede existent TMK XT, PS/2 and Terminal converters.
- IBM XT converter:
https://geekhack.org/index.php?topic=94649.0- PS/2 converter:
https://geekhack.org/index.php?topic=14618.0- IBM Terminal converter:
http://geekhack.org/index.php?topic=27272.0REQUEST FOR HELPTest in the field and feedback from users are needed to improve this converter.
Please report your result and your keyboard model number.Also debug outputs on hid_listen would be helpful to know how keyboard is recognized.The converter needs to be tested especially with these keyboards:
-
Zenith Z-150 AT(See "Issues" below)
- IBM 5576-001
- IBM 5576-002
- IBM 5576-003
-
Zenith Z-150 XT black label(Let me know if you still have any issue)
-
IBM PC XT 83-key(Let me know if still you have any issue)
-
IBM PC AT 84-keyTest and report with any other keybaord is still appreciated if it is not listed in 'Confirmed Keyboards' below.
Confirmed KeyboardsXT Keyboards- IBM PC XT 83-key:
4584656,
2020-06-02-
Leading Edge DC-2014-
KeyTronic E03600 XT/AT (after Timeout error Fix)
-
Zenith Z-150 XT black label-
Chicony KB-5191 in XT mode-
Focus FK-2001-
Siemens F500 XTAT(PS/2) Keyboards-
IBM PC AT 84-key,
-
DS-2001,
-
Northgate Omnikey-
KeyTronic E03600 XT/AT-
DTK SPK 101-
FK-8000-
Focus FK-2001Terminal Keyboards- IBM 122-key Terminal:
6110345,
6111070,
6110344-
G80-2551IssuesPost your result for debug and improvement if you have keyboard below.
Zenith Z-150 AT:The converter should receive scan codes but fails to send command to the keyboard.
The converter can't control LED indicator correctly and the keyboard stops working when pressing any lock keys.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#zenith-z-150-atPost your result and 'hid_listen' log when pressing CapsLock key.
Solved Issues:More
FirmwareKeymap EditorYou can edit keymap and download the latest prebuilt firmware here.
http://www.tmk-kbd.com/tmk_keyboard/editor/#ibmpc_usbDefault Prebuilt FirmwareYou can download the latest prebuilt firmware with default keymap directly from here.
https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb/binaryBuild FirmwareDownload source code from:
https://github.com/tmk/tmk_keyboard/tree/master/converter/ibmpc_usb cd converter/ibmpc_usb
make -f Makefile.<variant> clean
make -f Makefile.<variant>
where <variant> is atmega32u2, atmega32u4 or at90usb1286.
You will see firmware hex file in the directory.
DebugUse hid_listen to see debug outputs from the converter.
https://github.com/tmk/tmk_keyboard/wiki#hid_listenYou will see debug ouputs like this.
Waiting for new device:...
Listening:
TMK:95aba6dd/LUFA
USB configured.
Keyboard start.
rAA rBF rBF wF5 rFA wF2 rFA rBF rBF wF4 rFA ID: BFBF
kbd: Terminal
wF8 rFA
HardwareThe firmware supports ATmega32u4, ATmega32u2, AT90USB128 by default, Teensy2/2++ or Pro Micro can be used.
WiringWire controller pins below to keyboard signals, besides VCC and GND.
This pin configuration is compatible for Soarer's converter.-
Data PD0-
Clock PD1-
Reset PB6 or
PB7 (For some of XT keyboards. Not needed for AT, PS/2 and Terminal)
Pull up resistors of 1-4.7K Ohm on both Data and Clock line are strongly recommended, without them it won't work in some cases.
Reset pinOld Type-1 IBM XT keyboard and some of XT clones need Reset pin to initialize its controller on startup. Also some clones such as Zenith Z-150 XT and Leading Edge DC-2014 are known to need this. Type-2 IBM XT keyboard and other XT clones don't need the reset pin.
But you better have wiring for Reset if you want to support XT keyobards. See
this for difference between XT Type-1 and Type-2.
AT, PS/2 and Terminal keyboards don't require the Reset pin. The Reset pin won't harm AT keyboards you can make converter to support both AT and XT keyboards.
Connector pinoutsMore
Pro Micro CaveatPro Micro is not recommended unless you are already familiar or have skill and time enough.More
You have to use VCC pin to power your keyboard, not RAW pin.
RAW pin is not for 5V power supply directly from USB line. The name may be confusing but it is used for external power input, not output. You get only around 4.6V due to protection diode(D2 in schematic) forward voltage drop(0.4V typically) on RAW pin.
And you have to make J1 solder bridged, without this you will get same voltage as RAW pin or lower.
With J1 solder bridge you can get raw power(possibly 5V) directly from USB line on VCC pin. Note that RAW pin doesn't give 5V even with the solder bridge.
Check this wiki for detail.
https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#j1-solder-bridgePD0, PD1 and PB6 are maked on Pro Micro PCB as 3, 2 and 10 respectively.
https://github.com/tmk/tmk_keyboard/wiki/Pro-Micro#pinout Default Key MappingMore
XT 83-key:
,-------. ,--------------------------------------------------------------------------.
| F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck |
|-------| |--------------------------------------------------------------------------|
| F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -|
|-------| |------------------------------------------------------|Ent|---------------|
| F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| |
|-------| |----------------------------------------------------------------------| |
| F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift| *| 1| 2| 3| +|
|-------| |----------------------------------------------------------------------| |
| F9|F10| | Alt | Space |CapsLck| 0 | . | |
`-------' `--------------------------------------------------------------------------'
AT 84-key:
,-------. ,-----------------------------------------------------------. ,---------------.
| F1| F2| | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| BS| |Esc|NmL|ScL|PrS|
|-------| |-----------------------------------------------------------| |---------------|
| F3| F4| |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| App| | 7| 8| 9| *|
|-------| |-----------------------------------------------------------| |-----------|---|
| F5| F6| |LCtrl | A| S| D| F| G| H| J| K| L| ;| '|Lef| Ret| | 4| 5| 6| -|
|-------| |-----------------------------------------------------------| |---------------|
| F7| F8| |Shif|KAN| Z| X| C| V| B| N| M| ,| ,| /| RO| Shift| | 1| 2| 3| +|
|-------| |-----------------------------------------------------------| |-----------|---|
| F9|F10| | Alt| | Gui| Space | Ins| |Caps| | #| 0| .|F11|
`-------' `----' `---------------------------------------' `----' `---------------'
Terminal 122-key:
,-----------------------------------------------.
|F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
|-----------------------------------------------|
|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|
`-----------------------------------------------'
,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
|Mut|HEN| | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY| BS| | /|PgU|PgD| |Esc|NmL|ScL| *|
|-------| |-----------------------------------------------------------| |-----------| |---------------|
|VUp|Pau| |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |End|Ins|Del| | 7| 8| 9| +|
|-------| |-----------------------------------------------------------| `-----------' |-----------|---|
|VDn|MHE| |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #| Ret| |JPY|Up | #| | 4| 5| 6| -|
|-------| |-----------------------------------------------------------| ,-----------. |---------------|
|PrS|App| |Shif| \| Z| X| C| V| B| N| M| ,| ,| /| RO| Shift| |Lef|Hom|Rig| | 1| 2| 3|Ent|
|-------| |-----------------------------------------------------------| `-----------' |-----------|---|
|Gui|Gui| |Ctrl| |Alt | Space |Alt | |Ctrl| | RO|Dow|KAN| | ,| 0| .| =|
`-------' `----' `---------------------------------------' `----' ---`---'--- `---------------'
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-Keyboard-Converter#default-mappinghttps://github.com/tmk/tmk_keyboard/blob/master/converter/ibmpc_usb/unimap_trans.hProtocol Considerations-
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol-
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-ProtocolKeyboard discriminationThis section explains how the converter determines proper protocol and scan code set for keyboard. The converter need to do that before starting to receive and translate scan codes from keyboard.
More
ProtocolThis converter can recognize both XT and AT protocol *dynamically* accoding to bit sequence received on signal line.
https://github.com/tmk/tmk_keyboard/blob/f80601db962384146eb80705aaa3057a1b3848b4/tmk_core/protocol/ibmpc.c#L272-L303Keyboard IDAfter startup the converter sends 0xF2 command to get keyboard ID and sees how the keyboard responds to the command.
https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-AT-Keyboard-Protocol#keyboard-idResponse from keyboard:
- XT keyboard doesn't support any command and returns no response.
- AT keyboard should respond with 0xFA to the command but returns no keyboard ID.
- PS/2 keyboard should respond with 0xFA to the command, followd by keyboard ID, such as 0xAB83.
- Terminal keyboard should respond with 0xFA to the command, followed by keyboard ID, such as 0xBFBF.
Now we can dscriminate the keyboard and determine suitable protocol and scan code set as described below.
Scan code Set- Scan codes from XT keyboard are handled as CodeSet1.
- Scan codes from AT and PS/2 keyboard are handled as CodeSet2.
- Scan codes from Terminal keyhboard are handled as CodeSet3.
Update2020-11-22 Add adhoc Z-150 AT support(Let me know your result)
2020-11-22 Fix
Pause key for enhanced XT keyboard
2020-07-05 Fix for
Timeout error(ERR:20)2020-07-02 Add support for hidden keys of IBM AT 84-key to Editor
2020-06-03 Improvement for XT protocol and keyboard error recovery
2020-05-11 Add handler for keyboard buffer full to prevent key stuck
2020-05-11 Add adhoc start bit error recovery for XT keyboards
2020-04-28 Add support G80-2551 and possibly other terminal keyboards(whose id is AB86)
2020-04-11 Keymap Editor is available
2020-03-02 firmware update for XT protocol handling and many other fixes
TODO* Reset method for rescueFor converter without accesible reset button when magickey combo doesn't work.
Check pin status at powerup:
- if Data and/or Clock are pull down to GND
* Force protocol and scan code setKeyboard discrimination may fail and you have to configure them by hand.