XT/AT/PS2/Terminal to USB Converter with NKRO

User avatar
Soarer

23 Apr 2012, 00:54

This is my Teensy-based project which adapts XT, AT and some 122 key terminal keyboards to USB, also known simply as "Soarer's Converter".

Yes, it's the same old thing that's been on geekhack for the last year, but it's now at v1.0 v1.12 and pretty much feature-complete.

So I'd like to share it here too :evilgeek:

Features...

Keyboard protocols supported:
  • XT (scan code set 1)
  • AT (scan code set 2)
  • PS/2 (MF2) (extended scan code set 2)
  • Terminal e.g. 3179/318x/319x (scan code set 3)
Configurable Features:
  • Remapping
  • Layers
  • Macros
  • On-the-fly Config Selection
Other Features:
  • Full NKRO, if the keyboard supports it (even on Macs!)
  • Boot mode support (even with faulty BIOS!)
  • Auto-detection of the keyboard type
  • XT and AT boards are remapped correctly for PrtSc etc. (see Legacy Note below)
  • 1000Hz polling using Full Speed USB
  • Suspend and resume support
  • Media and Power key support
  • Jump to bootloader function (update firmware without pressing the reset button)
  • Support for 'almost' PC/XT protocol keyboards, e.g. Leading Edge DC-2014
  • Keyboard Reset output (required by some PC/XT keyboards)
  • Five auxiliary key inputs (for extra keys, buttons, or footswitches)
Supported Atmel CPUs:
  • ATmega32U4 (Teensy 2.0, Adafruit '32U4 breakout, etc.)
  • AT90USB1286 (Teensy++ 2.0)
  • AT90USB646 (original Teensy++)
  • ATmega16U4 (???)
Full documentation (well, better than the old project article at least) is included in the zip...
Soarer_Converter_v1.10.zip
(956.19 KiB) Downloaded 4050 times
v1.10 full (.hex files, docs, tools, configs):
Added support for 'almost' PC/XT protocol keyboards, e.g. Leading Edge DC-2014.
Added Keyboard Reset output (required by some PC/XT keyboards).
Added five auxiliary key inputs (for extra keys, buttons, or footswitches).
Updated and expanded documentation generally, and added GH and DT Thread Contents pages and History page.
Fixed error LED timeout so it now stays on for 3 seconds after an error instead of flickering.
Soarer_Converter_v1.11_update.zip
(62.04 KiB) Downloaded 945 times
v1.11 update (.hex files only):
Added support for IBM RT keyboard.
Added display of boot mode state by making converter lock LEDs glow dimly.
Added extra error codes to help determine where timeouts occur more precisely.
Prevented debug and rawhid output when keyboard_protocol is not set (i.e. in BIOS mode).
Soarer_Converter_v1.12_update.zip
(61.9 KiB) Downloaded 2722 times
v1.12 update (.hex files only)
Added workaround for Linux kernel v3.x bug which causes Delete key not to repeat.
Soarer_Converter_v1.12_docs.zip
(623.79 KiB) Downloaded 3993 times
v1.12 updated documentation (docs only)
Various tweaks, added GH and DT thread search, updated GH and DT thread contents.


Important note - the connector diagrams are drawn looking into the front of socket. When you are soldering the pins on the back of the socket, you need to make sure they are correct, since your view is reversed. Especially for the AT and PS/2 sockets, where mirroring the connections will result in power and ground being swapped - and that is VERY BAD!

Please, if you are not certain that your wiring is correct just post a pic in this thread to have it checked before you power it up :)


Legacy Note - in v0.996 and earlier, hard-coded settings were used to support correct remapping of PrtSc etc. for XT and AT keyboards. These settings are now implemented by the legacy.sc config file, which must be compiled (by scas) and loaded (by scwr, after flashing) if you want the v0.997 (or later) converter to act like v0.996.


Older versions attached...

v1.0 full (.hex files, docs, tools, configs)

v1.01 update (.hex files only):
Fixed bug that stopped jump to bootloader functions working on AT90USB1286 (Teensy++ 2.0).

v1.02 update (.hex files only):
Fixed bug which could cause the converter to lock up if a key was pressed at certain times during system boot.

v1.03 update (.hex files only):
Fixed bug which caused the converter to lose config or reboot after using the scrd tool.
Fixed minor USB errors revealed by using the Command Verifier compliance testing tool.
Attachments
Soarer_Converter_v1.03_update.zip
(60.01 KiB) Downloaded 866 times
Soarer_Converter_v1.02_update.zip
(61.69 KiB) Downloaded 368 times
Soarer_Converter_v1.01_update.zip
(61.4 KiB) Downloaded 355 times
Soarer_Converter_v1.0.zip
(393.95 KiB) Downloaded 938 times
Last edited by Soarer on 31 Jul 2013, 02:11, edited 21 times in total.

User avatar
Maarten

23 Apr 2012, 07:35

Oh nice work! Now all i need is a teensy :lol:

User avatar
Kurk

23 Apr 2012, 07:59

This is a good opportunity to say thank you! I'm using a XT model F with your converter and it works like a charm. Next on my to-do list is building a converter box that takes all kind of input connectors: DIN 180, DIN 270, 8p8c (RJ45) and RS232.

User avatar
bhtooefr

23 Apr 2012, 12:10

Congrats on getting 1.0 out, and thank you. This adapter is powering my favorite keyboard (a 122 F), internally installed with double-stick tape.

User avatar
Soarer

23 Apr 2012, 14:43

Thanks people, you're welcome!

I hope there aren't too many bugs discovered, so I can now play with some other stuff for a bit (not saying this has been full-time, but when I've had time I've felt I had to spend it on this). There are still a few things I want to do to improve it though, so this definitely isn't 'The End' by any means! :-D

User avatar
litster

23 Apr 2012, 17:18

Excellent converter! It is not just for IBM keyboards. It can make all your Filco keyboards do NKRO over PS/2 over USB!. Really cool!

User avatar
RC-1140

23 Apr 2012, 17:31

Yup, have to agree, this converter firmware is by far the best. I'm using a teensy atm on my Unicomp 122-Key Emulator, which is my daily driver at home, and it will be featured in my Raspberry M Mod, in which I will make a full computer out of a Model M Terminal board. (once my Raspberry Pi arrives, which will take some time)

Will you spend more time on deskthority in the future? I've seen, that you started to post more regularly here.

User avatar
Soarer

23 Apr 2012, 20:19

RC-1140 wrote:Will you spend more time on deskthority in the future? I've seen, that you started to post more regularly here.
I probably will - I'm a forum whore, I'll open my mouth wherever there are good postings! :lol:

User avatar
fruktstund

23 Apr 2012, 20:41

This is a fantastic converter. Used it for an old BTC (I think it was BTC at least) keyboard I found in my attic. Even NKRO was working, which was a bit of a surprise.

I think I broke something when I tried to put my Teensy and a new 5pin DIN on an experiment PCB board thingy (I have no idea what these are called in English lol). :(
The important part is I'm only getting a lot of "R05"s and "R04"s when debugging the converter with hid_listen now - and nothing works. You wouldn't happen to know what this means Soarer? I've recently discovered I'm quite skilled with breaking electrical components, so I hope this is not the case here. :?

User avatar
Soarer

23 Apr 2012, 21:07

fruktstund wrote:The important part is I'm only getting a lot of "R05"s and "R04"s when debugging the converter with hid_listen now - and nothing works. You wouldn't happen to know what this means Soarer?
It could just be a wiring error when you rebuilt it... is it rebuilt with the same connector type? and using the same keyboard? The most common error is getting the connector pins mirrored, and it can output misleading eror codes in that case.

User avatar
fruktstund

23 Apr 2012, 21:13

Soarer wrote:
fruktstund wrote:The important part is I'm only getting a lot of "R05"s and "R04"s when debugging the converter with hid_listen now - and nothing works. You wouldn't happen to know what this means Soarer?
It could just be a wiring error when you rebuilt it... is it rebuilt with the same connector type? and using the same keyboard? The most common error is getting the connector pins mirrored, and it can output misleading eror codes in that case.
Yeah, it seems the most likely that it's a wiring error, even though that would mean I wired stuff wrong three times in a row. I did it when I was a bit tired so who knows.
And yes, it's rebuilt with the same connector type, using the same keyboard.

I'll have to check as soon as I can, I guess.

User avatar
Soarer

23 Apr 2012, 22:16

fruktstund wrote:Yeah, it seems the most likely that it's a wiring error, even though that would mean I wired stuff wrong three times in a row. I did it when I was a bit tired so who knows.
And yes, it's rebuilt with the same connector type, using the same keyboard.
It's pretty unusual to actually kill anything (but it has been known). Although, it's odd that you'd make an error with parts you were already familiar with, let alone three times! Post a pic if you can, we might spot something.

User avatar
Grond

24 Apr 2012, 16:34

Is there any way to build such a converter without soldering?

User avatar
bhtooefr

24 Apr 2012, 16:37

Yes, although it'll take having a Teensy with pins, and then having the right jumper wires, and mounting it internally, I think.

User avatar
Grond

24 Apr 2012, 16:44

Yes, although it'll take having a Teensy with pins, and then having the right jumper wires, and mounting it internally, I think.
I'd like to make this converter for Model M terminal. Suppose I get a female RJ connector and jumper wires... would this work?

User avatar
bhtooefr

24 Apr 2012, 16:50

You'd probably need to solder the RJ connector.

However, 122-key terminal Ms (if it's one of those) have a six-pin connector internally that the cable hooks to.

User avatar
Grond

24 Apr 2012, 17:03

Yes it does! So what? Can I get a wire that goes from the six pin connector to the Teensy or what? Sorry for my ignorance!

User avatar
bhtooefr

24 Apr 2012, 17:30

You would need female jumper wires to go from the pins on the controller to the pins on the Teensy.

User avatar
Grond

24 Apr 2012, 17:36


User avatar
bhtooefr

24 Apr 2012, 17:46

That would work, yes.

User avatar
Grond

24 Apr 2012, 18:40

Thanks! :D

User avatar
fruktstund

27 Apr 2012, 01:29

Soarer wrote:
fruktstund wrote:Yeah, it seems the most likely that it's a wiring error, even though that would mean I wired stuff wrong three times in a row. I did it when I was a bit tired so who knows.
And yes, it's rebuilt with the same connector type, using the same keyboard.
It's pretty unusual to actually kill anything (but it has been known). Although, it's odd that you'd make an error with parts you were already familiar with, let alone three times! Post a pic if you can, we might spot something.
I've checked the wiring now and I'm confident it's correctly done! I also tried it out with a PS/2 connector, and I'm still getting the same problem.

When I measured the resistance between Vcc and GND I got about 0.420MΩ. I don't know if it's supposed to be that way or not, as I haven't really fiddled with electrical circuits since 7th grade, or something like that. :P
So an opinion about this from someone who's more knowledgeable about this kind of stuff would be greatly appreciated. ;)

User avatar
Soarer

27 Apr 2012, 02:51

fruktstund wrote:I've checked the wiring now and I'm confident it's correctly done! I also tried it out with a PS/2 connector, and I'm still getting the same problem.

When I measured the resistance between Vcc and GND I got about 0.420MΩ. I don't know if it's supposed to be that way or not, as I haven't really fiddled with electrical circuits since 7th grade, or something like that. :P
So an opinion about this from someone who's more knowledgeable about this kind of stuff would be greatly appreciated. ;)
Hmm, I get about 0.6MΩ measured on the Teensy, with no keyboard or USB attached. I'm not sure if the difference is significant. The input pins are perhaps the most vulnerable - without pull-up resistors, I get a few MΩ between the data pin and ground, a bit less between data and Vcc. (And the same for between clock and Vcc or GND). With the converter connected to USB, but no keyboard attached, you should see roughly +5V on the data and clock pins of the connector (actually, those should still be +5V with a keyboard attached).

User avatar
fruktstund

28 Apr 2012, 12:35

I seem to get approximately the same measurements as you Soarer, so this is beginning to get rather weird... I'll check my Teensy under my loupe later, to see if I can spot something strange!

User avatar
Soarer

28 Apr 2012, 13:53

Well, it doesn't mean the Teensy isn't damaged, but it seems to be basically OK.

What does hid_listen show when you connect the converter? (Run hid_listen, connect kb to converter, connect converter to usb).

User avatar
Soarer

05 May 2012, 15:34

fruktstund - did you spot anything?

nfc

08 May 2012, 23:05

Finally had the opportunity to test it... a masterpiece.
Info research, write phase, testing, debugging, documenting... really valuable work.

User avatar
dirge

09 May 2012, 09:14

What are the chances of the wyse boards working? Before I start messing on with mine.

User avatar
Soarer

09 May 2012, 13:42

nfc wrote:Finally had the opportunity to test it... a masterpiece.
Info research, write phase, testing, debugging, documenting... really valuable work.
:oops: Thanks! I'm happy enough if it's 'useful' :D
dirge wrote:What are the chances of the wyse boards working? Before I start messing on with mine.
Pretty slim, I'm afraid. I don't know much about them, or how many different types there are. Certainly it looks like the WY85 and WY-PCE boards would not work; they have completely different signalling (ref: kbdbabel).

User avatar
dirge

09 May 2012, 14:48

You're much better at this type of thing so would you offer some advice on how I could start getting this http://keyboardporn.com/mx-switch/wyse-wy60-terminal/ converted?

Just need to know how to start, have breadboard, teensy2, female connector for the WYSE. I'll try not to be a massive pain in the arse :)

Post Reply

Return to “Workshop”