Author Topic: XT/AT/PS2/Terminal to USB Converter with NKRO  (Read 893806 times)

0 Members and 1 Guest are viewing this topic.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #450 on: Thu, 23 August 2012, 15:36:55 »
1. The article has moved to the first post in this thread ;)

2. Depends...
Day-to-day regular use - yes.
Loading new .hex file with PJRC utility - yes (as long as only one Teensy is reset at a time).
Using hid_listen, scinfo, scboot, scwr, or scrd - no (they will only talk to the first one they find).

So, don't worry about having two plugged in, until you want to debug it or load a config! You should be able to get the new keyboard (running through the new adapter) basically working, at which point you should unplug the old one to allow any config to be loaded. If it doesn't all go smoothly, it might be easier to connect some other keyboard while trying to get the new one working, or to get its config sorted to your satisfaction :D

Upgrading might be as simple as just loading the new hex file. I can't remember if the config would need to be recompiled and reloaded as well, but I'm pretty sure the config text would not need to be modified at all.

Offline neocalm

  • Posts: 6
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #451 on: Sun, 26 August 2012, 11:46:34 »
Hello Soarer!

What a fantastic project, with my beginner skills I never thought I would be able to do anything with a 122-key Unicomp UB40856 keyboard, a $9 castaway from eBay. 

But a Teensy later.. it's been great so far!  Thank you very much!!

My only question is that I find very little about this UB40856 model and the keyboard doesn't quite work as I expect.  It's Keyboard Identifier is "0xAB 0x86".

More ominously, in the instructions you post:

Quote
If your terminal keyboard is not operating correctly, it might be because the wrong ID is set on the switches/jumpers. The first byte should not be AB.

When I look up "0xAB 0x86" I see there are several references to that Keyboard Identifier as:

1. The IBM 1397000 Terminal Emulator Keyboard "IBM Personal System/2 Host Connected Keyboard"

http://www.seasip.info/VintagePC/ibm_1397000.html

2. The Affirmative 1227T keyboard (Unicomp)

http://www.seasip.info/Misc/1227T.html

So why is "AB" so bad?  It looks like a complicated scancode map so I'm first going to see if this Unicomp has the JP3 "fix" that simplifies things (like the UB40T56)

http://geekhack.org/index.php?topic=10985.60

Later on I'd love to see if I can extend this to Bluetooth HID!  But: first things first.

Thanks again!

neocalm

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #452 on: Sun, 26 August 2012, 13:16:58 »
Well, AB1 is only 'bad' because it is used to identify the regular 101/102-key keyboards, and when the converter sees that code it uses set 2 to talk to the keyboard. The full terminal boards use set 3, and also need a command sent to them to get them to send release codes. Usually the only time they end up with an AB code is when someone has been playing with the jumpers!

However, some of the terminal emulator keyboards use set 2 by default - if you are not getting keys stuck down, could this be what you have? AFAIK, these keyboards have a normal PS/2 connector. Does pressing F13 output Shift+F1, for example? In that case, the JP3 fix would be useful indeed!


1 Actually, AB85 is an exception, and the converter uses set 3 for it.

Offline neocalm

  • Posts: 6
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #453 on: Mon, 27 August 2012, 23:43:09 »
Thanks, that makes sense on why "AB" is bad. 

Turns out that the board has no "JP3" populated - however, when I remove a "JP2" the Keyboard ID goes to "BFBF" which the Converter recognizes as Set 3.

Yes, the keyboard does have a normal PS/2 connector and it was shift-F1 for F13.

With Set 3 / JP2 removed, (or I suppose - with the Converter forced to Set 3) the scan codes look exactly like:

http://www.seasip.info/VintagePC/ibm_1397000.html

under "Set 3".

The only discrepancy is that the "7E" (numlock *) actually produces a Scroll Lock LED On on top of the Star - but I think that's coming from the Converter, not the keyboard itself.

To confuse me further I figured out that the Left Alt key didn't work with this particular keyboard, so it's off to repair that buckling spring. 

Anyway to summarize: With Set 3 forced I can map this whole "AB86" keyboard and enjoy the other keys!

Thanks again!

neocalm


Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #454 on: Tue, 28 August 2012, 05:48:04 »
Excellent!

Actually, the 'force' command only forces the converter to listen for set 3, it doesn't try to put the keyboard into a set 3 mode. That might be a feature I'll add at some point, but I would probably still use the jumper method for these keyboards.

There are always some discrepancies on those keys around the numpad, just because there's a variety of different legends used on different 122-key keyboards! Getting keys setup how you like them will probably mean doing a bit of remapping in the config file, and probably swapping some keycaps around as well!

Shame about the Left Alt - have you tried refitting the keycap a few times? That's sometimes all that's needed if a spring gets dislodged during shipping.

Offline neocalm

  • Posts: 6
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #455 on: Thu, 30 August 2012, 23:41:25 »
That's great to know the Converter doesn't set the Set.  So I did do something!  :)

Editing the config file and swapping keycaps has been a cinch.  You've really got a quality product here!

One dumb question: Is it possible to "remapblock" using actual HID Codes (e.g. "0x43") instead of <from_hid> names (e.g. "F9")?

Unfortunately, the left Ctrl key is acting up so I think there's definitely an issue there.  Off to the "bolt mod". 

And after that - I just purchased a Bluetooth HID module to see if I can get the Teensy/Converter to speak Bluetooth HID as well as USB HID. 

Thanks again Soarer - fantastic Converter!

neocalm

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #456 on: Fri, 31 August 2012, 16:23:09 »
One dumb question: Is it possible to "remapblock" using actual HID Codes (e.g. "0x43") instead of <from_hid> names (e.g. "F9")?
It isn't. I thought about it, but never got round to adding it, because it didn't really seem worth it! (After all, most key names are fairly obvious, so it would only help on the few oddball ones that you need to look up in the list otherwise).

And after that - I just purchased a Bluetooth HID module to see if I can get the Teensy/Converter to speak Bluetooth HID as well as USB HID.
Hmm, I'm not sure how that fits in, but carry on! :D

Offline neocalm

  • Posts: 6
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #457 on: Sat, 01 September 2012, 12:47:28 »
... well that ended pretty quick :(



I was all set for the "bolt-mod" with all the required bolts and nuts.  But!

Turns out that it wasn't the buckling spring or anything else.  This is my naked keyboard - three plastic sheets.  No matter how hard I press "Left-ALT" there's nothing.  I tried to sand down the contact, clean the contact - nothing.  Looks dead.  (The Converter is a great debug tool with the "naked" keyboard, by the way - thanks! :) )

And with 121 other functional keys, Left-ALT is a hard one to live without!!!

Well... looks like I paid $20 for a bunch of key caps and buckling springs... :(  (And a backup keyboard controller)

Off to find a fully functional (but cheap) keyboard!

neocalm


Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #458 on: Sat, 01 September 2012, 14:14:05 »
How frustrating :(

I guess that means that one of those traces on the plastic sheets has a break in it somewhere. If you can locate the break, then maybe some conductive paint would fix it, I dunno. Not sure if it's worth it unless you happen to have such paint already though. Alternatively, Unicomp might sell you just the membrane!

Offline N8N

  • Posts: 791
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #459 on: Sat, 01 September 2012, 16:59:29 »
Rear defogger repair kit?
Filco Majestouch-2 with Cherry Corp. doubleshot keys - Leopold Tenkeyless Tactile Force with Wyse doubleshots - Silicon Graphics 9500900 - WASD V1 - IBM Model M 52G9658 - Noppoo Choc Pro with Cherry lasered PBT keycaps - Wyse 900866-01 - Cherry G80-8200LPBUS/07 - Dell AT101W - several Cherry G81s (future doubleshot donors) (order of current preference) (dang I have too many keyboards, I really only need two)

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #460 on: Sat, 01 September 2012, 17:46:29 »
Rear defogger repair kit?
Yeah. Or from electronics suppliers (example).

I should say I've no idea how well or even if it would work, but in theory it might!

My reservation in this case is that I suspect a new membrane might not cost much more, so that's definitely worth enquiring about.

Offline Halvar

  • Posts: 403
  • Location: Germany
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #461 on: Sun, 09 September 2012, 10:38:49 »
Hi,

thank you Soarer for this great piece of software.

Another report of a successful little project here ... :-)

I recently found a Terminal Model M (No 1394312, 122 keys, German, cable with RJ45 connector) on eBay, and got it to work with almost no problems with the converter. In fact, I´m typing on it right now. I built the Teensy directly into the keyboard -- at the spot where the cable used to come out, now there´s a nice USB Type B connector where I can plug in an old USB printer cable. Since the original keyboard had no LEDs, I also drilled holes for those.

Looks and feels great so far, I am happyly clicking away ...  Thanks once again for all the work you put in this during the last year to make it as easy as possible for beginners like me.

I have one little problem left hoping for help ...

The EUROPE_1 (HID code 0x32) key, which has the sharp sign and the single quote sign on a German keyboard, doesn´t do anything in Windows 7 (nor in UBUNTU). The key press (and key release)  just isn´t registered at all. I used a few key testing programs in Windows to check this, as well as a normal text editor in Win7 and UBUNTU.

The strange thing is that in hid_listen.exe, the keystroke does register:

r53 +32 d32
rF0 r53 -32 u32

I first suspected the Windows HID driver, but since Linux had the same problem I don´t know where to search at the moment.

When I remap the key to "A" in my converter config file, the A works ok. So it´s not the physical key.
When I remap some other key to EUROPE_1, that other key has the same problem and doesn´t register when pressed either.

Is the HID output above right?
Does anyone else have this problem?

Halvar

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #462 on: Sun, 09 September 2012, 11:22:32 »
You're welcome! And good job building it in with LEDs, many people don't bother with them :-)

EUROPE_1 was a pain I thought I'd dealt with back in v0.992!! But, when I added the loadable configs, I moved the fix to legacy.sc. And I forgot to say anything in the docs about it :(  But anyway, the fix is easy - simply remap it to BACKSLASH. Linux had problems when both BACKSLASH and EUROPE_1 could be sent, so I had to hide EUROPE_1 (details).

Offline Halvar

  • Posts: 403
  • Location: Germany
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #463 on: Sun, 09 September 2012, 15:12:24 »
*danceandsing*

Thanks a lot Soarer, that did it!

I even did read the post that you linked to, but didn't  (<-- "didn't" now with a real ['] instead of [´]  :-) ) understand the consequences... Oh well...

Here's my current mappings in case someone has a similar board and doesn't know where to start ...

Code: [Select]
ifset set3
remapblock
# left hand side function keys
EXTRA_F1 MEDIA_MY_COMPUTER
EXTRA_F2 MEDIA_MEDIA_SELECT
EXTRA_F3 MEDIA_MAIL
EXTRA_F4 MEDIA_CALCULATOR
EXTRA_F5 MEDIA_WWW_HOME
EXTRA_F6 MEDIA_WWW_SEARCH
EXTRA_F7 MEDIA_WWW_BACK
EXTRA_F8 MEDIA_WWW_FORWARD
EXTRA_F9 LGUI
EXTRA_F10 APP
# function keys upper row
# block 1
F13 ESC
F14 MEDIA_VOLUME_DOWN
F15 MEDIA_VOLUME_UP
F16 MEDIA_MUTE
# block 2
F17 MEDIA_PLAY_PAUSE
F18 MEDIA_PREV_TRACK
F19 MEDIA_NEXT_TRACK
F20 MEDIA_STOP
# block 3
F21 SYSTEM_SLEEP
F22 SYSTEM_WAKE
F23 PRINTSCREEN
F24 PAUSE
# cursor block
# (central key)
LANG_4 DOWN
# Numpad
# first row left to right
ESC NUM_LOCK
NUM_LOCK SCROLL_LOCK
SCROLL_LOCK PAD_SLASH
EXTRA_SYSRQ PAD_ASTERIX
# right column 2nd to last row
PAD_ASTERIX PAD_MINUS
PAD_MINUS PAD_ENTER
# PAD_PLUS (lower right corner) not remapped
# #-key (European keyboards only)
EUROPE_1 BACKSLASH
endblock

« Last Edit: Mon, 15 October 2012, 09:34:26 by Halvar »

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #464 on: Sun, 09 September 2012, 16:55:31 »
Excellent! LOL, I hadn't even noticed the [´] in your post!

Thanks for posting the config, that looks like a layout quite a few people would like :)


Offline __red__

  • Posts: 194
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #465 on: Sun, 09 September 2012, 20:43:21 »
Another satisfied customer here - IBM Model F 122 key, 6110344 5 August 1986. :)

Offline Krogenar

  • The Kontrarian
  • * Esteemed Elder
  • Posts: 1266
  • Location: Eastchester, NY
  • "DO NOT BRING YOUR EVIL HERE." -Swamp Thing
    • Buried Planet
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #466 on: Tue, 18 September 2012, 13:16:51 »
I've got two broke-down Model M 122's headed my way -- looking forward to giving this converter a try. No soldering experience of any kind, however, so I hope I can manage this. I'm not entirely sure which kind of DIN socket I will need until I get the keyboards. Where did the rest of you guys find these parts? I found the PRJC site with the Teensy board, but finding DIN sockets (receptacles?) hasn't been easy.

The model number I'm getting is 1397980, which should be scan set 3. From what I can tell from the eBay photos it's going to be a 5-pin DIN 453222 connector (as seen in Soarer's documentation). But I can't find that connector. Can anyone with more knowledge provide a link to the connector I need? I can find a 5-pin, female (?) connector, but the angle of the pins doesn't seem right in the photos I'm finding.



The bottom four pins seem to describe a rectangle, and the connectors I'm finding are ... well, not the same.

Sorry to be such a bother. I promise that if I can pull this off I will deliver a well-photographed 'Soarer's Teensy Converter for Noobs' writeup!

GeekHack Artwork Resources | The Living GeekHack Logo Thread | Signature Plastics ABS Chip Scanning Project | Krog Flocks Around | Keyboard Color Scheme Archive | [GB] PBT DyeSub DSA Granite Set
More
Quote from: Samuel Adams
"If ye love wealth better than liberty, the tranquility of servitude better than the animating contest of freedom, go home from us in peace. We ask not your counsels or your arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that you were our countrymen."

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #467 on: Tue, 18 September 2012, 14:55:16 »
Something is escaping me here.

I am back where I was a month ago at post 451 trying to get a Model F-122 terminal to work.

Last winter I had it going, with v0.97 or whatever, this is my spare.

I got a new Teensy and I have downloaded v1.03. The Teensy seems to work fine, and I have used the instructions to program it (eg Open Hex File, Blink-Fast, etc) but the keyboard itself is not recognized. I have been through several iterations including reboots.

At first, I had my other board/Teensy (still running v0.997), and they may have been interfering with each other, so I disconnected it and am typing this from a PS2 keyboard.

How do I find an up-to-date config file, and compile it and run it, I am not a programmer. I remember doing it last year, but I can't seem to find the instructions any more.

I plan to update my first Teensy, too, but I want to make sure that this will work for me. I am running Windows 7 and Ubuntu 12.04

Thank you!
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #468 on: Tue, 18 September 2012, 16:00:33 »
Can anyone with more knowledge provide a link to the connector I need? I can find a 5-pin, female (?) connector, but the angle of the pins doesn't seem right in the photos I'm finding.

It's usually described as a 270 degree 5 pin DIN (or sometimes 240 degree), whereas the more common ones you're probably seeing are 180 degree (which would be right for the XT or AT). Another tip for searching is to look for '5 way' as well as '5 pin'.

A 6 pin DIN is also fine for the socket, and might be easier to find. Would you like a trailing socket or panel mounted? (Those are just the first ones I found on ebay, there are probably nicer looking panel mount ones somewhere...).

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #469 on: Tue, 18 September 2012, 16:43:33 »
Something is escaping me here.

I am back where I was a month ago at post 451 trying to get a Model F-122 terminal to work.

Last winter I had it going, with v0.97 or whatever, this is my spare.

I got a new Teensy and I have downloaded v1.03. The Teensy seems to work fine, and I have used the instructions to program it (eg Open Hex File, Blink-Fast, etc) but the keyboard itself is not recognized. I have been through several iterations including reboots.

Does it recognize the keyboard if you program it with v0.997? There isn't any real difference in the core converter code between that and v1.03 though.

(Don't program it with Blink-Fast.hex though - that's where you'd choose one of the converter hex files instead).

At first, I had my other board/Teensy (still running v0.997), and they may have been interfering with each other, so I disconnected it and am typing this from a PS2 keyboard.

How do I find an up-to-date config file, and compile it and run it, I am not a programmer. I remember doing it last year, but I can't seem to find the instructions any more.

I plan to update my first Teensy, too, but I want to make sure that this will work for me. I am running Windows 7 and Ubuntu 12.04

Thank you!


Have you also downloaded the v1.0 zip, which has the latest documentation, configs and tools etc?

I've stopped fully updating the OP/article, preferring downloaded docs, but I haven't removed anything from it.

Improving the docs is the next thing on my to-do list, so highlighting any gaps to me is very useful! One big sub-task will be going through this thread again, making sure that useful stuff is put in the docs.

Let's get the keyboard recognized first, and then worry about the config :D


Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #470 on: Tue, 18 September 2012, 17:11:27 »
Thank you.

I did this last year with an F-122 in which I installed the Teensy internally and used v0.997 (I think, and I don't know how to find out?) which worked great after some initial jiggling. When I upgraded from Windows XP to 7 a few months ago, it still worked perfectly and automatically without my having to do anything. It is my daily driver and I have not messed with it at all.

I have a second F-122 which I want to leave with a stock cable and an outboard box. As of now, it is the ghetto alligator clip route until I get it running dependably, then I intend to have a female PS2 socket on a pigtail to the box for use with other boards. (these are 6110345 and 6110347 part numbers without DIP switches, in case that matters)

The Teensy seems to be recognized and take its programming, but when I actually plug the keyboard into it, the keystrokes don't register. I am using v1.03 and whatever prjc has on its site right now, to try to have the latest versions of everything.

And, next time I try to boot up with the old board, I get a keyboard error and have to hot plug it later to get it running, if that tells you anything.

There is a real possibility that my wiring is not good enough. I also have an F XT so I plan to make a female socket and run it into the Teensy, to see if it gets recognized.

There is no need to re-do the config, for now, since the old one is working?

Thanks for your help.

State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #471 on: Tue, 18 September 2012, 17:59:18 »
I think the old config will be fine, and anyway we won't need one yet, to get the keyboard basically working.

The keyboard error is a bit odd, but I'm not sure it tells me anything. The most likely explanation is that Windows is somehow confused by the two versions having the same IDs, but different USB descriptors.

When you plug the keyboard in, is that with the USB still plugged in? The keyboard needs to be plugged into the converter before the USB side is connected.

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #472 on: Tue, 18 September 2012, 19:54:18 »
I think that I have done it several ways.

My assumption is that the preferable method is to boot using a standard PS2 keyboard, then plug in the USB connector.

I think that I programmed the Teensy, initially, without anything connected to it. Clearly, I will need to start over and re-program the Teensy.

Once it is working, will I have to change anything in order to switch between an F XT and an F-122? Does it matter which is connected when I do the programming?

State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #473 on: Tue, 18 September 2012, 20:48:42 »
I think that I have done it several ways.
I was just checking, since with the Teensy built-in to your other keyboard, the question of which order to connect things doesn't arise :)

My assumption is that the preferable method is to boot using a standard PS2 keyboard, then plug in the USB connector.
Once it's all programmed and working, it should work fine during boot as well.

I think that I programmed the Teensy, initially, without anything connected to it. Clearly, I will need to start over and re-program the Teensy.
No... I don't mean when programming the Teensy. For that, it doesn't matter if the keyboard is connected or not. Once it is programmed and you want to use it as a converter though, the keyboard has to be connected first, so that the Teensy can query it and decide which mode to use when it powers up. If no keyboard is connected, then the converter decides it is an XT keyboard.

Once it is working, will I have to change anything in order to switch between an F XT and an F-122? Does it matter which is connected when I do the programming?
It will auto-detect.

Have you got the hid_listen program? There might be some debug output that would help us figure out what's wrong.

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #474 on: Tue, 18 September 2012, 21:23:31 »
I do have hid_listen but there is nothing for it to listen to ......

Are the pins on the XT plug the same as the AT style? I am plugging the XT in to an AT-to-PS2 adapter, and have a female PS2 connected to the Teensy.

I can't find an XT pin diagram.
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #475 on: Wed, 19 September 2012, 04:56:02 »
Odd. Once the Teensy is programmed with the converter code, hid_listen should at least connect. If hid_listen is started before the teensy is plugged in (or before hitting the 'Run' button in the Teensy loader), it should show some info even if no keyboard is connected.

Does the LED light up at all, either when the Teensy is plugged in or when you press keys?

Yes, the XT plug pinout is the same as the AT.

Please don't plug in lots of precious keyboards unless you are absolutely sure that power and ground are not reversed... from the article...

Important note - these 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. 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!

If in any doubt, post pics of the wiring :)

Offline Krogenar

  • The Kontrarian
  • * Esteemed Elder
  • Posts: 1266
  • Location: Eastchester, NY
  • "DO NOT BRING YOUR EVIL HERE." -Swamp Thing
    • Buried Planet
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #476 on: Wed, 19 September 2012, 07:03:55 »
It's usually described as a 270 degree 5 pin DIN (or sometimes 240 degree), whereas the more common ones you're probably seeing are 180 degree (which would be right for the XT or AT). Another tip for searching is to look for '5 way' as well as '5 pin'.

A 6 pin DIN is also fine for the socket, and might be easier to find. Would you like a trailing socket or panel mounted? (Those are just the first ones I found on ebay, there are probably nicer looking panel mount ones somewhere...).

Thank you Soarer! I think I'm going to try a panel mount because I'd rather not alter the keyboard itself until I'm more confident in my soldering/electronics skill. Back on page 10 of this thread someone posted a really great adapter build that I'm going to try to duplicate. Someone should offer this converter as a kit somewhere. Thanks for those links -- the 6 pin looks like it will fit.
GeekHack Artwork Resources | The Living GeekHack Logo Thread | Signature Plastics ABS Chip Scanning Project | Krog Flocks Around | Keyboard Color Scheme Archive | [GB] PBT DyeSub DSA Granite Set
More
Quote from: Samuel Adams
"If ye love wealth better than liberty, the tranquility of servitude better than the animating contest of freedom, go home from us in peace. We ask not your counsels or your arms. Crouch down and lick the hands which feed you. May your chains set lightly upon you, and may posterity forget that you were our countrymen."

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #477 on: Wed, 19 September 2012, 07:54:01 »
It's usually described as a 270 degree 5 pin DIN (or sometimes 240 degree), whereas the more common ones you're probably seeing are 180 degree (which would be right for the XT or AT). Another tip for searching is to look for '5 way' as well as '5 pin'.

A 6 pin DIN is also fine for the socket, and might be easier to find. Would you like a trailing socket or panel mounted? (Those are just the first ones I found on ebay, there are probably nicer looking panel mount ones somewhere...).

Thank you Soarer! I think I'm going to try a panel mount because I'd rather not alter the keyboard itself until I'm more confident in my soldering/electronics skill. Back on page 10 of this thread someone posted a really great adapter build that I'm going to try to duplicate. Someone should offer this converter as a kit somewhere. Thanks for those links -- the 6 pin looks like it will fit.

Ah, the trailing socket wouldn't mean modifying the keyboard, it would be for making an adapter that looks something like this (although this isn't a Teensy, it has a trailing socket):

4440-0

I like this approach because it allows a smaller box to be used, the hole for the cable is easy to make, and a cable tie is sufficient to stop the cable being pulled out. But a panel mount socket in a slightly bigger box is also good!
« Last Edit: Wed, 19 September 2012, 08:03:45 by Soarer »

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #478 on: Wed, 19 September 2012, 09:07:21 »
Allow me to clarify the situation and reduce misunderstanding.

I have my "old" rig which is a Model F 122-key terminal in which I installed a Teensy 2.0 internally last winter using, I think, v0.997 under XP. After the initial process and adjustments, it has worked perfectly ever since. Upon boot-up, hid_listen.exe sees and hears it just fine.

My "new" rig is a fresh Teensy 2.0 that I have programmed with v1.03 and the latest software set that I downloaded from pjrc.com this week. I have an F-122 terminal board and an F XT to get up and running, along with various cables and adapters. I have referred to the same pinouts that I have used before, and checked the wiring for continuity.

Booting up with a Dell PS2 keyboard works fine, but hid_listen.exe does not see it. It does nothing, just a blank screen.

When I plug in the Teensy, hot, I get a fast blink until I press the button on the Teensy. Running hid_listen.exe returns a "Waiting for Device" message and an endless string of dots marching across the screen, but no response to pressing a key. I am doing this with the XT now, let me shut down everything and try it again with the 122-key terminal.


PS - not to gloat, but I hit the jackpot a few months ago and got an actual beige IBM female 270 degree DIN cable connector! it was in a big bin of dusty cables in a salvage store. the aluminum is a little tarnished on the knurled ring, but it even screws into the standard 6110347 cable end! there was something that looked like an odd serial connector on the other end.
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #479 on: Wed, 19 September 2012, 10:01:14 »
When I plug in the Teensy, hot, I get a fast blink until I press the button on the Teensy.

That's exactly what would happen if you programmed it with blinkfast instead of programming it with the v1.03 converter hex file... you should follow the instructions on the PJRC site except where it says to open blink-fast.hex - at that point you should open Soarer_at2usb_v1.03_atmega32u4.hex instead.

As a side note, hid_listen is more specific than its name implies - it can only listen to something that has a USB endpoint setup in the right way. Generally this means a Teensy running code derived from the USB libraries that PJRC provide, such as my converter.

PS - not to gloat, but I hit the jackpot a few months ago and got an actual beige IBM female 270 degree DIN cable connector! it was in a big bin of dusty cables in a salvage store. the aluminum is a little tarnished on the knurled ring, but it even screws into the standard 6110347 cable end! there was something that looked like an odd serial connector on the other end.

That sounds a bit like the keyboard adapter cable from a 3270 PC, but that has a 180 degree 5 pin plug attached to the D connector as well. I've got one of those, but I haven't used it for anything yet :)

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #480 on: Wed, 19 September 2012, 18:57:06 »
Thank you. Do I need to somehow de-program ore re-format the Teensy from Fast-Blink?

I used the Teensy.exe program and selected "Open Hex File" to the "Soarer_at2usb_v1.03_atmega32u4.hex" file and selected "Reboot"

I also did it selecting "Program" and whatever other choices it offered, but it never seemed to "take" and always looked like fast-blinking after every re-boot.

Thanks for continuing to work with me. I don't remember it being this hard last winter.

PS - my plug must have been vaguely similar to what you showed, but the housing is mostly beige rubber except for the aluminum ferrule
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #481 on: Wed, 19 September 2012, 20:03:37 »
Hmm, strange. Programming it with the converter hex ought to remove the blinking.

Just to confirm, here's an example of the sequence...
1. Run the loader (teensy.exe)
2. "Open Hex File", select Soarer_at2usb_v1.03_atmega32u4.hex, click OK.
3. Press the reset button on the Teensy.
4. "Program" (should show a progress bar for about 2 seconds)
5. "Reboot"

After that, the LED should not be blinking, and hid_listen should be able to connect and not just show a string of dots. Also, the keyboard devices should show up in Device Manager.

For Teensy 2.0, the correct file to use is Soarer_at2usb_v1.03_atmega32u4.hex
For Teensy++ 2.0, the correct file to use is Soarer_at2usb_v1.03_at90usb1286.hex

It doesn't matter for programming (or for hid_listen, or for the devices appearing) whether you have a keyboard connected or not.

Pressing the reset button could be done earlier instead, either before opening the hex file, or before running teensy.exe, it doesn't matter.

The teensy loader remembers the last file used, so if you repeat the sequence you won't need to open the hex file again, as long as it shows the correct file name in the status bar at the bottom of the window...



If the blinking has gone away, you should have a working converter. If you didn't have a keyboard connected while programming, you'll need to unplug the USB, connect the keyboard, then reconnect the USB.

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #482 on: Thu, 20 September 2012, 07:19:56 »
"Something" happened.

I went through your steps again. After opening the hex file, progress bar did not show, and the "Press Button to Activate" keeps coming on. I have unplugged and hot plugged the USB connector a few times.

hid_listen.exe does make a response, however, and I get


Device disconnected.
Waiting for new device: ............................
Listening:
wEE

remaining: FFFC

Keyboard ID 0000
Code Set: 1

then, nothing
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #483 on: Thu, 20 September 2012, 09:34:41 »
Now I am getting a little worried. I plugged an ordinary PS2 keyboard into the Teensy, and hid_listen.exe responded to key presses. I got the same response to any key I pressed, but it was happening and the Teensy is alive.

I am sure that I did not reverse the wiring itself, but it may be possible that some of my alligator clips touched and shorted each other.

These keyboards I bought off ebay as "working" but that might have meant that the keys moved when you pressed them.

Now I have a few specific questions:

1. How can I test a keyboard to see whether it is dead? I have a soldering iron and am good with my hands, but have little real electrical wiring experience.

2. I understand that the XT and AT are incompatible even though the plugs look the same. When I use a straight DIN-to-PS2 adapter, can I be sure that the pinouts are the same on the XT cable?

3. Where can I find the layout of the long rectangular block of pins on the F-122 board? I was testing continuity on the actual cord from the keyboard, and it seems like the layout pattern and colors (I know to never trust color, but these are all IBM parts ..... ) are different between male and female cords.

When I was monkeying around last winter, the pin connections on the circuit board seemed to make a difference.

I could have sworn all this was in the wikis. Oh why oh why did I not download them and save them?
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #484 on: Thu, 20 September 2012, 10:43:04 »
OK, progress, it seems to be programmed now :-)

Since you're getting some response when pressing keys, at least the power and ground are not reversed! Getting the same code for any key sounds like it's an error code - errors begin with an uppercase R or W, while successful reads and writes use lowercase. The most likely is that clock and data are swapped over, or that data is not connected.

1. Let's come back to this later. A good way to test them is to have a working Soarer converter!

2. A DIN-to-PS2 that works for AT will work for XT as well (with my converter, of course).

3. Never trust the colours; IBM wasn't even consistent with itself!!

Wikis... indeed :(

None of my converter stuff was in the wiki, thankfully it's all still here in this thread. Most pictures and all attachments have been lost though. There was an IBM wiki, although I believe that its content was also all in Deskthority's wiki, and it may well have more now.

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #485 on: Thu, 20 September 2012, 11:02:09 »
I keep working on this instead of my "real" work.

My working converter is hard-wired to the old F-122, I am a bit reluctant to dismantle it but I probably have no choice.

Thank you so much.
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #486 on: Thu, 20 September 2012, 11:10:16 »
Don't dismantle your working one! I meant we should be able to get this new one working :)

What was the code that was being printed to hid_listen when you pressed keys?

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #487 on: Thu, 20 September 2012, 12:38:59 »
Using a 10-year-old Compaq rubber dome board with PS2 connector, with each key press I get about 15-25 copies of

R05
and R06
with a rare R04

randomly dispersed but not in the same order or the same pattern
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #488 on: Thu, 20 September 2012, 13:28:35 »
That's a mix of Timeout and Start Bit errors, with a rare Internal error. One possible cause of that is clock and data being swapped over. It's safe to swap them, to see if that is the problem.

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #489 on: Thu, 20 September 2012, 16:47:40 »
Thanks, but going by your diagram at the beginning of the thread, I think I have it wired right.

Is the converter supposed to work on pretty much any standard keyboard, as-is?
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #490 on: Thu, 20 September 2012, 17:03:03 »
I know you do, but there must be something wrong somewhere! :D

Pretty much any standard keyboard, yes.

The error codes you're getting are the same as the wierdo Monterey that is known not to be handled, but it's unlikely to be the same issue. Other problems can give the same codes. However, it is possible - I don't think the converter has seen much testing with rubber domes!!

Going by your previous questions, do you already have an XT keyboard and a standard 5-pin DIN to PS/2 adapter? If so, I think it would be safe to try that now, since the rubber dome hasn't gone up in smoke :)
« Last Edit: Thu, 20 September 2012, 17:09:14 by Soarer »

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #491 on: Thu, 20 September 2012, 20:50:25 »
Yes, the XT is what I have been working with. I gave up the alligator clips and have been twisting and taping wires to switch back and forth between rigs.

I have a female 240 degree DIN socket and a female mini-DIN, both on pigtails, that I connect to the Teensy.

I started off with the F-122, then tried the XT. I have hooked both up several times. The screenshot below is what I get with the XT and adapter.

I checked the wiring in the standard F-122 cable, and it is as shown in your diagram at the beginning of this thread and in the diagram below. I hooked up the wiring from my female DIN 240 cable pigtail to the Teensy accordingly.

My dream is that the Teensy would sacrifice itself and the keyboard be undamaged, but I feel sure that the opposite is true.

I have an F-122 in pieces in the garage, waiting for a full mod. I did not test it before taking it apart, assuming that it would be functional. When I get it back together, I can use it to see whether I managed to cook this new stock one.

State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #492 on: Fri, 21 September 2012, 06:12:05 »
I think the only way to fully cook the keyboard is to connect power and ground in reverse.

Other permutations of mis-wiring it may damage either the keyboard's output buffer or the Teensy, but, while I haven't analyzed all possibilities, many permutations do not seem to cause damage.

Similarly, quite a few possible shorts don't cause damage either, e.g. clock/data/ground in any combination.

Shorting power to clock or data could damage the keyboard's output buffer or the Teensy.

Shorting power to ground shouldn't damage either keyboard or Teensy. It will at least trip the fuse in the USB port of the PC, and quite possibly reboot the PC.

For any random error, the odds are good for the keyboard surviving.

However, if swapping from the PS/2 rubber dome (which gives the errors on hid_listen) to the XT with adapter is just a case of plugging it in (not rewiring), and if the XT gives nothing on hid_listen when pressing keys, then that's not looking good for the XT.

(The XT is expected to report an ID of 0000 by the way. The converter is unable to distinguish it from having nothing connected, since the XT doesn't support two-way communication).

Forgive me if I keep on questioning your wiring, but logically either...
1. there is something wrong with it which is stopping this working, or
2. there was something wrong with it that killed something, or
3. the 122 and XT were both dead already (unlikely).

A sanity check on the power and ground wiring is worth doing, I think, to put our minds at rest. Continuity tests all the way from the Teensy pins to the pins on the CPU (with the converter unpowered, of course!). The CPU has power on pin 40 and ground on pin 20...

« Last Edit: Fri, 21 September 2012, 06:32:18 by Soarer »

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #493 on: Fri, 21 September 2012, 07:07:42 »
This is indeed disappointing, if I have carelessly wrecked 2 Model Fs.

Is there a relatively simple way to test, and, hopefully, to fix, some of the more minor forms of damage that you described?

Thanks again for all your help.
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #494 on: Fri, 21 September 2012, 09:00:31 »
Well I'm not sure that you have totally wrecked them, unless you think you might have applied power backwards at some point.

The keyboard's output buffer chip is available, cheap, and only 14 pins so relatively easy to desolder. Testing it is tricky without either removing it or using an oscilloscope though, so we should try to eliminate other possibilities first.

Measuring the current seems to be a reliable way to tell if the board is wrecked from backwards power being applied. Normally the keyboard would draw a little over 100mA, but significantly less when dead.

(I say seems to be, because it's only been measured once on a dead board, and there were other factors perplexing me about that situation, as you'll see in the conversation there with Paranoid. However, reduced current draw is logical for a dead board).

Of course, it's still worth doing the sanity check on power and ground first, which will confirm that they are correct all the way through the chain of connections.

Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #495 on: Sat, 22 September 2012, 08:19:33 »
This is going to have to get shelved for a few days.

- IF - I did apply the power backwards, is the situation hopeless, or is there a particular piece (relatively easily identified and accessed) that I could replace?
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #496 on: Sat, 22 September 2012, 08:43:40 »
OK. I'm sorry that this hasn't gone as smoothly for you as it did last time.

Trouble is, we don't know how much gets damaged by reverse power. Almost certainly the CPU - they are available, but would need programming, and it's quite a task to desolder. If I get round to writing the code, replacing the CPU with a Teensy could be an option.

The big worry is that it damages the square silver capacitive sensing chip, which isn't available (except in old IBM keyboards). I'd like to get hold of a damaged controller to be able to find out whether it dies or not.


Offline fohat.digs

  • * Elevated Elder
  • Posts: 6462
  • Location: 35°55'N, 83°53'W
  • weird funny old guy
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #497 on: Sat, 22 September 2012, 08:54:18 »
Depending on how this all plays out, I can send you some dead parts that have no more use to me, for science, man!
State Freedom Caucus News 2024
Missouri state Senator Nick Schroer sponsors a bill that would allow senators to duel one another — in the Senate chambers! – legally.

Offline Soarer

  • * Moderator
  • Thread Starter
  • Posts: 1918
  • Location: UK
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #498 on: Sat, 22 September 2012, 09:06:32 »
Thanks! I'm still hopeful that it's not that much of a disaster though :)

Offline kishy

  • Posts: 1576
  • Location: Windsor, ON Canada
  • Eye Bee M
    • http://kishy.ca/
Re: XT/AT/PS2/Terminal to USB Converter with NKRO
« Reply #499 on: Mon, 24 September 2012, 08:59:10 »
If the controller is toast, let's not forget that dfj was making a full replacement...

I really must hop back on IRC and check on that one of these days.
Enthusiast of springs which buckle noisily: my keyboards
Want to learn about the Kishsaver?
kishy.ca