Page 1 of 24

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

Unread postPosted: 22 Apr 2012, 23:54
by Soarer
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 2973 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 680 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 1911 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 2841 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.

Unread postPosted: 23 Apr 2012, 06:35
by Maarten
Oh nice work! Now all i need is a teensy :lol:

Unread postPosted: 23 Apr 2012, 06:59
by Kurk
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.

Unread postPosted: 23 Apr 2012, 11:10
by bhtooefr
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.

Unread postPosted: 23 Apr 2012, 13:43
by Soarer
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

Unread postPosted: 23 Apr 2012, 16:18
by litster
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!

Unread postPosted: 23 Apr 2012, 16:31
by RC-1140
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.

Unread postPosted: 23 Apr 2012, 19:19
by Soarer
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:

Unread postPosted: 23 Apr 2012, 19:41
by fruktstund
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. :?

Unread postPosted: 23 Apr 2012, 20:07
by Soarer
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.

Unread postPosted: 23 Apr 2012, 20:13
by fruktstund
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.

Unread postPosted: 23 Apr 2012, 21:16
by Soarer
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.

Unread postPosted: 24 Apr 2012, 15:34
by Grond
Is there any way to build such a converter without soldering?

Unread postPosted: 24 Apr 2012, 15:37
by bhtooefr
Yes, although it'll take having a Teensy with pins, and then having the right jumper wires, and mounting it internally, I think.

Unread postPosted: 24 Apr 2012, 15:44
by Grond
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?

Unread postPosted: 24 Apr 2012, 15:50
by bhtooefr
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.

Unread postPosted: 24 Apr 2012, 16:03
by Grond
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!

Unread postPosted: 24 Apr 2012, 16:30
by bhtooefr
You would need female jumper wires to go from the pins on the controller to the pins on the Teensy.

Unread postPosted: 24 Apr 2012, 16:36
by Grond

Unread postPosted: 24 Apr 2012, 16:46
by bhtooefr
That would work, yes.

Unread postPosted: 24 Apr 2012, 17:40
by Grond
Thanks! :D

Unread postPosted: 27 Apr 2012, 00:29
by fruktstund
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. ;)

Unread postPosted: 27 Apr 2012, 01:51
by Soarer
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).

Unread postPosted: 28 Apr 2012, 11:35
by fruktstund
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!

Unread postPosted: 28 Apr 2012, 12:53
by Soarer
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).

Unread postPosted: 05 May 2012, 14:34
by Soarer
fruktstund - did you spot anything?

Unread postPosted: 08 May 2012, 22:05
by nfc
Finally had the opportunity to test it... a masterpiece.
Info research, write phase, testing, debugging, documenting... really valuable work.

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

Unread postPosted: 09 May 2012, 08:14
by dirge
What are the chances of the wyse boards working? Before I start messing on with mine.

Unread postPosted: 09 May 2012, 12:42
by Soarer
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).

Unread postPosted: 09 May 2012, 13:48
by dirge
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 :)