geekhack

geekhack Projects => Making Stuff Together! => Topic started by: Soarer on Fri, 22 April 2011, 08:00:58

Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 22 April 2011, 08:00:58
Since v1.0, this mod can also be found on Deskthority (http://deskthority.net/workshop-f7/xt-at-ps2-terminal-to-usb-converter-with-nkro-t2510.html).



Introduction


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".

There are versions for Teensy 2.0 (http://www.pjrc.com/store/teensy.html) and Teensy++ 2.0 (http://www.pjrc.com/store/teensypp.html). I recommend the Teensy 2.0 for this (it's cheaper), but sometimes PJRC (http://www.pjrc.com) don't have any in stock!


Features


Keyboard protocols supported:
Configurable Features: (v0.997+)
Other Features:


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.


Documentation


The latest 'full' zip contains complete documentation covering all aspects of the converter including the tools, config commands, key codes etc.

This post contains the basics, but hasn't been updated much since about v0.996. I'll keep it accurate, but not complete.


Construction


Wiring Info

Code: [Select]
Conn.       Teensy
GND -------- GND
Vcc/+5V ---- Vcc
Data ------- PD0
Clock ------ PD1


Teensy pins

See PJRC for Teensy pinouts (http://www.pjrc.com/teensy/pinout.html).


Connectors

I wired mine to a PS/2 socket, and then use adapters to connect the others.

kbdbabel has masses of connector info (http://www.kbdbabel.org/conn/index.html). So much that it can be hard to find the one you want! I've included here the most common connectors used with this converter:

Terminal keyboards usually have a 5 pin, 270 degree, DIN connector...
(http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png)

...or sometimes this 8P5C connector...
(http://www.kbdbabel.org/conn/kbd_connector_ibmterm.png)

XT and AT keyboards use the same 5 pin, 180 degree, DIN connector and pinout (top), while PS/2 keyboards use a 6 pin mini-DIN connector (bottom)...
(http://www.kbdbabel.org/conn/kbd_connector_ps2.png)

RT keyboards use a 6 pin rectangular connector...
(http://www.kbdbabel.org/conn/kbd_connector_ibmrt.png)

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!


Pull-up resistors

In nearly all cases, these resistors are not needed.

But, if the keyboard has a long cable, I recommend adding two pull-up resistors of 1Kohm - one between Clock and +5V, the other between Data and +5V. These can really help to clean up a dirty signal (see here (http://geekhack.org/index.php?topic=14290&msg=269052#msg296052)).


LEDs

Optionally, lock LEDs can be wired up. Useful if your keyboard doesn't have them!
The outputs are active high (each pin puts out +5V when it wants to light the LED).
A resistor is needed inline with each LED. (The value needed depends on the type of LED, 1Kohm is a good starting point for modern high-brightness types).
The pins used differ between Teensy and Teensy++:

Teensy 2.0 (ATMEGA32U4):
Code: [Select]
CapsLock LED ------ PF5
NumLock LED ------- PF6
ScrollLock LED ---- PF7

Teensy++ 2.0 (AT90USB1286):
Code: [Select]
CapsLock LED ------ PD3
NumLock LED ------- PD4
ScrollLock LED ---- PD5


Installation


There's great instructions (http://www.pjrc.com/teensy/loader.html) on the PJRC site that cover loading a hex file into the Teensy, for any common OS.


Troubleshooting


Diagnostic output

The converter outputs some cryptic diagnostic information when in use, and it's especially useful to see what is happening when it starts up.

The hid_listen (http://www.pjrc.com/teensy/hid_listen.html) program can display this output, which mostly just consists of bytes read from and written to the keyboard when things are working correctly.


Keyboard IDs

This section is mostly only relevant to terminal keyboards. The converter uses the ID to decide between using scan code set 3 for terminal keyboards, or extended scan code set 2 for 'regular' keyboards.

By using hid_listen, you can see what ID your keyboard has by looking at the two bytes read back after the get ID command (wF2 rFA).

As of v0.996, the ID and scan code set selected is also printed in a more readable way:
Quote
Keyboard ID: BFBF
Code Set: 3

Terminal keyboards often have DIP switches on the back panel, or alternatively a pin header on the PCB that you can fit jumpers to, which configure the keyboard's ID code. The ID is a 16-bit number, but commonly fewer than 16 switches/jumpers are fitted meaning it's not possible to select all of the bits. The default value with no jumpers fitted, or with all the DIP switches in the 'open' position, is BFBF.

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.


Known Issues


Weirdo Monterey International Corp. FKF456K-104 AT keyboard with 3-way A,X,S switch on the back (http://geekhack.org/index.php?topic=17458.msg362823#msg362823)
-- should be fixed as of v1.10, but hasn't been verified

Dell M6300 (BIOS rev A14) and Dell Inspiron 630m have incompatible/defective BIOS (http://geekhack.org/index.php?topic=17458.msg563473#msg563473)
-- possibly fixed by USB compliance improvements in v1.03, or by preventing debug output in boot mode in v1.11


History


v1.12 - added workaround for Linux bug which causes Delete key not to repeat - details (http://geekhack.org/index.php?topic=17458.msg927471#msg927471).
v1.11 - added RT keyboard support, added boot mode indication, prevented debug output in boot mode - details (http://geekhack.org/index.php?topic=17458.msg844653#msg844653).
v1.10 - improved documentation, added 'almost' PC/XT support, added aux key inputs - details (http://geekhack.org/index.php?topic=17458.msg745533#msg745533).
v1.03 - fixed bug which caused the converter to lose config or reboot after using the scrd tool, and fixed minor USB errors revealed by using the Command Verifier (http://www.usb.org/developers/tools/) compliance testing tool.
v1.02 - fixed bug which could cause the converter to lock up if a key was pressed at certain times during system boot - details (http://geekhack.org/index.php?topic=17458.msg609833#msg609833).
v1.01 - fix bug in jump to bootloader affecting Teensy++ - details (http://geekhack.org/index.php?topic=17458.msg604863#msg604863).
v1.0 - adds jump to bootloader, scboot tool, scinfo tool, documentation, settings protocol improvements, linux and macosx tools, and reduced hex size - details (http://geekhack.org/index.php?topic=17458.msg579614#msg579614).
v0.997 - adds user-definable remaps, macros, layers, selects, media keys, and config tools - details (http://geekhack.org/index.php?topic=17458.msg527414#msg527414).
v0.996 - fix for 'slow' responding keyboards, improved robustness when keys are being pressed before init has completed, alternative layouts for terminal keyboards - details (http://geekhack.org/index.php?topic=17458.msg424335#msg424335).
v0.995 - quick fix for 122-key mapping (top right numpad key is 'pause'), and simplified the code testing which keyboard type is attached.
v0.994 - adds suspend support, with remote wake-up - details (http://geekhack.org/index.php?topic=17458.msg345109#msg345109).
(v0.993 wasn't stable enough to subject you to!)
v0.992 - fixes minor incompatibility with Linux (backslash key not repeating etc.) - details (http://geekhack.org/index.php?topic=17458.msg339706#msg339706).
v0.99 - first public release


Downloads
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mr. Perfect on Fri, 22 April 2011, 08:38:35
Impressive work there. It's tempting to make one of these even for boards that work on USB, just to get the NKRO.

Quote

Optionally, lock LEDs can be wired up.
The outputs are active high (each pin puts out +5V when it wants to light the LED).
A resistor is needed inline with each LED. (The value needed depends on the type of LED, 1Kohm is a good starting point for modern high-brightness types).


Is this for extra LEDs on the converter? I'm assuming the LEDs on the boards themselves are controlled by the boards, or doesn't the lock message get passed to the board?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 22 April 2011, 08:51:12
Some boards don't have LEDs (e.g. XTs and Terminals), and in the case of the XT the protocol doesn't support them. The converter does pass LED state to the keyboard when it can though!

And yes, for a board like a Filco (which has a dual USB/PS2 interface), you could use it in PS2 mode and route it through this converter to get full NKRO (and any other fancy features that have yet to be enabled).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: HaveANiceDay on Fri, 22 April 2011, 09:52:48
This looks really interesting. Especially the Filco NKRO USB Mod possibilities.
I don't need NKRO, but somehow I crave it :P
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: hasu on Fri, 22 April 2011, 20:28:26
Nice work!

I tried your converter with PS/2 keyboard on Mac and confirmed NKRO works fine. Great!
My converter's NKRO feature fails on Mac. It seems I have to check your report descriptor later.

Quote
Full NKRO, if the keyboard supports it (even on Macs!).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 23 April 2011, 04:12:30
Thanks, hasu!

I might need to add in your fix for the SET_IDLE problem on OS-X (http://geekhack.org/showwiki.php?title=Island:14290&p=307392&viewfull=1#post307392). I have made changes to that part of the code, but I have no OS-X machine to test it on. If I am lucky it will work!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 23 April 2011, 10:18:52
Quote from: ripster;336118
If you guys ever fix the OSX bug tell Nopoo and the Ducky G2 engineers (probably the same PLUM Corp. firmware designer).

 
Which one? My firmware was already working better than theirs many weeks ago.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: ch_123 on Sat, 23 April 2011, 11:43:14
Quote from: Soarer;336036
Thanks, hasu!

I might need to add in your fix for the SET_IDLE problem on OS-X (http://geekhack.org/showwiki.php?title=Island:14290&p=307392&viewfull=1#post307392). I have made changes to that part of the code, but I have no OS-X machine to test it on. If I am lucky it will work!

 
I'd be willing to check this out whenever I get my Teensy and sufficient free time.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 23 April 2011, 12:37:09
Quote from: ch_123;336196
I'd be willing to check this out whenever I get my Teensy and sufficient free time.

 
That would be great, thanks!

I think the most likely problem (if any) is an occasional dropped keystroke - but it might well only happen when a keypress is made WHILE it's processing the idle AND also receiving updated LED state!! Also, if it's not using the XT protocol, it will simply ask the keyboard to resend the missed byte - the only sign that something has gone wrong will be that the LED on the Teensy lights up for a couple of seconds :-)

Or... it could fail in some way I haven't though of at all yet!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Sun, 24 April 2011, 00:21:06
Just built, waiting for my terminal F to come tomorrow.
adding the LEDs lets you test for a correct download and basic behaviour tho
Hint:  the Radio Shack 276-0150 breadboard is real nice for this as it has pins in twos and threes pre-shorted so you don't have to wire everything with solder bridges.  It's $2 and readily available, and it's also small unlike a lot of the boards I saw.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 24 April 2011, 04:23:11
Ah, Hak Foo... just spotted your question on IRC about the devices that the converter uses...

It's a composite device with [strike]four parts to it:
1. Boot keyboard
2. NKRO keyboard
3. Media and power keys
4. Debug channel[/strike]

edit: I really shouldn't answer these things from memory! Four was the plan at one point, but it ended up fitting into three:
1. Boot keyboard
2. Debug channel
3. NKRO keyboard, Media keys, and power keys



Spying on the debug channel with HID Listen (http://www.pjrc.com/teensy/hid_listen.html) is another way to check that the code has been loaded properly. It dumps the raw codes read from, and written to, the keyboard. Even if no keyboard is connected (or an XT), it will show 'wEE' when the converter is first plugged in. That's it writing an echo command to see if the keyboard responds.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: xwhatsit on Sun, 24 April 2011, 07:38:08
What are you using for a VID/PID?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 24 April 2011, 08:06:33
Quote from: xwhatsit;336486
What are you using for a VID/PID?

I'll check later, but I haven't changed it from the defaults in the PJRC sample code.

edit: VID = 16C0, PID = 047D.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: xwhatsit on Sun, 24 April 2011, 08:31:21
Ah right. I'm going to use the standard V-USB HID keyboard VID/PID for my wee project. Seems you can't buy a small block any more -- the resellers have been shut down by the USB-IF -- I bought one a while ago for a project, and don't really want to re-use it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: intealls on Sun, 24 April 2011, 11:10:17
Nice work!

Just wondering what kind of remapping/macro features your firmware supports? Also, when will you release the source? :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 24 April 2011, 19:15:57
Quote from: xwhatsit;336495
Ah right. I'm going to use the standard V-USB HID keyboard VID/PID for my wee project. Seems you can't buy a small block any more -- the resellers have been shut down by the USB-IF -- I bought one a while ago for a project, and don't really want to re-use it.

 
For personal projects, I guess it doesn't really matter what we use! (I admit I haven't bothered to look into it).

These are the values and comment from the PJRC keyboard sample code:

Code: [Select]
// Mac OS-X and Linux automatically load the correct drivers.  On
// Windows, even though the driver is supplied by Microsoft, an
// INF file is needed to load the driver.  These numbers need to
// match the INF file.
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x047D
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 24 April 2011, 20:14:17
Quote from: intealls;336575
Nice work!

Just wondering what kind of remapping/macro features your firmware supports? Also, when will you release the source? :)

Remappings are done from HID code to HID code, using a table in RAM, after the native scan codes have been translated to HID codes (using tables in the ROM). The idea is that remappings are applied to the table piecemeal - maybe some that only apply to certain boards, some that are global - in a more dynamic way than editing scan code tables directly. For example:

Code: [Select]
const uint8_t PROGMEM colemak_remaps[] = {
HID_KEY_D, HID_KEY_S,
HID_KEY_E, HID_KEY_F,
HID_KEY_F, HID_KEY_T,
HID_KEY_G, HID_KEY_D,
HID_KEY_I, HID_KEY_U,
HID_KEY_J, HID_KEY_N,
HID_KEY_K, HID_KEY_E,
HID_KEY_L, HID_KEY_I,
HID_KEY_N, HID_KEY_K,
HID_KEY_O, HID_KEY_Y,
HID_KEY_P, HID_KEY_SEMICOLON,
HID_KEY_R, HID_KEY_P,
HID_KEY_S, HID_KEY_R,
HID_KEY_T, HID_KEY_G,
HID_KEY_U, HID_KEY_L,
HID_KEY_Y, HID_KEY_J,
HID_KEY_SEMICOLON, HID_KEY_O,
0, 0
};

That's far smaller than a complete scan table, and could be applied to any keyboard regardless of the scan code set it uses natively.

Macros very quickly get fiendishly complicated to implement! So, for version 1, the converter will only support macros that emit a sequence when a key (or combi) is pressed, and do nothing when the key is released. The sequence can include key presses/releases, saving/restoring modifier state, etc. There may be limitations on which combinations can be used to trigger a macro, e.g. single non-modifier key plus modifiers, but I hope it can be (or become) more flexible than that.

I'd like to release the source code ASAP, even though there's a couple of pieces missing before it gets to v1.0, which are: defining a storage format for macros (including how they're triggered), and defining how the control interface works to allow remappings and macros to be edited on the host PC (preferably in a cross-platform way...).

I haven't decided whether to release it before or after doing either or both of those things :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Sun, 24 April 2011, 23:53:54
Stupid question: what's the default mapping for a 122 look like?  I'm thinking I'm going to hook it up and panic when I can't find half the editing keys.

I wonder if you could do an approach of "load the main binary at one address, and the macro pack/mapping pack always exists at another address space" so you only have to rewrite the second space.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 25 April 2011, 04:41:17
Quote from: Hak Foo;336801
Stupid question: what's the default mapping for a 122 look like?  I'm thinking I'm going to hook it up and panic when I can't find half the editing keys.

Roughly speaking, it's done as a regular 102 with extra keys. The block of 10 keys on the left contains stuff like windows keys, PrtSc, etc. It's true though, that the 122s are the ones that need remapping the most - as in, everyone has a different idea about how to make them useful! For the default, I've chosen to have each key send a unique code, so that remapping with e.g. AutoHotkey works well.

Quote from: Hak Foo;336801
I wonder if you could do an approach of "load the main binary at one address, and the macro pack/mapping pack always exists at another address space" so you only have to rewrite the second space.

 
Here's the vague plan - they will be stored in the EEPROM, a control pipe will allow reading and writing it, an OS specific program will talk to the control pipe, and a higher level utility (Java or javascript or ???) will talk to the OS specific part.

Thing is, until all of that is in place, it's probably easier to simply edit the source and recompile!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: intealls on Mon, 25 April 2011, 13:10:55
I've got a Teensy++ 2.0 with your firmware hooked up to my MBP Santa Rosa, and I've yet to encounter any multiple/repeated keystrokes! Just ran six speedtests without issue (about 2900 keypresses, ~95 wpm). Seems to work great.

Edit: Hm, just put the computer to sleep and when it woke up W was repeating for some reason. Had to press another key to make it stop.

The problem can be recreated by putting the computer to sleep, banging a couple of keys on the connected keyboard and then waking the computer up.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 25 April 2011, 13:41:58
Excellent news! Thanks for letting me know, that was the last part that was completely unverified - think I'll have a little drink to celebrate :-)

edit: you edited :-(  So, I guess I do need to add something to handle suspend mode - I knew I wasn't handling it, but I didn't realise it would do that. Is it fine as long as you don't press any keys while it's sleeping?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: intealls on Mon, 25 April 2011, 13:53:17
Sorry 'bout that. :/ Yup, seems fine when no keys are pressed! Gonna test a couple more times.

When no keys are pressed, it does not repeat. Tried it like 8 times or something. :)

I also tried an old version of hasu's firmware without the SET_IDLE fix, and I can with 100% certainty say that the repeating key issue is non-existant with your firmware. :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 25 April 2011, 14:09:39
Thinking about it, I can't quite figure out what's going wrong - I guess it must somehow be missing the key up event from the keyboard. Does pressing a key wake it up from sleeping? That might re-initialize the converter, and I could clear the key state at that point, as a quick fix.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: intealls on Mon, 25 April 2011, 14:14:26
It does not wake up :( That was what I was testing. I just tried the same thing on Linux on the same computer, and it worked fine (no repetition). Could it be because OS X still powers the USB ports or something when it's suspended (iDevice-charging)? I don't think they are powered when running Linux.

Hm, if I press one key normally during suspend and wake it up, no repeated keypresses. If I hold down the key for a while (and release it before the computer is woken up) and then wake the computer, that keypress is repeated on wakeup.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 25 April 2011, 14:26:07
I think handling wake-up will have to wait until I support suspend mode correctly - it is on the wishlist already though!

For now, I've made a quick change to clear the output state whenever the USB connection is reset. I've no idea if it will work or not, but it shouldn't do any harm :-)

Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: intealls on Mon, 25 April 2011, 14:36:20
It still seems to repeat. :/

Would be great if someone else could try to reproduce it as well, so it's not just my setup. I tried both USB-ports, didn't seem to make any difference though.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Mon, 25 April 2011, 14:40:16
I am unable to reproduce, or witness any issues at all after waking from standby (just tried - even with keys held while sending it to sleep).

Dell Inspiron 630m, if it matters. 122-key Model M.

Using a rather old version of the code though, and on next flash I'm going back to dfj's...not due to any failure of Soarer's, but because I'm supposed to already be evaluating for dfj lol.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: intealls on Mon, 25 April 2011, 14:53:48
I think it's a problem related to OS X, Linux (Ubuntu 10.04 I think) on the same machine worked fine (no repeats). Haven't got Windows on this machine, so can't test that. :/

What OS are you using on the Inspiron?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Mon, 25 April 2011, 14:59:39
Win7...so yeah...might be OS-related (in fact, there's a good chance it is...standby is a hardware/firmware feature, but how peripherals behave about it is going to relate to drivers I expect)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 25 April 2011, 19:34:17
Quote from: intealls;337070
It still seems to repeat. :/

 
Thanks for trying it. :-)  I'm still hoping that there is a change I can make that will fix it, without having to add a lot of new code. Especially when I can't easily test (on OS-X) what I write, as I go along!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Wed, 27 April 2011, 01:59:09
High five!

122 key terminal Model F up and running!!!  Everything is good so far :)

I can't wait to get some of these added keys mapped with AHK ;)

Thanks for your hard work!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 30 April 2011, 19:09:16
v0.992 is now available, which works around an annoying issue with Linux.

The problem was that the backslash key would not repeat, and if another key was pressed while it was held down, extra backslashes appeared.

My converter's HID report is a bitmap, and each bit represents a specific HID key code.
The codes are all unique in HID land, but not when mapped to Linux scan codes.
The HID codes for backslash and 'Europe 1' are both mapped to the Linux code for backslash (by Linux).
'Europe 1' comes later in the report than backslash.
So, Linux scans the report, sees backslash down and registers it, but then sees 'Europe 1' up and clears the backslash state.
It would register a press and release of backslash every time it received a report from the keyboard while backslash was held down, but otherwise would not repeat it (since most of the time, it thought the key wasn't pressed).

The fix is that the 'Europe 1' code has been removed from the report. (It really wasn't useful anyway, even to Europeans!).

I'd call it a flaw in Linux, not my converter, but still it had to be fixed!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Neit on Sun, 01 May 2011, 15:12:12
Hi Soarer,

I would like to wire your converter with both DIN and PS/2 connectors.
Since I'm pretty noob in electronics, I need some advice here.

Is it OK to wire the teensy and connectors like this ?
(followed your instructions on the article and of course I will use DIN OR PS/2, not both at the same time).
(http://zep.netai.net/xt-at-ps2_converter.jpg)

Hope that I can.
Oh, and thank you for your great work, I may "resurrect" a terminal keyboard that probably use XT protocol.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 01 May 2011, 16:25:17
Nice diagram!

Yes, that should be fine. (In fact, I don't think plugging both in at the same time would cause any harm, but don't blame me if it does!)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Mon, 02 May 2011, 02:12:45
Glad this was brought up, as short-term I will be doing the same with a terminal F, an XT, and a PS/2. I didn't know if a switch was necessary to disable the unused connector(s) for any reason. Long term I will be building a few of these guys for different purposes.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Neit on Mon, 02 May 2011, 13:28:29
Quote from: Soarer;339994
Nice diagram!
Thanks :)
I wanted to make it clear and "readable" for my first electronic build.

Quote from: Soarer;339994
Yes, that should be fine. (In fact, I don't think plugging both in at the same time would cause any harm, but don't blame me if it does!)
Good news!
Anyway, I will not give a try.

I received my teensy today (very fast shipping, ordered the 27th). And, it's very tiny.
I have three more questions about it:

Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 02 May 2011, 14:15:44
Quote from: Neit;340469
  • Will an old IDE cable will be fine for wiring, or a bigger section is needed?

That is fine. (It's probably about the same thickness as the wires in the cable to the keyboard).

Quote from: Neit;340469
  • In the article, you recommend the use of an 1Kohm pull-up resistor between Clock and +5V and one other between Data and +5V in case of long cable. I'm pretty scared about this (my soldering skills are fresh), for you, which length is becoming "long" and need the add of resistors?

Even at 5 metres it still worked fine without the pull-ups! But it definately tidied the signal up at that point. I would call more than 2 or 3 metres 'long'.

Quote from: Neit;340469
  • Last question, since the teensy is very small. May I do my solders at the back of it? (where there's only printed circuits, not components, and then avoid some damage by overheating).

Yes, either side, as you wish.

Are you putting the sockets in a box? If you are, you might find it easier to wire from the Teensy to the DIN connector, then make the double connections there to also wire to the PS2 socket. DIN connectors usually have large tags, making it fairly easy to solder two wires on.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Neit on Mon, 02 May 2011, 14:48:47
Quote from: Soarer;340492
Even at 5 metres it still worked fine without the pull-ups! But it definately tidied the signal up at that point. I would call more than 2 or 3 metres 'long'.
Okay good. I'll get some resistors just in case.

Quote from: Soarer;340492
Are you putting the sockets in a box? If you are, you might find it easier to wire from the Teensy to the DIN connector, then make the double connections there to also wire to the PS2 socket. DIN connectors usually have large tags, making it fairly easy to solder two wires on.
Yes, I was planning on a (lego) box.
Thanks for the tip, it will surely help my soldering!

Can't wait to build it up.
Thanks again for your advices.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: nowsharing on Mon, 02 May 2011, 16:00:07
Wow, awesome work everyone. You've achieved the "impossible."

Could I buy one of these contraptions from anyone?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Mon, 02 May 2011, 19:15:57
Man, this code works great.

Now I just need the remappable version. :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: slueth on Mon, 02 May 2011, 19:41:07
Quote from: nowsharing;340581
Wow, awesome work everyone. You've achieved the "impossible."

Could I buy one of these contraptions from anyone?

 
Just buy a teensy and request a sample from tyco electronics for the DIN connectors.  Not that hard to wire up.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Mon, 02 May 2011, 22:52:20
if you don't feel like harassing tyco, the socket costs <4 USD from the big online parts dealers, although shipping is a killer.  what I'd love to see is a pre-routed PCB for neat look.  the diy route looks it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Mon, 02 May 2011, 23:43:10
I want to do this, but why is the teensy so damn expensive?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: slueth on Tue, 03 May 2011, 01:47:50
Its because not only can you use it for a keyboard convertor, you can use it for a slew of other projects because it is a USB-based microcontoller.  
Teensy is actually cheap compared to other arduino products.
Basically we are taking a nuke and killing a tick.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Neit on Tue, 03 May 2011, 19:50:55
Hey,

I Updated the diagram before soldering.
I finally chose to add the resistors for more security.
Still good?

(click to enlarge)
(http://zep.netai.net/thumb_xt-at-ps2_usb_p.jpg) (http://zep.netai.net/xt-at-ps2_usb_p.jpg) and (http://zep.netai.net/thumb_xt-at-ps2_usb_s.jpg) (http://zep.netai.net/xt-at-ps2_usb_s.jpg)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 04 May 2011, 06:04:28
Yep, even better! I like that the socket views are labelled as front and back - it removes any confusion.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 04 May 2011, 06:14:20
Quote from: 8_INCH_FLOPPY;340790
I want to do this, but why is the teensy so damn expensive?

 
Is it though? Even used just as a keyboard converter, I don't think it's unreasonable, considering how much it can do. But then, maybe you're one of those who thinks the blue cube is too expensive also, and have wasted money on a small mountain of crappy $3 converters (I don't mean that as aggressively as it may sound, btw, I have quite a collection!).

As an Atmega breakout, the Teensy can't be beaten on quality OR price... it really is the de facto choice for that reason.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Findecanor on Wed, 04 May 2011, 07:58:04
There are lots of unused pins, though.
I wonder if they could be used for something useless ...

But, I think it would be even better if each port was on a separate set of pins ... and all worked at once.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mr. Perfect on Wed, 04 May 2011, 14:52:52
Very nice diagrams there Neit. Any idea where the lock LEDs would fit into those?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 04 May 2011, 15:28:59
Quote from: Findecanor;341477
There are lots of unused pins, though.
I wonder if they could be used for something useless ...

 
DIP switches!!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 04 May 2011, 15:31:39
Quote from: Mr. Perfect;341710
Very nice diagrams there Neit. Any idea where the lock LEDs would fit into those?

Has anyone wired them up yet? I'm tempted to move them to different pins on the Teensy (non++)...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Wed, 04 May 2011, 23:24:30
I have.

If one thing is annoying about the laout, it is the lights.  Too close together, so it is hard to wire and all the lights blend together.

also, does one light come on when you shut down for everyone
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Neit on Thu, 05 May 2011, 14:05:31
Quote from: Mr. Perfect;341710
Very nice diagrams there Neit. Any idea where the lock LEDs would fit into those?
I'll add them on the diagram as soon as Soarer has chosen the final pins to use (currently PF5, PF6 and PF7) and how to wire them (anode+resistor on pin and cathode on ground?).
If anyone is interested (or for the article), I can do the ++ diagram.
(hope that's what you wanted to hear, my English isn't perfect and I have to admit your question confused me :$)

@Soarer
Something I thought: Since the converter is plugged through USB, can we hotplug the keyboards? (or is it still risky because of the PS2/DIN)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 05 May 2011, 15:46:14
Quote from: Neit;342138
Something I thought: Since the converter is plugged through USB, can we hotplug the keyboards? (or is it still risky because of the PS2/DIN)

Still a bit risky but should be ok (as ok as hot-swapping any PS/2, I guess). The converter won't know if the keyboard type has changed though, so you couldn't unplug an XT then plug in an AT (I might try and improve that at some point, but it's not high on the list). Bottom line - it's safest to unplug the USB side first :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mr. Perfect on Thu, 05 May 2011, 20:12:22
Quote from: Neit;342138
I'll add them on the diagram as soon as Soarer has chosen the final pins to use (currently PF5, PF6 and PF7) and how to wire them (anode+resistor on pin and cathode on ground?).
If anyone is interested (or for the article), I can do the ++ diagram.
(hope that's what you wanted to hear, my English isn't perfect and I have to admit your question confused me :$)

 
Yes, that's exactly what I was asking about. Probably best to wait and see if they change pins though.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Thu, 05 May 2011, 22:27:25
Quote from: Soarer;341464
Is it though? Even used just as a keyboard converter, I don't think it's unreasonable, considering how much it can do. But then, maybe you're one of those who thinks the blue cube is too expensive also, and have wasted money on a small mountain of crappy $3 converters (I don't mean that as aggressively as it may sound, btw, I have quite a collection!).

As an Atmega breakout, the Teensy can't be beaten on quality OR price... it really is the de facto choice for that reason.

 I'm just a cheapass who doesn't understand who people are willing to use an arduino to do the same thing that you can do with a $5 microcontroller. Don't take this the wrong way.  I'm really very grateful for the contribution. This device will allow me and many other members to finally use all of those awesome terminal and XT keyboards we have sitting around.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: hasu on Fri, 06 May 2011, 03:51:11
8_INCH_FLOPPY,

You can do with V-USB at cheap. You just need a crystal, 2 zeners, some R&C and AVR.
To cut cost down more, you might be able to omit crystal and even zeners. (dangerous to PC? :)

I made my PS/2 converter with Atmega168p + V-USB and it works fine. (with crystal and zeners, of course ;)
If you are familiar to PIC, PIC18F14K50 is better candidate. It has a real USB function.
Both chip are just 200 yen in Akihabara. cheap!

I think Teensy's price is reasonable, though shipping cost is a problem for buyers outside USA :(
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 06 May 2011, 06:11:14
Quote from: 8_INCH_FLOPPY;342347
I'm just a cheapass who doesn't understand who people are willing to use an arduino to do the same thing that you can do with a $5 microcontroller. Don't take this the wrong way.  I'm really very grateful for the contribution. This device will allow me and many other members to finally use all of those awesome terminal and XT keyboards we have sitting around.

Ah, well, I can explain that quite simply: it's easier!

I chose Atmel AVR mainly because there is a good, free, C compiler. But then their range of devices is frustrating - hardware USB support is only available in a surface mount package, so some kind of breakout board is needed to make it usable by most people (the chip itself only costs a few dollars). I haven't tried V-USB, but as it's a software USB solution it uses a considerable amount of CPU time, and I would be concerned that it would not be easy to acheive the same level of reliability in reading data from the keyboard as I have using the hardware USB (which mostly just does its stuff in the background). Even with the hardware USB, I've had to solve a few tricky timing problems.

It's easier for the end-user as well. Hardware USB means you can load code into the device via USB (and as a bonus, the Teensy loader is well nigh foolproof). Without that, you'd need some other hardware to load the software onto the chip, which most people don't have. At a minimum only four wires need soldering, and that's a benefit too.

In essence, a Teensy does give us useful extra features compared to a $5 micro on its own.

Were I to take offence, it would at your use of the word 'willing', possibly implying that I've been had over by some evil scam to part me of my money! Or that I am a slack engineer who is wasteful! I would of course deny both, having considered V-USB and PIC options, and deciding that the Teensy is the best compromise between economic, efficiency, and ease-of-use factors in order to get the job done :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Fri, 06 May 2011, 13:14:38
Thanks for the detailed explanation. I didn't mean to suggest that you  are lazy. After all, you are the first person to offer a complete and thorough solution for those of us who want to make use of our XT keyboards.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 06 May 2011, 14:33:07
Quote from: 8_INCH_FLOPPY;342580
I didn't mean to suggest that you are lazy.

 
I didn't really think you had, the last paragraph was very much tongue in cheek :-)

But I am lazy - some say it's a good quality for a programmer to have!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Fri, 06 May 2011, 16:33:58
I caved and ordered a couple. Maybe I can recoup the cost of one by selling the other after I get them both working. I think the price of ibm terminal keyboards if about to skyrocket...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Sat, 07 May 2011, 03:09:28
Repeat that enough times in the right places and they will. However, this is still DIY and will scare away many that don't want the hassle or clutter. Prices *should* remain sane.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sat, 07 May 2011, 12:37:29
Not if I build a bunch and sell them. Muahahahaha.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Sat, 07 May 2011, 23:57:45
To me, the logical endgame of this project is to eventually develop a small-run PCB where you can attach a teensy and your choice of the needed connectors and get a really professional job.  while the hand-soldered one works fine, it hardly looks like a robust professional 'take the 122 to the office and show it off' product.

From there, redesign so the $20 Teensy is replaced with just the surface-mounted atmel chip, send the design to China, and get the retail price down to like USD20.

The gamers will have a stroke-- an NKRO adapter for their old precious PS/2 boards, and their sales will bankroll development.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Sun, 08 May 2011, 04:49:34
Of course, in my case, I just mounted the Teensy internally. That way, it looks like it was USB from the factory.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mr. Perfect on Mon, 09 May 2011, 08:59:12
Ok, here's a question that probably hasn't come up before: can USB keyboards be hooked up to this controller to achieve NKRO? I'm thinking of all the Filcos, Leopolds, Decks, etc that achieve NKRO when plugged into a PS/2 port with one of those USB to PS/2 adapters. Clearly the keyboard can handle NKRO, but the traditional USB hookup limits it to 6KRO.

Quote from: Hak Foo;343202
To me, the logical endgame of this project is to eventually develop a small-run PCB where you can attach a teensy and your choice of the needed connectors and get a really professional job..

 
Now that's a good idea. Even a do it yourself soldering kit would be great, people wouldn't have to hunt down all of the individual parts.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 09 May 2011, 09:45:00
Quote from: Mr. Perfect;343753
Ok, here's a question that probably hasn't come up before: can USB keyboards be hooked up to this controller to achieve NKRO? I'm thinking of all the Filcos, Leopolds, Decks, etc that achieve NKRO when plugged into a PS/2 port with one of those USB to PS/2 adapters. Clearly the keyboard can handle NKRO, but the traditional USB hookup limits it to 6KRO.

 
Yes, it should work fine! (I'm sure someone did ask that before, but maybe not in this thread :) ).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mr. Perfect on Mon, 09 May 2011, 12:36:03
That's great news. So to wire a female USB socket to the controller you just match up power, ground, and the data lines and it's good to go?

The best possible version would have three inputs, a DIN, PS/2 and USB. Then you could plug in any keyboard capable of NKRO and get USB on any OS. :music:
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 09 May 2011, 13:03:23
I don't know how the passive USB to PS/2 adapters are wired up though - either probe one or toss a coin ;-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 11 May 2011, 18:19:52
New version (v0.994) posted which adds suspend and wake-up support!

Many thanks to intealls for his help with testing on OS-X, discussing the problems, and unwittingly providing motivation :-)

Essentially the changes are that the converter now tracks when it has been suspended by the host, or is in the process of waking up, and takes measures to avoid the situations that sometimes resulted in repeating or stuck keys after exiting the suspended state.

Also, it now sends a remote wake-up signal to the host when a key is pressed while it is suspended, to bring the computer out of stand-by/sleep.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: slueth on Wed, 11 May 2011, 23:28:58
Soarer, you are amazing!  :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: intealls on Thu, 12 May 2011, 19:26:19
Heh, no problem, just glad I was able to help :) You're the one doing the awesome work, and we should all be grateful for it!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 12 May 2011, 20:16:55
Well this phase is really a shakedown, making sure that reliability is top notch before adding more features... and I can't do that all by myself :)

BTW, the problem when pressing lots of keys to wake-up got fixed too - the debug channel was filling up with stuff it couldn't send.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Voixdelion on Fri, 13 May 2011, 05:30:01
Okay, I just kind of skimmed the discussion because it was all rather technical for me,  I see the "DIY" letters which has me a bit frightened and also the word "expensive" - but I was considering the $100 price tag for the converter that was no longer available, so I guess it's all relative ... How expensive are we talking here?  $20?   The other scary word was "Programming" considering the previous mention of "DIY project" but   I've held on to my F-XT in case some way to make use of it ever came to fruition; has this happened? I could offer my services for a cooperative effort in assembling these on the electrical/soldering side (which I am reasonably confident about being able to do)  if someone else will do the chip programming (which I know nothing about at all)

Can someone do an Inigo Montoya -like encapsulation of the last page and a half for me?  ("Let me explain-- no, there is too much . . . Let me sum up: Buttercup is marry  Humperdink in little less then half an hour so all we have to do is get  in, break up the wedding, steal the princess, make our escape... after I  kill count Rugen.")
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Fri, 13 May 2011, 05:50:03
Soarer is developing the firmware, you buy a Teensy or Teensy++, you can get one without pins and solder wires to it, or get one with pins, stick it in a breadboard with the appropriate connector, and jumper wires to it. Plug the wires into the appropriate pins on the Model F's controller, or plug the Model F's connector into the circuit.

Plug it into USB, run the Teensy loader, push the button, flash the firmware. Then reboot the Teensy. Done.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 13 May 2011, 06:32:34
Basic shopping list:
Optional items, as desired:
To assemble it just needs a few wires soldering. bhtooefr is right, there's lots of ways you could choose to build it and case it, and that's partly why I haven't done a demo build yet - I can't decide which way I want to do it :)

'Programming the chip' in this sense just means installing the hex file onto the Teensy, and that's made easier than burning a CD by the Teensy loader (http://www.pjrc.com/teensy/loader_xp.html).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Fri, 13 May 2011, 06:40:26
And, my build didn't even use the socket, due to how I installed mine.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: intealls on Fri, 13 May 2011, 09:14:55
Here's my highly ghettoish solution (I HATE that movie btw)

[ATTACH=CONFIG]18098[/ATTACH]

[ATTACH=CONFIG]18100[/ATTACH]

I plan to build a proper version sometime by using one of these, can't seem to find PS/2 sockets that can be properly aligned to an experiment board though :/

[ATTACH=CONFIG]18099[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: ch_123 on Fri, 13 May 2011, 17:12:42
Quote from: ripster;345731
Sounds a teensy bit complicated to me.


Things often get more difficult to comprehend as you grow older.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: slueth on Fri, 13 May 2011, 23:06:52
Not that hard as long as you can understand the pinouts.  Make sure you are looking at the picture in the right point of view.  Either way, after messing around and sticking things in holes, I got it to work.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sat, 14 May 2011, 00:04:49
Quote from: Neit;339968
Hi Soarer,

I would like to wire your converter with both DIN and PS/2 connectors.
Since I'm pretty noob in electronics, I need some advice here.

Is it OK to wire the teensy and connectors like this ?
(followed your instructions on the article and of course I will use DIN OR PS/2, not both at the same time).
Show Image
(http://zep.netai.net/xt-at-ps2_converter.jpg)


Hope that I can.
Oh, and thank you for your great work, I may "resurrect" a terminal keyboard that probably use XT protocol.

 
Is that the same as the XT pinout? I wired it up to my XT keyboard like that and it is not currently working. The led on the board just lights up whenever I press a key.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: slueth on Sat, 14 May 2011, 02:08:19
I used this
(http://www.luzr.net/images/****.png)
with the information from the article:
Conn.       Teensy
GND -------- GND
Vcc/+5V ---- Vcc
Data ------- PD0
Clock ------ PD1
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Sat, 14 May 2011, 02:29:04
Voix:  I have this connected to a 122 Terminal F from the acfrazier group buy. Really not hard at all. I got a breadboard from RadioShack for a couple bucks, a teensy++ with pins preinstalled, and a DIN socket with pins for PCB mounting.

The teensy pins are pushed into the breadboard, as well as the DIN socket. Make sure you have the right pinout for the socket that matches your keyboard cable. Wire up the pins on the bottom of the breadboard  to match the diagrams earlier in this thread. Connect the USB cable to the teensy's jack and yr PC, then run the firmware loader, open Soarer's file, click the icon to "download", ie "flash" to the teensy. Click the icon to reboot the teensy. Done. Your board now works via USB, and where available, has full NKRO ;)

There's no need to fear, this is easy and fun!  Join the freenode IRC chat #geekhack and you will surely find a few of us using these that can talk you through it if you hit a snag.

One thing to note, mine is not soldered anywhere, and is currently connected with alligator "test" clips until I decide how to house it permanently. Not recommended since shorting the wrong pins/wires COULD do harm to your hardware, but if small enough clips are used, it IS workable temporarily until you or an electronics savvy buddy are ready to solder it up. ;)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 14 May 2011, 07:04:23
The most common mistake so far is wiring the socket backwards - it's important to note whether a diagram shows the front or back view of the socket. Which is why I prefer something like Neit's revised diagram (http://geekhack.org/showwiki.php?title=Island:17458&p=341287&viewfull=1#post341287) or this one from kbdbabel:

(http://www.kbdbabel.org/conn/kbd_connector_ibmpc.png)

8_INCH_FLOPPY: doing that on an XT connector would swap Vcc and GND, so unlikely to give an output at all. Could it be that you just have clock and data swapped over?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Sat, 14 May 2011, 10:25:28
[ATTACH=CONFIG]18121[/ATTACH]

Please feel free to pop this into the article if you like...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Voixdelion on Sat, 14 May 2011, 12:21:44
kewl.  will definitely try this...soon
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Neit on Sun, 15 May 2011, 13:10:20
Finally done mine, 0.994 working perfectly with my cherry 81-3000 (yes MY switches are a pain).
Unfortunately, couldn't resurrect the 122 keyboard (http://geekhack.org/showthread.php?17468), don't know what to do or think, broken? another protocol?
I'll go back where I found it to try some others KBs.

(http://zep.netai.net/converter/finished_1.jpg)

(http://zep.netai.net/converter/finished_2.jpg)

Didn't make the hole for the PS/2 at the moment, will do when needed.

Quote from: Soarer;343914
I don't know how the passive USB to PS/2 adapters are wired up though - either probe one or toss a coin ;-)

Got one somewhere, can check it if you want.

One question: During my final test after soldering, I tried pushing multiples keys to check how much my KB can handle. At a moment the teensy LED lightened up and turned off just after realising the keys. Did you implemented it or the teensy froze ?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: slueth on Sun, 15 May 2011, 16:53:29
It shouldn't light up, if it lights up there was a problem.  Should handle nkro.
Correct me if I am wrong.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Sun, 15 May 2011, 16:54:55
If the keyboard itself doesn't handle NKRO, though, there's a problem, and it'll light up.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 15 May 2011, 18:00:16
I don't think the lack of NKRO is a factor here - the keyboard is still capable of tracking lots of keypresses as long as they don't trigger the anti-ghosting or whatever, and in most cases that wouldn't light the Teensy's LED.

I think this is the keyboard's buffer filling up, at which point it sends a code saying that it has overflowed. The converter then clears the state of all keys and lights its LED for a 5 seconds. In nearly all cases where the LED lights up, the converter solves the problem so you don't notice anything bad happen :-)

I've noticed this a lot while testing, particularly when releasing many keys, and there's two reasons for that: first, you are more likely to release them all within a very short time than when pressing them, and second, for scan code sets 2 and 3, there are at least two bytes placed into the buffer for each key release, making much more likely to overflow the buffer.

As for that 122, I'm afraid I have no idea :(  It could be a different protocol, or possibly the connector just isn't wired the same as a normal XT/AT board, or both.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sat, 21 May 2011, 19:00:14
I got mine to work for a moment with a PS/2 keyboard, but after I unplugged it and tried it again, it wouldn't work. The light lights up whenever I press a key and that's it. I never got it to work with an XT keyboard.

With the female DIN plug facing me, and the 5 pins numbered clockwise, this is how I wired it up:
1-D1
2-Ground
3-D0
4-VCC
5-nothing

1.2k resistor between D0 and VCC, and 1.2k between VCC and D1.

Is this correct for both AT and XT?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 21 May 2011, 19:22:07
Yup, that's the right order when looking into the socket. AT and XT are the same. Pull-up resistors sound fine.

Perhaps data (D0) isn't properly connected. Could you post a pic or two?

edit: The other thing that might help to get it working is to run the hid_listen (http://www.pjrc.com/teensy/hid_listen.html) program to see what the error is (a cryptic code beginning with a capital 'R', most likely).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sat, 21 May 2011, 19:50:23
Ok, here's the message with one keypress on an AT keyboard:

R06
R06 R06


It doesn't give me any messages with the XT keyboard. However, the lock leds on the keyboard are working.

I doubt the connection is the problem, unless it's my cord or something. I'm not beginner when it comes to soldering.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 21 May 2011, 20:19:51
Not accusing you of sloppy soldering! But something seems to have broken after the first test with the PS/2 keyboard, presumably within the converter and its wiring - have you got a multimeter to check continuity?

R06 is a start bit error, so it's not getting very far with it! It's very strange that with the XT nothing is printed.

When connecting it, what does it say at the beginning?
(Should always say wEE, and then print more for the AT or PS/2).
(The USB side should be disconnected when changing keyboards).

Another thing that might give that error is if data is shorted to ground.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sat, 21 May 2011, 23:19:56
There's continuity between The socket and the board, according to ye olde VTVM. Also, there are no shorts between data and Gnd.

Hmm, it's suddenly working with ps/2 again. Here's the message it gave me when I plugged in:

wEE rEE wF0 w00 rFE wF0 w02 rFE wF0 w03 rFE wF2 rFA rAB r83
It's giving me a unique message for each keypress, and they are all working.

I still can't get the XT keyboards working. It just lights up whenever I press a key down. I had to unplug the USB and plug it in in order to get any message for the XT keyboard. Here it is:
wEE

then, when I press keys on the XT keyboard, the message alternates between
R06
R06
and
R05
R05
Ctl and a couple of other keys give me an occasional R04.


I haven't tested it with any of my 122-key keyboards yet. I'll remember to unplug the usb before keyboard swapping in the future.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sat, 21 May 2011, 23:25:31
Ok, I've switched back to an AT board, and now it's not working again. Here's the message when I plug it in:

wEE rEE wF0 w00 wF0 wF2 rFA
 
It is not receiving any of the key-presses now.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sat, 21 May 2011, 23:39:03
It seems that, out of the 3 AT keyboard that I've tested, the only one that does not work is the one that has a 3-way switch on the back so that it can switch between A, X and S. I've always assumed that this was AT, and XT, since A has worked though a simple AT to ps/2 adapter and X simply has not worked. I have no idea what the S stands for. Anyone know?

Anyway, my other XT keyboards are giving me the same message that this 'board gave me with the switch in the X position, so I'm assuming that it is working.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sat, 21 May 2011, 23:48:31
After much testing, here's what basically happens:

Normal AT keyboard: Works fine, do problemos  

wEE rEE wF0 w00 rFE wF0 w02 rFE wF0 w03 rFE wF2 rFA rAB r83
with unique messages for each key

Weirdo Monterey International Corp. FKF456K-104 AT keyboard with 3-way A,X,S switch on the back:
In the "A" position: wEE rEE wF0 w00 wF0 wF2 rFA
In the "X" position: wEE, alternating between R06 R06 R05 R05 with a few R04s thrown in
In the "S" position: wEE, alternating between R06 R06 R05 R05 with a few R04s thrown in

83-key XT keyboard:
wEE, alternating between R06 R06 R05 R05 with a few R04s thrown in

Any ideas?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 22 May 2011, 07:26:43
Hmm... I used an IBM XT 'board for developing, and then had to tweak my code to get it working with some of my switchable 'boards. It does seem that implementations vary much more on the XT protocol than the others, but I've only got a few 'boards I can test with, and no others that are only XT.

R04 is a clock error - the converter has missed one edge of the clock signal, usually because of a short spike. I haven't seen this one other than when powering up, so I'm not sure why it's happening here.
R05 is a timeout error - the converter started receiving clock from the board, but didn't receive enough for a full code.
R06, the start bit error - the converter read a start bit, but it was incorrect. (Data should be high for XT, low for the rest).

It looks like that AT 'board is being upset by the tests the converter does to try and auto-detect the keyboard type (or the converter is being confused by the response). I've been thinking about simplifying it, which might help with this 'board.

I've got a Cherry with a pair of dip switches, and the choices are 'PC/XT', 'AT 02', and 'MF'. I'll plug it in later and see what it does.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Sun, 22 May 2011, 14:29:41
I tested my other XT keyboard, and it responded the same as the first one. I have to make an adapter before I test my 122-key model Ms.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 23 May 2011, 05:29:02
Cherry 'board didn't do anything that might shed light on what the 'S' setting on yours is. 'S' could stand for 'serial', at a guess.

Your XT 'boards - what make are they?

At this point, seeing the signals on a 'scope would probably show us what the problem is within minutes, otherwise it's pretty tricky to diagnose :-/
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Mon, 23 May 2011, 22:38:59
I'm not sure what make they are. Unfortunately, the last owner peeled the stickers off, and I haven't taken them apart yet  They are both 83-key layout, with black cherries, double-shot keys, and full-key rollover. I can't wait to get them working. I have very little experience with digital, but I'll try to get a 'scope shot soon.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 24 May 2011, 06:14:25
Oh wow, that would really help! Normally the signals very easy to capture on a 'scope, they're 5V and only about 10kHz. Trigger on clock going below about 2.5V.

Here's an IBM XT 'board sending the make code for the comma key (0x33):

[attachimg=1]

The clock (in blue) spends less time low than high - I suspect on your 'boards it might be spending even less time low, so that's the first thing to look at. It would be interesting to see traces for both the unknown and the Monterey (in 'X' mode).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Sun, 12 June 2011, 18:13:39
Is there any chance we can get the source if we want to compile our own custom mappings?  I know the all-singing all-dancing customizable version is under development, but I'd love to lock down a sensible location for a few keys the registry-based remappers ignore?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: 8_INCH_FLOPPY on Tue, 14 June 2011, 13:43:36
These were all captured with me pressing the "accent grave/tilde" key. The "S" setting seemed to be about the same as the "X". It wouldn't work at all on the "A" setting, even though it works fine with my pc.

Unidentified 83-key XT Keyboard:
http://imageshack.us/photo/my-images/804/photo0017v.jpg/

Monterey Keyboard with switch on the "X" position:
http://imageshack.us/photo/my-images/534/photo0018jg.jpg/
http://imageshack.us/photo/my-images/541/photo0019wj.jpg/

Monterey Keyboard with switch on the "S" position:
http://imageshack.us/photo/my-images/194/photo0020e.jpg/
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Fri, 17 June 2011, 19:26:45
Soarer, this is an excellent project! My implementation works nicely with a Model F 122 key terminal board. Now, when do you plan on releasing the source code? I am very interested in doing some controller level remapping for media keys and whatnot.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 June 2011, 05:39:37
Quote from: Hak Foo;359618
Is there any chance we can get the source if we want to compile our own custom mappings?  I know the all-singing all-dancing customizable version is under development, but I'd love to lock down a sensible location for a few keys the registry-based remappers ignore?

 
Quote from: REVENGE;362636
Soarer, this is an excellent project! My implementation works nicely with a Model F 122 key terminal board. Now, when do you plan on releasing the source code? I am very interested in doing some controller level remapping for media keys and whatnot.

 
It could well well Autumn before I have a chance to implement the fancy bits; looks like other stuff is going to get in the way until then :-(

So, possibly.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 June 2011, 06:47:14
Quote from: 8_INCH_FLOPPY;360683
These were all captured with me pressing the "accent grave/tilde" key. The "S" setting seemed to be about the same as the "X". It wouldn't work at all on the "A" setting, even though it works fine with my pc.

Unidentified 83-key XT Keyboard:
http://imageshack.us/photo/my-images/804/photo0017v.jpg/ (http://imageshack.us/photo/my-images/804/photo0017v.jpg/)

Monterey Keyboard with switch on the "X" position:
http://imageshack.us/photo/my-images/534/photo0018jg.jpg/ (http://imageshack.us/photo/my-images/534/photo0018jg.jpg/)
http://imageshack.us/photo/my-images/541/photo0019wj.jpg/ (http://imageshack.us/photo/my-images/541/photo0019wj.jpg/)

Monterey Keyboard with switch on the "S" position:
http://imageshack.us/photo/my-images/194/photo0020e.jpg/ (http://imageshack.us/photo/my-images/194/photo0020e.jpg/)

That Monterey is an odd beast! For starters, it's going more than twice as fast as a standard IBM XT, ~40uS per clock vs ~100uS. Then it only spends a small amount of that time high, ~8uS. Since my software attempts to track both the rising and falling edges of the clock signal, I guess it's failing to do that correctly at that speed. The strange thing is, I'd expect that to cause a lot of R04, with maybe a few other errors mixed in, but anyway the timing is something I can look at.

The 'A' settting is clearly even more enigmatic! But let's assume it's a similar timing problem for now.

The XT board, though, has perfectly fine looking timings. I can't see anything in them that would trip up my converter :-/
So I'm guessing there's something else odd about it, that maybe a trace showing the whole byte would reveal.

edit: Uploaded those pics to GH... 2nd edit: again...

Unidentified 83-key XT Keyboard:
[attachimg=1]
Monterey Keyboard with switch on the "X" position:
[attachimg=2] [attachimg=3]
Monterey Keyboard with switch on the "S" position:
[attachimg=4]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: didjamatic on Sat, 18 June 2011, 08:59:24
Nice work, I'm doing this!  Is there a downside to the ++ or is it just larger than necessarily?  Seems the ++ would be more versatile if you were only going to buy one.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 June 2011, 09:29:04
No downside apart from cost really! It just has more of everything (which the converter doesn't make any use of currently). Eventually the extra RAM and EEPROM could be used to store more and/or longer macros etc, but that's about it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Sat, 25 June 2011, 06:28:03
Soarer, one of the keys on my 122 key terminal Model F does not send any key codes through the adapter when I checked in Aqua's key test. It's the top right key in the numpad cluster. Is this a problem with my keyboard or is that key not mapped to any code in your firmware?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 25 June 2011, 07:48:04
Quote from: REVENGE;367634
Soarer, one of the keys on my 122 key terminal Model F does not send any key codes through the adapter when I checked in Aqua's key test. It's the top right key in the numpad cluster. Is this a problem with my keyboard or is that key not mapped to any code in your firmware?

 
My bad! Looks like I did half a change - I took it out of the global remaps, but forgot to put it back in elsewhere. :-(
I'll have a look at it later and see if I can remember what I intended to do!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Sat, 25 June 2011, 08:15:06
Quote from: Soarer;367653
My bad! Looks like I did half a change - I took it out of the global remaps, but forgot to put it back in elsewhere. :-(
I'll have a look at it later and see if I can remember what I intended to do!
Thanks! :) Aside from that key not sending a code, the board is currently missing default key mappings for Pause, Numpad /, and Numpad +.

Another issue I noticed: the keyboard can wake my computer from standby, but stops working afterwards and requires a re-plug. Not sure if this is a known issue or not.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kps on Sun, 26 June 2011, 11:57:23
Quote from: Hak Foo;359618
Is there any chance we can get the source if we want to compile our own custom mappings?

 
Quote from: REVENGE;362636
I am very interested in doing some controller level remapping for media keys and whatnot.


This is what I did for my 122-key F; it might help someone else. No guarantees, and I probably don't have time to hold hands.



[ATTACH=CONFIG]19817[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Mon, 27 June 2011, 23:25:48
Nice. I need to do an ANSI mod and add my RGB modifiers too. Excellent work and thx for sharing.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 02 July 2011, 10:35:00
Quote from: Soarer;367653
My bad! Looks like I did half a change - I took it out of the global remaps, but forgot to put it back in elsewhere. :-(
I'll have a look at it later and see if I can remember what I intended to do!

New version (0.995) posted that maps the top-right key of the numpad to 'Pause'.

Quote from: REVENGE;367662
Thanks! :) Aside from that key not sending a code, the board is currently missing default key mappings for Pause, Numpad /, and Numpad +.

Another issue I noticed: the keyboard can wake my computer from standby, but stops working afterwards and requires a re-plug. Not sure if this is a known issue or not.

Not known to me, at least! Does resume work fine with another USB keyboard?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: mr_a500 on Sun, 03 July 2011, 11:36:52
I'm thinking of trying this thing with an IBM 5155 keyboard. It should be the same as an XT keyboard, right? Theoretically, I'd just need a phone-style plug in and connect the appropriate lines to the teensy. Has anybody tried this?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Sun, 03 July 2011, 20:29:10
Quote from: Soarer;371928
New version (0.995) posted that maps the top-right key of the numpad to 'Pause'.


 
Not known to me, at least! Does resume work fine with another USB keyboard?

Yep, I had my BlackWidow and the Model F both connected. First off, the Teensy stays on even while the computer is suspended, the lock LEDs stay lit. Secondly, if I resume using the Model F, it will not function once the computer boots up. At this point, without resetting the Teensy, if I put the computer back to sleep and use another USB device to wake it up, the Model F will function normally again. Finally, I can always unplug and replug the Teensy to get the keyboard working again.

Thanks for adding Pause by the way, although I would still prefer to compile from source using my own mappings. :P
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 July 2011, 06:59:07
It has to stay powered for a keypress to be able to trigger the wake-up ;)  I know it's not supposed to stay fully powered, but it's the best that can be done with non-usb keyboards. Depending on OS and settings, the USB port or hub that it is attached to may get switched off (or simply ignored, if it's self-powered) because it's drawing too much current when in sleep mode, but that just means it can't send the wake-up.

Re not working after being used to wake up the computer - I need more clues!! It seems to be working ok on Windows (although I did have to change which power mode the computer was using for suspend), on Linux,  and also on Macs (apparently), so I guess part of this is working out what's different about your setup? OS, power settings (BIOS and OS), whether it's on a powered hub, pr0n cache size...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Tue, 05 July 2011, 08:04:41
Quote from: Soarer;373627
Re not working after being used to wake up the computer - I need more clues!! It seems to be working ok on Windows (although I did have to change which power mode the computer was using for suspend), on Linux,  and also on Macs (apparently), so I guess part of this is working out what's different about your setup? OS, power settings (BIOS and OS), whether it's on a powered hub, pr0n cache size...

Still waiting for Explorer to scan the pr0n cache and total up the file sizes, I'll get back to you on that one. Do you need to know my web history as well?

Windows 7 64-bit, S3, not sure what you can do with power settings in Windows, powered mobo hub.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 July 2011, 08:59:05
It's just the size that counts!

I'll check next time I reboot what I set in my BIOS, I might've changed it from S3 to S2, but I forget! Before I changed it, the port was being powered down by the PC, so wake-up didn't work at all.

I'm all XP at the moment. Sometime soon I'll be setting up a Windows 7 PC, it will probably be 32-bit, but that shouldn't make much difference to this problem. I'll look at it then.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Tue, 05 July 2011, 10:19:09
Quote from: Soarer;373666
It's just the size that counts!

I'll check next time I reboot what I set in my BIOS, I might've changed it from S3 to S2, but I forget! Before I changed it, the port was being powered down by the PC, so wake-up didn't work at all.

I'm all XP at the moment. Sometime soon I'll be setting up a Windows 7 PC, it will probably be 32-bit, but that shouldn't make much difference to this problem. I'll look at it then.

Sounds good, mad props again for developing and maintaining this project. :P
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: mr_a500 on Sun, 10 July 2011, 09:02:02
So nobody has ever tried this with an IBM 5155? (that means I'll be the first... in history!)

(http://img59.imageshack.us/img59/3530/5155.jpg)

(http://img96.imageshack.us/img96/1171/closeupi.jpg)

I'm thinking of getting something like this:
(http://d3d71ba2asa5oz.cloudfront.net/43000333/images/541-1-ab.jpg)

...and put the Teensy inside of it. Connecting the wires should then be no problem. My only problem is that I don't know which pin is what. How can I find out?

Maybe my "Googling skills" aren't great, but I can't find any pinout information for the 5155.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kps on Sun, 10 July 2011, 09:25:25
Quote from: mr_a500;377416
My only problem is that I don't know which pin is what. How can I find out?

 
Open it. Power and ground should be straightforward to identify. Data & clock might take a bit of tracing (though it's more likely the same as the PC), and getting them backwards on the first try won't hurt anything anyway.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: mr_a500 on Sun, 10 July 2011, 09:35:05
You mean open the keyboard? That could be tricky. There are no screws. It looks like it was assembled by snapping the front in and it looks difficult to snap it out again. There are small cracks all around the edges. I don't want to break it by trying to pry it apart. Even if I was successful, it would probably be loosened - and the sturdy feel of this keyboard is the main reason I like it.

No, I don't think I'll attempt to open it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 10 July 2011, 10:07:25
If you have a multimeter, you might be able to work it out without taking it apart.
Measure resistance between the case (obviously, need to find some metal part!) and each pin...
One or more will have 0 resistance, so they're grounds.
Power will have some resistance (about 780 ohms on the 122-key board I just tried).
Data and clock might have the same reading (about 2.8k on this board), or, if it's like the PC-XT, then data will be lower resistance than clock (both would still be higher than from case to power).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Sun, 10 July 2011, 19:58:31
Revenge:  I think I've had a similar symptom.  Only happened since 0.99.5, but it seems like once it powers off, you have to unplug/replug to make it work again.  Even hard power-off (cut the line power, not software power-off) doesn't help.

Mobo: MA790X-UD4, using an on-board port
OS: Windows 7 64-bit
Board: 6110345 (122-key F, as most of us use)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LETE on Wed, 20 July 2011, 14:51:56
Quote from: kps;368471
This is what I did for my 122-key F; it might help someone else. No guarantees, and I probably don't have time to hold hands.



These files aren't much use without the source code, right? Or did you just inject the resulting hex code into the main hex file?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Wed, 20 July 2011, 15:03:01
You write the teensy firmware with this hex file.  It's a complete firmware.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 20 July 2011, 15:04:46
[strike]I didn't work out what they were for either.... presumably OS side somewhere.[/strike]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LETE on Wed, 20 July 2011, 15:25:11
I'm talking about the files kps posted in the attached zip file "remap.zip" on page 12. They're basically the look-up tables used to generate compatible scancodes.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Wed, 20 July 2011, 15:36:06
Just looked at the contents, it's got a makefile and everything is automatic... it specifies the input:  Soarer_at2usb_v0.994_teensy2.hex  and modifies it to produce patched.hex   which is then a complete replacement firmware itself.

edit:   will not be possible to do this to any other rev of the FW without figuring out the addresses equivalent to start1a/start1b/start2/start3 from the one he patched.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LETE on Wed, 20 July 2011, 15:41:53
Ah, well said. Thank you.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 20 July 2011, 17:34:30
Oh... so that's what it does... outrageous subterfuge!!

I should warn anyone trying this, that my remaps happen after those tables, so you may not get what you intended!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Wed, 20 July 2011, 17:39:59
The people WANT YOUR STUFF... ;)  they just want it their way.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Wed, 20 July 2011, 18:18:08
Quote from: Soarer;384288
Oh... so that's what it does... outrageous subterfuge!!

I should warn anyone trying this, that my remaps happen after those tables, so you may not get what you intended!
Soarer, I understand you're not ready to release your source, but I would be satisfied in the meantime if you could include a proposed layout for the 104 key Terminal Model F. Specifically, Esc and Pause need to be moved the left side function cluster since there's no Numpad area on those boards.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kps on Wed, 20 July 2011, 20:30:18
Quote from: Soarer;384288
Oh... so that's what it does... outrageous subterfuge!!

Thanks!

Quote
I should warn anyone trying this, that my remaps happen after those tables, so you may not get what you intended!

I thought so, from the table contents. It's enough to get my Terminal F layout working, though.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LETE on Thu, 21 July 2011, 21:50:47
I'm going to stick a couple solid state relays in my box and set this thing up to control my lamps. I shouldn't have to stand up to turn those things on and off when I've got so many extra buttons on my keyboard.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LETE on Fri, 29 July 2011, 10:38:44
Here are a few pictures of my teensy mounting solution for a model F terminal board. My four terminal boards have an extra pcb mounting spot so I decided to take advantage of it. I bought some perf board, a screw and some female to female jumper wires and in 8 minutes I was up and running. No soldering makes it completely reversible, the teensy board is held in by friction alone, but it feels solid enough.

[ATTACH=CONFIG]22675[/ATTACH][ATTACH=CONFIG]22676[/ATTACH][ATTACH=CONFIG]22678[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: SmallFry on Wed, 10 August 2011, 23:08:48
Is it possible that I could get the source code? I wanted to recompile/edit a little/etc this to work with my AVR Butterfly (ATmega169)...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 11 August 2011, 09:04:38
Quote from: SmallFry;396808
Is it possible that I could get the source code? I wanted to recompile/edit a little/etc this to work with my AVR Butterfly (ATmega169)...

Sorry, I'm not ready to give it out yet. It might be a while because I'm very busy with other stuff for at least the next month or two.

I think it might anyway take a fair bit of effort to get it working on that chip, since I don't think it has hardware USB support.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: SmallFry on Thu, 11 August 2011, 12:30:26
Alright, thanks anyways Soarer
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Fri, 12 August 2011, 09:53:17
Soarer, perhaps the GH community could help with building a front end? something that did nothing more than build an input file ...

=
=
=
 
You can name the format that works.
How can we help you?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 18 August 2011, 08:47:50
Quote from: wcass;397641
Soarer, perhaps the GH community could help with building a front end?
How can we help you?

I'm sorry, I missed this! Thanks for the offer!

I would like some help with the front-end and cross platform stuff (particularly OSX) - the way I envisage it, it breaks down into 3 or 4 components, so it is ideal for sharing the work! Even having alternate front-ends, if that suits people. However, one or two of those I have to write, so I'm still the weak link :(

The layers would be...
The input file to the compiler will be something like you suggest, rather than full tables, since that's how my remapping works on the Teensy. But there can also be multiple sections, each one tagged with enough information to decide when to apply the remappings - e.g. globally, for set3 terminal boards, or perhaps by individual keyboard ID.

So, I need to write the device part (which I can't really test without also writing the driver part for Windows!), and also define the binary format within the EEPROM, in a way that allows for future extensions (macros, etc).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Sun, 28 August 2011, 00:37:50
so a couple of questions.

input file format should be ... what? default name?
comment character would be what? - i'm using # in this example)
will your code ignore white space and letter case?
Quote
3a=1D # cap lock = left ctrl
  1d = 3A # left ctrl = caps lock
     ... etc
some (mostly terminal) keyboards send key combinations like [shift]+[F1] for a single key-press of [F13]; is your code able to catch [shift]+[F1] and spit out something like ...
     
Quote
2A+3B=e0 30 # F13 = volume up
     2a+3c=e0 2e # F14 = volume down
     ... etc

macros would be written like ....
     
Quote
6b=E0 48+E0 48+E0 4D+E0 4B # F20 = (arrows) up up right left
     ... etc

is this reasonable expectation?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 28 August 2011, 08:15:48
I'm imagining something along the lines of this:
Code: [Select]
# colemak
!remap
!type=global
D=S
E=F
f=t
G=D
# ...
P=SEMICOLON
semicolon = O

# extra keys on a modded AT-F
!remap
!type=set2
FAKE_02 = LEFT_ALT
FAKE_04=RIGHT_ALT
# ...
(Case insensitive and spaces ignored).

The remapping happens using page 7 HID codes (mostly), and I have a spreadsheet with textual names for each of them already, so it would be easy to generate a table for converting the text to binary codes (e.g. SEMICOLON to 0x33). I say mostly, because I've also crammed the system and media keys into the same table (and some fakes as well, to avoid clashes) - this means every key function is coded by a single byte.

Macros are still a big TBD! I have the output side implemented, so punting a series of codes out is not a problem. Each entry in the output queue is a pair of a command byte and a data byte - I've got command bytes for changing modifiers, saving/restoring modifiers, key up, key down, etc. And I've hardcoded the trigger logic to handle the few 'odd' keys on the XT and AT. But there's still a lot of thinking to do to get it data driven, so I don't think user-definable macros will be part of v1.0.

That said, there's three kinds of macro, and for those triggered by a single key, implementation would be quite simple. In increasing order of trickiness:
Single key - can have separate macros for press and release (up to the user to make sure they make sense!)
Combination1 - single macro that is played when a combination is pressed
Combination2 - separate press and release macros (release is very tricky to track!)

What makes these things tricky is the lack of RAM, mainly.

Leaving aside that remapping shift-F1 etc is going to prevent you using that combination for its normal purpose, it sounds like you'd want the second combination type for that volume up/down example, because even the first one would leave you repeatedly pressing the key rather than just holding it down and letting it repeat.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Sun, 28 August 2011, 14:04:17
would it conserve RAM to only include key mappings for the hardware and configurations  one expects to use? For example, if i don't know Dvorak or Colemak then leave support for these out; if it will only be used with a standard 101 key - don't include code to handle F13-F24.

if you were to go this way, it would be configured in the front end - there would probably need to be a keyboard database with keyboard make, model, all the make/break scan codes that the controller can produce.

i see advantages of making such a thing a web app - one user would supply the scan code map for a "new" keyboard and add it to the database. other users with that model would benefit. notes about specific keys/keyboards would be displayed in the UI when  they are selected such as "this key does not send a break code and  therefore ..." or "this key is equivalent to [shift]+[F1] and therefore ...". a web app could also support the costs to develop and host itself with ads and/or "donate" buttons. A user would go to the web page and ...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 28 August 2011, 16:01:46
Oh, I was just using Colemak as an example, it needn't be included all the time. And for F13 etc, unless mappings were in the config file, they wouldn't take up any EEPROM space. There are some small tables used to remap the FAKE entries to usable codes, but these live in ROM, and there's plenty of that :-)

There's certainly no reason why the compiler couldn't read multiple input files before spitting out the binary EEPROM image, but I don't think there's a need for a keyboard database since the majority fall into one the four types already handled (any keys with special codes in, say, extended set 2, would need modifications to the hardcoded part of the converter anyway).

The web server idea is great, but would need to hande uploads carefully, and need a server that stays up, etc. Another option is to use a web browser for UI, but have it all run locally... the snag with that is that people update browsers, and it might break something (particularly since we'd want to read/write files), so could be a maintenance headache to keep the code compatible. On the other hand, everyone has a web browser already, so there's no scripting runtime to install. Third option would be some scripting language which has reasonable cross-platform UI support (python?). The latter has the advantage that it's no problem to call the driver to upload the compiled binary to the converter.

So far, I've been thinking only of uploading the remaps and macros to EEPROM using this setup (i.e. The main firmware would not be reloaded each time). This means you don't even have to press the button on the Teensy in order to change mappings, and your keyboard stays operational throughout. That's nice, but there's so much ROM space free, that it's tempting to reload with a modified firmware (which is what you were thinking...?).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Sun, 28 August 2011, 23:19:10
yes, i was thinking to reload firmware when changing key maps and macros. speaking for myself, i would be be changing my computer much more frequently than key mapping.

and as far as web services go, pjrc might offer support as it inherently promotes their product. iMav might help as it is aimed at his target audience. sourceforge might work. and this forum is full of people in information technologies fields - all you need to do is ask.

if - like many programmers - you don't feel comfortable asking, i would be happy to ask for you.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 29 August 2011, 04:43:47
Heh, it's not that - I'd always planned on asking for someone to do the front end when it was time! I'd rather it didn't require a server though, it just seems unnecessary. Especially if browser based, it (or the user) can easily go and fetch definition blocks from all over the place anyway. If Javascript is sufficient, I think that's the way I'd like to go - reading files would be no problem, running them (to load the mappings onto the Teensy) might mean faking a download? Obviously directly running another app is a no-no, but with a file association it could.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Mon, 29 August 2011, 23:14:37
box an xampp install with the package.

I've pondered doing that with an in-house web-based package-- make it a local site
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: timofonic on Wed, 07 September 2011, 03:18:55
About macros and remappings... What about showing it as a Mass Storage Device with the files on it? It would save the use of extra software.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Shawn Stanford on Wed, 07 September 2011, 06:57:46
Well, I went ahead and ordered a Teensy 2.0, a breadboard and a set of LEDs. I've never done anything like this before, so...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Wed, 07 September 2011, 10:17:54
Shawn, it's a great project to start with. Pretty straightforward, and great payoff (all those old terminal and xt boards are now usable!)

It's an awesome project, and i'm excited about the next phase as its being discussed here.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: itlnstln on Wed, 07 September 2011, 10:37:06
Quote from: ripster;412020
Go Shawn!

I've been waiting for a "Dummy's Guide" including all the physical parts and lots of pics.  Plus I still have some microcontroller USB burner lying around in case anyone ever starts selling PCBs.

So, in other words, you're calling Shawn a dummy.  Way to support our troops.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: one_each on Wed, 07 September 2011, 11:19:54
IF THE-KEY-PRESSED-HAS-A-KEYCAP-WITH-A-ON-IT THEN
  SEND-THE-CODE-FOR THE-LETTER-A.
END IF

Its been a long time since I worked in COBOL.  Java/HTML/CSS/JavaScript for my day job, C/C++ and assembly when at home.

Soarer, this is a very cool project so keep up the good work.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: itlnstln on Wed, 07 September 2011, 12:40:04
I'm lame.  VB.NET for the win.  I'm a DB guy, not a programmer.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 07 September 2011, 21:04:19
Quote from: Hak Foo;407197
box an xampp install with the package.

I've pondered doing that with an in-house web-based package-- make it a local site
Seems a bit heavyweight for this! I think if JavaScript can't do it, a Python or Java app would be the next choice. (Might be a better choice anyway, for other reasons).

Quote from: timofonic;411919
About macros and remappings... What about showing it as a Mass Storage Device with the files on it? It would save the use of extra software.
The storage is so small that there isn't enough room for the allocation tables and directory entries etc that you need for a file system!

Quote from: Shawn Stanford;411952
Well, I went ahead and ordered a Teensy 2.0, a breadboard and a set of LEDs. I've never done anything like this before, so...
And you have a socket, I hope! Just start with wiring the socket to the teensy, then see if it works, then fix or add more bits. We're here if you get stuck :-)

Quote from: one_each;412052
Soarer, this is a very cool project so keep up the good work.

Quote from: Oqsy;412017
It's an awesome project, and i'm excited about the next phase as its being discussed here.

Thanks guys! I hope the next stage won't disappoint!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kps on Thu, 08 September 2011, 10:55:58
Quote from: one_each;412052
IF THE-KEY-PRESSED-HAS-A-KEYCAP-WITH-A-ON-IT THEN
  SEND-THE-CODE-FOR THE-LETTER-A.
END IF


No, no, no.

During the day, whenever someone presses a key, you simply append the matrix position to a tape. Then at night, after all the typing is done, you take that input tape, plus another tape containing tables of matrix codes and USB key codes, and run the program to generate an output tape. Then you take that tape from the keyboard's output tape drive over to one of the computer's tape drives and read it in.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: timofonic on Thu, 08 September 2011, 22:09:24
Quote from: Soarer;412363
The storage is so small that there isn't enough room for the allocation tables and directory entries etc that you need for a file system!

OK, sorry. I did think the structure would be able to be generated in-time. There would be just one or two text files, then regenerate the needed firmware part. Maybe this is just a pipe dream, I'm still too bad at computer programming and too much unrealistic imagination...

What about adding a bluetooth module for the future? I know it's not feasible and out of the scope of this project, but it could be nice to have the Ultimate Keyboard Adapter (TM) :D
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 September 2011, 04:35:30
Quote from: timofonic;413121
OK, sorry. I did think the structure would be able to be generated in-time. There would be just one or two text files, then regenerate the needed firmware part. Maybe this is just a pipe dream, I'm still too bad at computer programming and too much unrealistic imagination...

Of the four layers (http://geekhack.org/showwiki.php?title=Island:17458&p=400916&viewfull=1#post400916) I was thinking of, the driver is actually the easiest part. The device part isn't horribly complex either, and mainly just allows a single file to be written to (and read from) the Teensy's EEPROM.

Quote from: timofonic;413121
What about adding a bluetooth module for the future? I know it's not feasible and out of the scope of this project, but it could be nice to have the Ultimate Keyboard Adapter (TM) :D

Gonna need a good battery!!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: timofonic on Fri, 09 September 2011, 11:37:54
Quote from: Soarer;413226
Of the four layers (http://geekhack.org/showwiki.php?title=Island:17458&p=400916&viewfull=1#post400916) I was thinking of, the driver is actually the easiest part. The device part isn't horribly complex either, and mainly just allows a single file to be written to (and read from) the Teensy's EEPROM.



Gonna need a good battery!!

 
Like this board (http://geekhack.org/showwiki.php?title=Island:19104)? They use a common Broadcom bluetooth controller.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 September 2011, 12:06:47
The battery comment wasn't a joke!

Those things work great as controllers for contact switch keyboards - they can go to sleep between keypresses and save a lot of power. That trick doesn't work for capacitive switches at all. And for my converter, it's not feasible to cut power to the keyboard and put the Teensy into a low power state - it would at the least require extra circuitry. Even if it could, what would wake it up! So there's a constant power drain to the Teensy and keyboard, which is many times what the bluetooth module uses even when it's awake.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Fri, 09 September 2011, 14:43:15
Lawn mower batt work? :P
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 September 2011, 16:53:18
Bettah!

(http://www.jetplanes.co.uk/modelaircraft/sc25_model_plane_engine.jpg)

You could fit one a terminal keyboard's case, no problem. Look a bit daft controlling your HTPC with it though.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 September 2011, 22:26:32
Quote from: Soarer;373666
It's just the size that counts!

I'll check next time I reboot what I set in my BIOS, I might've changed it from S3 to S2, but I forget! Before I changed it, the port was being powered down by the PC, so wake-up didn't work at all.

I'm all XP at the moment. Sometime soon I'll be setting up a Windows 7 PC, it will probably be 32-bit, but that shouldn't make much difference to this problem. I'll look at it then.


I had changed the ACPI setting in my BIOS to S1. IIRC, in S3 the wakeup simply didn't wake it up. Might be worth a try - it's safe, and easy to reverse.

Finally installed Windows 7 SP1 64 bit, so I'll try and reproduce that problem tomorrow.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: timofonic on Sat, 10 September 2011, 06:31:35
Quote from: Soarer;413351
The battery comment wasn't a joke!

Those things work great as controllers for contact switch keyboards - they can go to sleep between keypresses and save a lot of power. That trick doesn't work for capacitive switches at all. And for my converter, it's not feasible to cut power to the keyboard and put the Teensy into a low power state - it would at the least require extra circuitry. Even if it could, what would wake it up! So there's a constant power drain to the Teensy and keyboard, which is many times what the bluetooth module uses even when it's awake.

Well, the oriiginal battery fromm. The bluetooth keyboard was 1xx mah and lastedd a week, so the 850mah one could last at least a month.

Just imagine the possibilities, it could be the ultimate geekhack tool.

Enviado desde mi STM7UW usando Tapatalk
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 September 2011, 09:51:22
Quote from: Soarer;413737
Finally installed Windows 7 SP1 64 bit, so I'll try and reproduce that problem tomorrow.


Unable to reproduce :-/

BIOS Power Settings at defaults (S3).
Fresh Window 7 install.
Went into Sleep OK.
Woke up from Sleep by Model M plugged into my converter...
...which still worked fine afterwards.

Not sure what else I can try.

Is anyone else having problems using Win7 Sleep and waking it up with my converter? Or finding it works OK?
Feedback either way please :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Sat, 10 September 2011, 10:35:11
It seems to be alonbg the lines of

suspend
wake via converted board
power down
converted board may be dead
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 September 2011, 10:39:03
power down?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Sun, 11 September 2011, 13:43:11
start-> shut down?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 11 September 2011, 14:22:28
Quote from: Hak Foo;414495
start-> shut down?

I dunno, you said it! :-p

I'm confused as to how power down is part of a problem with suspend and wake-up!

This was the original problem description I was responding to...

Quote from: REVENGE;372784
Yep, I had my BlackWidow and the Model F both connected. First off, the Teensy stays on even while the computer is suspended, the lock LEDs stay lit. Secondly, if I resume using the Model F, it will not function once the computer boots up. At this point, without resetting the Teensy, if I put the computer back to sleep and use another USB device to wake it up, the Model F will function normally again. Finally, I can always unplug and replug the Teensy to get the keyboard working again.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 27 September 2011, 16:38:23
OK guys, I am totally stoked.

I received an IBM Model F 122-key terminal keyboard from ebay today, and it is INCREDIBLE !

To call it an awesome behemoth is an understatement, this thing is the Mother Ship.

It was filthy, inside and out, so I completely dismantled it and cleaned everything. Even that was easy, I have dismantled both XT and AT Model Fs (no fun at all with the spacebar thing .... ) and this was smooth and simple in comparison. Bigger is certainly better, and if Ripster's theory about weight=good then this has got to be the best keyboard ever made.

So now it is immaculate, but I have to wait until my Teensy gets here (and I got the plain base model, it did not look like there was any advantage to the ++ model), and I want to go all-internal.

I will surely need to ask you gurus some questions, but it looks like my quest for the ultimate keyboard may be nearing its conclusion.

Thank you all so much for guiding me along.

Later, Harry

PS - I will scavenge keycaps from multiple keyboards to suit my final mapping scenario, but do any of you guys have an "Enter" key, which I presume is UK/Euro style, for sale or trade? thanks
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Wed, 28 September 2011, 20:59:46
Harry, did you snag yours from OceanTechPrecision on ebay? Does it have dip switches on the bottom? Also, it comes with the Euro style tall enter key. Do you want the wide ANSI style one, instead?

I have 2 (from 2 different sellers) that have no switches, and for whatever reason, this adapter behaves...strangely. I disassembled, swapped some keys around to make it ANSI/UNIX, and reassembled one of them. When I connected this adapted (using a teensy++), I just get endless repeats of a key until I press another key, which then endlessly repeats, etc.

I thought maybe I screwed up, so I connected my other 122 key F, that hadn't even been cleaned yet, and it behaved exactly the same way.

What's weird, is that neither of these have the dip switches. One of which from 4 Aug 1984, the other some April 85, I think (it's not here at the moment). Inside, on the controller, are exposed pins next to where the cable plugs in, and on the PCB itself it says KBD ID A over one set, and KBD ID B over the others. Do I need to jumper these somehow, to replicate having the dip switches all up or all down?

Anyway else getting weirdness at all?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Wed, 28 September 2011, 21:23:48
It can misbehave quite severely if you attempt to press any keys BEFORE the auto-detect-what-type-of-keyboard-is-connected process has finished...that can take upwards of 5 seconds in an extreme case. Plug in, ensure OS recognizes the device (makes its little noise if applicable), count to 5 slowly, then try.

Took some getting used to since I normally just hammer on caps lock when I plug in a keyboard so I can see when the system has begun recognizing it, but if you press any keys before the auto-detect process Soarer's code does is complete, it screws it up and will either play dead or simply misbehave. I haven't seen that exact symptom myself, theferenc, but it wouldn't surprise me if it's related.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 28 September 2011, 21:32:37
Sounds like the adapter is somehow thinking it's a scan code set 2 board, so not trying (or not being able) to tell it to send release codes.

One way it decides is by the keyboard ID, so perhaps changing that will make it work. Those pins will do that the same as the DIP switches on other models. Are there any jumpers on them at the moment?

To be sure what going on, can you run the hid_listen (http://www.pjrc.com/teensy/hid_listen.html) program to capture the auto-detect sequence?

For a normal 101 key board, it should read wEE rEE wF2 rFA rAB r83. For a terminal board, there should be a few more bytes and a different ID (the rAB r83 part).

edit: And yes, don't be as impatient as kishy, bashing keys just after it's plugged in!!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 28 September 2011, 21:59:08
Thanks, but I am not there yet. It will be sometime next week before my Teensy gets here, so all I can do is look at the inert mechanism wistfully.

These comments may well save me some time and heartache when I put it together, so I am very interested.

Yes, I did get the board from Ocean Tech, and it was made June 13, 1985. There are no DIP switches, I am pretty sure, although I will look again very closely.

The key that should be the "Enter" key says "Field Exit" and the actual "Enter" is at the bottom right where Control is normally found. I am hoping to change this to a layout that is something as close to a standard Model M as possible, with an extra set of function keys on the left, old style.

I really hope this will work.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Wed, 28 September 2011, 22:08:05
Thanks, kishy. I'll give that a try and see if it fixes the issue. I would really love to make these beasts function, as they are just so nice. And I could finally decide if I prefer the M or the F.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hak Foo on Wed, 28 September 2011, 22:12:21
The Enter labelling is just for decoration- the converter ighnores it.  I have a 122M with a Field Exit enter key.  And the numpad Enter is Field +.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Thu, 29 September 2011, 09:01:03
Running hid_listen, I get the following:

rAA rBF rBF
wEE R101wF2 rEE wED R100!!00wED rFE !!FEwED R100!!00rFE

I waited for that to appear, then typed all of the above, and then I tried the keyboard. I got

asdfllll;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;dddddddddddddddddddddddddddddddddddddddddd

The funny thing is, according to hid_listen, it looks as if it should be doing better than it is. For each key I press, I get the down code of that key. But no up code, for whatever reason.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 29 September 2011, 09:58:19
It looks like it's just unusually slow to reply to commands - like world record holder slow! Otherwise, it seems to be reading and writing bytes just fine, and its ID is BFBF, which is typical and won't cause any confusion. PM on its way.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Thu, 29 September 2011, 12:51:41
Soarer is the man! Hopefully it continues to work as well as it does right now -- though I may have some spring/hammer issues to work out.

Thanks a ton!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Thu, 29 September 2011, 18:28:24
Great news!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Thu, 29 September 2011, 19:17:53
So one last question about this. The key on the keypad, directly above 9. What is its default mapping in the converter? Does anyone know?

When I try to get its keycode in X, xev just pukes out

Code: [Select]
FocusOut event, serial 8008, synthetic NO, window 0x3800001,
    mode NotifyGrab, detail NotifyAncestor                  

FocusIn event, serial 8008, synthetic NO, window 0x3800001,
    mode NotifyUngrab, detail NotifyAncestor              

KeymapNotify event, serial 8008, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0  
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

showkey gives me keycode 70. But terminal keycodes don't map to X keycodes, unfortunately, so I can't make use of that. At least I know the kernel recognizes it just fine.

Any help is appreciated!

On a happier note, the kernel recognizes every single one of the 122 key on this beast. That's after I converted it to my beloved UNIX layout, meaning I'm using pads that aren't used in the default layout, and not using pads that are. So kudos for that!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 29 September 2011, 19:43:01
It's scroll lock... what does that do in X?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: N8N on Thu, 29 September 2011, 21:08:19
nothing at all, really... but I just tried it on my machine and scroll lock comes up as keycode 78 (Model M through Belkin converter, just fired up xev and hit the scroll lock key, if that makes any difference)

KeyPress event, serial 33, synthetic NO, window 0x5200001,
    root 0xa1, subw 0x0, time 4878851, (319,159), root:(337,290),
    state 0x10, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

KeyRelease event, serial 33, synthetic NO, window 0x5200001,
    root 0xa1, subw 0x0, time 4879011, (319,159), root:(337,290),
    state 0x10, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Thu, 29 September 2011, 21:25:30
Yeah, I thought it should be scroll lock, but it doesn't match scroll lock on my other keyboard, at all. At least, it doesn't generate the same xev codes.

I'll try remapping it anyway, to be something more appropriate for me (*, in this case). I can find it in my xmodmap and just go ahead and change it. I have every other key in there already mapped appropriately.

Thanks!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 30 September 2011, 18:41:42
Just posted a new version (v0.996) with fixes for some reported problems, and a couple of alternative remappings for terminal keyboards.

The alternative mappings are enabled by setting the keyboard ID (http://geekhack.org/showwiki.php?title=Island:17458&redirect=no#Keyboard+IDs) to one of the following:

9FBF
key in centre of cursors -> cursor down
right alt -> left gui
europe 2 -> left gui
F13 -> play / pause
F14 -> prev track
F15 -> next track
F16 -> volume up
F17 -> volume down

AFBF
LF1 -> Escape
LF2 -> Pause
LF3 -> NumLock
LF4 -> ScrollLock
Keys around numpad, clockwise from top-left -> NumLock, Slash, Asterix, Minus, Plus, Equals

(LFx are the function keys on the left hand side).

I've also been tidying up the main article over the past couple of days, it was overdue :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Fri, 30 September 2011, 19:54:35
That second one is almost exactly how I have mine laid out at the moment. Too bad I don't have dip switches to set the ID with.

But that's what xmodmap is for, right?

And by the way, I was able to fix that mapping. I still couldn't get it to be recognized as scroll lock, but I remapped what SHOULD have been scroll lock, and now it's working fine. I have no idea. Probably something weird with how our particular RHEL setup is configured.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 30 September 2011, 20:09:11
Ah, but instead you have the jumper block inside! I've chosen the IDs so they only require one jumper to be fitted. But if it's not exactly what you want, it's better to use the default map anyway because it has unique codes for each key :-)

Glad you could sort out the scroll lock somehow - that was odd!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: SmallFry on Fri, 30 September 2011, 23:36:28
Just a thought... not really necessary but it'd be cool to add support for the SD reader. (http://"http://pjrc.com/teensy/sd_adaptor.html) Then, instead of plugging in my flash drive, I could buy myself an SD card to use for my flash drive. Would that be possible? Also, I think there's a way to make AHK run portably, then we (with odd layouts/122s<---me) could add custom keymaps directly to the SD card as a AHK script. Just for convenience sake:)
Thanks for any input Soarer
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Sat, 01 October 2011, 00:01:00
AHK runs portably, for certain sure. It's just a download directly from their website.

I gotta tell you though, these beasts are NOT portable. I leave mine connected to the same linux workstation all day, every day. It's just too damn big and heavy to move around much. In that regard, I would say just run it on the machine you're connected to, rather than the SD card in your keyboard.

Though, just from a novelty perspective, that would really amuse me.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: SmallFry on Sat, 01 October 2011, 00:11:23
My school would have a hacker alert stroke if I wired in like at home. Therefore, I would need to move my board with me as well as keep my "hacker" stuff hidden. Heh.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Sat, 01 October 2011, 01:12:57
The perfboard and alligator clip rig I'm using for this would surely get a bomb squad called on me if I tried to use it at a uni or library.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Mon, 03 October 2011, 21:49:06
Here's what I've been working on for the last little while... (http://kishy.dyndns.org/kbconverters/soarer/)

Complete with externally-accessible reset button and lock LEDs, built-to-order for a fellow Geekhacker.

At this time I am not taking further orders for my assembly service, but it's something I'm considering since I did get Soarer's blessing for it.

[ATTACH=CONFIG]27864[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: timofonic on Tue, 04 October 2011, 03:28:40
Quote from: kishy;425809
Here's what I've been working on for the last little while... (http://kishy.dyndns.org/kbconverters/soarer/)

Complete with externally-accessible reset button and lock LEDs, built-to-order for a fellow Geekhacker.

At this time I am not taking further orders for my assembly service, but it's something I'm considering since I did get Soarer's blessing for it.

(Attachment) 27864[/ATTACH]

 
Hello.

Very nice! I would consider ordering one too...

What about adding a SD card interface? Would be possible to use it both for configuration files (mapping, macros, etc) and an optional LCD for showing the current keymap (plus two buttons for switching)?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Tue, 04 October 2011, 06:44:09
Quote from: timofonic;425879
Hello.

Very nice! I would consider ordering one too...

What about adding a SD card interface? Would be possible to use it both for configuration files (mapping, macros, etc) and an optional LCD for showing the current keymap (plus two buttons for switching)?

What I did is essentially just 'packaging' the adapter...I did not make any design changes, so to speak. I would not know how to implement that, but I suspect it can be done with some amount of work...would be best to wait for Soarer to weigh in on that to see if it might ever happen. I do agree it would be nice, but I believe he's working on other ways to simplify end-user keymapping as it is.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Tue, 04 October 2011, 08:19:56
7 pins for the LCD... 2 pins for up/down buttons... 5 pins for the SD card slot... 2 pins for the keyboard...

At first look there are no collisions between the pins necessary.  It would be minimum features on the LCD tho, no contrast changing, but functional.  It's then a question of whether the teensy has enough space for programming all the devices.  I also know nothing of multiple end-point USB in order to support the SD and KB interface at the same time.  You could do a boot-loader deal where you hold down one/both of the LCD control buttons on startup and it makes SD the end-point for USB...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: one_each on Tue, 04 October 2011, 11:08:05
@Soarer  Have you considered using something like code.google.com to host the code as it is in development?  You can limit it to just you making commits but others could help out and send you patches for fixes.  You can even track things you want to change and others may step up to do the actual work.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: timofonic on Tue, 04 October 2011, 12:34:39
@Soarer

In terms of available pinout, memory and such...

How's the Teensy2 or Tenensy2++ used? I mean if you and others can add features to your project in the future, the possibilities of free resources from it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Tue, 04 October 2011, 12:58:49
I'm not exactly sure what it is you're asking timo, but if you scroll to the top of the page and click 'Article' you can read the wiki on this project if you haven't already.

The converter only uses 2 data pins on the teensy.  There are an additional 3 pins for lock LEDs (caps/num/scroll)  It's really whether the particular features requested can be integrated without conflicting with each other, and whether those features inhibit the proper behavior of the converter for the primary purpose.  The pins for the converter itself can easily be reassigned, since none of the assigned pins are being used for their alternate or special features.

As mentioned in the info on pjrc for the LCD display I looked at, there are 2 methods of interfacing to it, one requiring more 'horsepower' from the teensy the other requiring an additional pin.  Considering that pins appear to be in abundance I pointed out the 7 pin, less CPU option.  It doesn't look like the LCD uses any special functions pins.

The SD card interface uses special functions of specific pins to function, so those are hard assigned.  

Then there is the programming of these features.  If the teensy does not have sufficient ROM space, then the teensy++ does have more space and as an added bonus it has more IO pins.

All in all it looks like it could be done.  Whether or not those features can coexist at the same time without resetting the teensy is not one I'm familiar with.  Having the teensy present itself as both a HID device for the KB and as a mass storage device for the SD card at the same time is not something I've dealt with.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 04 October 2011, 15:01:50
Help !

Getting very close, I think, but I am way over my head here, and I am not a programmer by any means.

I received my Teensy, wired it up, flashed it, and followed the instructions that I could find. I downloaded and used the manufacturer's files and instructions. I have downloaded Soarer's USB v0.996 file but perhaps I did not use it correctly.

Windows XP told me that the new USB Human Interface Device was found and was ready to use. Most everything seems to be OK, but the keyboard does not register anything realistic.

When I press any key, the LED on the Teensy comes on for about 2 seconds, then goes off. Running hid_listen.exe registers R05 when I press any key, and I understand that this is a clock error, but I don't really know what that implies.

There are vague mentions of jumpers being set. I have a 122-key Model F terminal keyboard and the Teensy 2.0 (not plus plus). I have only plugged in 4 wires, I cut off the original cable and connected black to VCC, white to Ground, yellow to PD0, and red to PD1, (the cable was shielded but the shield is not connected to anything, should I?) and plugged in to the controller the same way it was originally.

So what do I do now? And if you can, in plain English, and please assume that I am really stupid and incompetent.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Oqsy on Tue, 04 October 2011, 16:14:22
Have you checked yr pinout from the keyboard?  I have no idea what colors mean what in these terminal boards, so others might be of some help. Most of us use the connector on the cable as-is and put a jack/outlet for the DIN between the keyboard and the teensy. The pinouts are known and don't vary like the colors of leads.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 04 October 2011, 16:19:20
Quote from: kishy;425809
Here's what I've been working on for the last little while... (http://kishy.dyndns.org/kbconverters/soarer/)
Thanks for showing your build!
 
Quote from: timofonic;425879
What about adding a SD card interface? Would be possible to use it both for configuration files (mapping, macros, etc) and an optional LCD for showing the current keymap (plus two buttons for switching)?
SD card is almost definitely a 'no'. There's no shortage of space (in EEPROM) on a Teensy++ for those things, and even the regular Teensy has a reasonable amount (that would be enough for most people). And also, it would be a lot of work to make the card appear as a drive over USB.

I don't know how selecting keymaps on-the-fly will be done yet, but it will be a goal to do it with as little hardware as possible!
 
Quote from: one_each;425957
@Soarer  Have you considered using something like code.google.com to host the code as it is in development?  You can limit it to just you making commits but others could help out and send you patches for fixes.  You can even track things you want to change and others may step up to do the actual work.
Yes... I think I would use github, when and if I release the source.

Quote from: timofonic;425988
In terms of available pinout, memory and such...

How's the Teensy2 or Tenensy2++ used? I mean if you and others can add features to your project in the future, the possibilities of free resources from it.

It's using about 33% of the ROM and most of the RAM (or will be) on a Teensy.

Quote from: alaricljs;425994
All in all it looks like it could be done.  Whether or not those features can coexist at the same time without resetting the teensy is not one I'm familiar with.  Having the teensy present itself as both a HID device for the KB and as a mass storage device for the SD card at the same time is not something I've dealt with.
I've no idea... I already have uses for 4 of the endpoints available, plus the control endpoint, so there might be one left! One thing I've spent a fair bit of time on is stopping the USB code from getting in the way of receiving input from the keyboard - looking after more peripherals would surely exacerbate that problem :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 04 October 2011, 16:23:46
Quote from: harrymoss;426052
So what do I do now?


[strike]Have you tried swapping the yellow and red wires?[/strike] Hang on, not sure that's right at all.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 04 October 2011, 16:47:58
Thanks for the reply. I think/hope I did something kind of like what you described. My situation looks to be the same as Sleuth in #85.

The original cable has a berg-like connector at the keyboard and a DIN-like plug at the computer. I cut it off with the intention of re-using the original connector and a few inches of wires to the Teensy, and discarding the bulk of original long coiled cord and plug.

I hope I didn't screw up.

How can I tell what is connected to what in the original?

Looking at the connector on the controller, what I am calling a berg-like connector from the cable has 6 connections - 2 rows and 3 columns connected at the outer end of the bank of pins on the controller. Obviously, I do not know the proper names of these technical components!

From outside-in, the top row has 1. black, 2. (no pin or wire), 3. (pin but no wire)

The bottom row has 1. red, 2. white, 3. yellow.

I have connected them to the Teensy (in the above order) at VCC, PD1, GND, and PD0 based on what Sleuth #85 showed which seemed to be exactly what I have.

And I have not connected the shield to anything, and not made any jumper connections.

Please excuse my ignorance, I am not a programmer or an electrician, I just love the feel of capacitive keyswitches and want this keyboard to work.

You guys are great to put up with silly people like me.

If I am able to give back in some way, I will try to do it.

[ATTACH=CONFIG]27904[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 04 October 2011, 16:51:30
Found a label inside my 122F so decided to just photograph it :-)

[ATTACH=CONFIG]27906[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 04 October 2011, 16:54:12
Thank you so much. I think that is exactly how I connected mine.

Is there anything else, such as connecting the shield to the chassis of the backplate, or jumpering anything?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 04 October 2011, 16:59:43
Is it? Yellow/Clock should go to PD1, and Red/Data should go to PD0.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 04 October 2011, 17:25:43
RIGHT YOU ARE !

Stupid me with that whole upside-down-and-backwards thing! (And my reading glasses barely do it anyway.)

Now it is registering, so I have a whole new realm to go through.

Thank you so much! You truly are da man.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 04 October 2011, 18:38:23
Excellent! Glad to hear it's working :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 04 October 2011, 19:07:36
Sorry for the double post, but,

Soarer - WOW! Man, thank you!

for doing the majority of my re-mapping for me!

I was assuming that I would have to go key-by-key, but you have re-created much of what I wanted without me even asking! Incredible! Thank You!

My goal is to make this as much like the "classic" Model M as possible, with as many of the "deviations" as close to the classic Model F as possible. To that end:

Naturally, I still want to change stuff. I want to make the left bank of keys F1-F10, redundant, of course, and make the number pad exactly like a Model M except trading NumLock (pointless now, with dedicated keys for all the non-numlock stuff) for "Escape" a la the IBM AT layout, and getting  the "+", "/", "-", and "*" right.

That pretty much leaves the top row for me to play with, with "Escape" at the top left (my single biggest frustration, along with arrow keys, since I do not want to saw out or fill the case .... ). I know that drilling small holes for LEDs is easy, but, I don't really care.

But - Wow, Man, Wow.

Thank you so very much. Really.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Tue, 04 October 2011, 21:26:44
Yeah, I briefly considered wiring up the lock LEDs. Then I realized, wait a sec, I don't care about those in the slightest.

The way I have mine mapped is HHKB like on the main block, the navigation block is standard, and the numpad goes ESC (redundant) =, *, /, +, -, Enter (clockwise from top left). The left block has all of the lock keys (top 4 are num_lock, scroll_lock, caps_lock, and print_screen), pause, and then the other 5 keys are mapped to macros. I put "Cmd" keys on those, 1-5. I'm thinking about changing it though, so that the left column are the lock keys, and the right column are the command keys, but I haven't settled on that yet.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 05 October 2011, 13:23:34
Now this beauty is together and working great. I could not be more pleased - it is fantastic - although the wife and kids are not going to like the additional racket!

The problems I encountered earlier were all due to careless wiring, etc. I have not made "permanent" connections yet, but I know that it works.

Not being a programmer, at all, I would love to know an easy way to remap some of these keys. Since this is such an odd and ancient setup, I am a little afraid to mess with anything, for fear of breaking it!

Do I dare run a program that I find and download, or will that mess up Soarer's lovely work?

I went back through this thread, thinking that I had seen mention of a program to do it, but couldn't see it.

Thanks again, everybody!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Wed, 05 October 2011, 16:21:19
If you're running windows, AHK is a decent option, as is KeyTweak. The former is an active, user level remapping solution, and so doesn't work at login. The latter is a system level option, as it stores it in the registry.

If you're running linux, I can help you out with an xmodmap file that you can use, though it might not map directly on your system. It didn't even map directly between RHEL 5 and RHEL 6, for whatever reason.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 05 October 2011, 16:31:51
I usually work in Windows, but I dual-boot to Ubuntu fairly often. I would use it a lot more if certain things didn't pull me back to Windows, but I am no programmer.

I barely scratch the surface, and don't really know what I am doing without step-by-step instructions, although I am - sometimes - pretty good at figuring things out in my own way.

Since I don't really understand the minutiae of where and how the signal gets intercepted and re-routed, I am fearful of screwing it up. If I use either of the programs that you mentioned above, could it interfere or disrupt what Soarer wrote? His work is beautiful and I want most of it to stay intact.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 05 October 2011, 16:40:21
Quote from: harrymoss;426427
I went back through this thread, thinking that I had seen mention of a program to do it, but couldn't see it.

There was a hack somewhere, which should work, but some remappings done that way might not work because of the way I do remapping after the translation from native scan code set to USB HID codes.

If you set your keyboard ID to AFBF, that might be closer to what you want, leaving just a small number of keys for AutoHotkey (or whatever) to take care of.

To set that ID: if you have DIP switches, just set them all to 'open' (or 'off') except for number 2. Or if you have a jumper block, only fit one, to the second position in (not sure from which end!).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Wed, 05 October 2011, 17:30:41
I use KeyTweak and xmodmap both, without issues whatsoever. I prefer these over the AHK setup, simply due to using synergy. AHK and synergy are completely ignorant of one another, so it just fundamentally doesn't work how I need it to.

But xmodmap and keytweak both operate on the computer itself, interpreting and modifying the signal AFTER it arrives from the adapter. So no worries at all.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 05 October 2011, 18:59:14
You guys are simply the greatest!

But I am a pest. Hopefully, when you answer my questions, some other poor neophyte will find the answers and not bother you again. Or not, but how to know? I actually comb through threads before posting questions, at least a bit, out of respect for your time.

theferenc, I used KeyTweak and it works great. I was able to do just what I wanted, with 2 exceptions. 1 of them, the upper right button on the Number Pad, is permanently set to "Pause" as I understand it, so I can accept that (although I wanted to get as close to "standard" 101 Model M as possible and make it a "minus").

But when I tried to remap the second from the left key at the top of the Number Pad, NumLock I suppose it was originally, to be "/" (slash/divide Model M style) and it stubbornly stays set on "-" for whatever reason.

My reason for needing this is that while I use the number pad fairly often, and rely on it for numbers, I seldom actually use things like minus there. But what I do use it for, very often, is entering dates, usually in the 08/25/2011 format. I would prefer to not have to move off the number pad to get the "/'" symbol.

Is there some reason that the minus symbol is locked to that key, or am I doing something wrong?

Thanking you in advance, Padawan Harry
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Wed, 05 October 2011, 19:31:24
That's weird, I was able to remap them just fine. Did you use "teach mode" in keytweak, or select from the list?

As I mentioned above, I have the numpad mapped as ESC (redundant) =, *, /, +, -, Enter (clockwise from top left), as that's how my 1397000 maps them (ish), and I found that I really liked it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 05 October 2011, 20:03:43
No luck with that.

I went through the routines in both "Half Teach Mode" and "Full Teach Mode" and neither took. It is just those 2 keys, all the rest worked properly.

I am looking for [ Esc, /, *, -, +, Enter ] - just like the Model M except for Escape replacing NumLock.

My situation is that I use 2 desktops and a laptop myself, and help/manage/maintain half a dozen others for co-workers and family. So it is disorienting, to say the least, to put my hands on multiple keyboard layouts every day. The closer I can stay to the "standard" layout, the easier it is on my poor brain and fingers.

Obviously, this behemoth keyboard is hooked up to "MY" computer, a massive full tower with more drives than I can count on one hand and all its slots full, so I want it to be "just right" but also I want to stay as consistent as I can with the "real world" I interact with.

This is truly minor. I am so deliriously happy with this exquisite keyboard that I will accept these trivial complaints.

But if you do have something else for me to try, I will do it.

Thanks again.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 05 October 2011, 21:02:30
I reckon KeyTweak has got confused trying to remap Pause... try reverting both NumLock and Pause, and then setting NumLock to '/'.

If that doesn't work, Clear All might do it. If even that doesn't work, it's time for a rummage in the registry!

For remapping the top-right key (Pause), you'd need to set the keyboard ID to AFBF to get the alternate layout (http://geekhack.org/showwiki.php?title=Island:17458&p=424335&viewfull=1#post424335).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 07 October 2011, 08:44:10
Boy-oh-boy! a missed day of geekhack down had me worried!

Thanks for all your help, guys, I am getting much closer.

Soarer, I used a jumper to set my board to AFBF (I think) by a little trial and error. Below is a photo of the connector, and a drawing of the markings that I had to use a magnifying glass to see.


[ATTACH=CONFIG]27976[/ATTACH]


[ATTACH=CONFIG]27977[/ATTACH]


The first 3 pairs of pins, from the left, are where the cable connects. You suggested jumpering the second position, and these are numbered starting with "2" so I jumpered "3" in the KBID "A" bank. This appeared to work properly and gave me the configuration you described in your previous post. I am pleased to get /, *, -, + around the numpad just like I want.

But, like before, some of the other changes would not "take" and I have tried multiple times.

Most important, I want the top left numpad (NumLock in your scenario) to be another "Escape" but it stubbornly becomes F2, and stays that way.

On the left bank, which I want to be an additional bank of F1-F10, F2 insists on being "Pause" and F3 insists on being F2.

I am using KeyTweak per theferenc suggestion, and it worked perfectly for everything else.

Now it must be time to delve into the registry, which I have done in the past, but only timidly, and based on step-by-step instructions. I have a set of scan codes and would be willing to do this.

Is there a set of clear and simple-minded instructions for doing this that I can find somewhere to guide me?

Otherwise this project has been great and I am delighted with the results. These minor problems are ones that I can easily live with, if I have to.

PS - now I read that people have done bolt-mods to these big F-122 boards to solidify them. Where is there room for the bolts? As I remember, once you insert the barrels, they are pretty much shoulder-to-shoulder throughout the main area, certainly everywhere the letters are.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 07 October 2011, 09:42:25
Sorry, but you won't be able to remap some of the keys in that left hand F-key block, with the AFBF layout. (In fact, I'm not even sure if KeyTweak can remap the Windows key, which is on left F9 or something in all the layouts).

As a side note, the AFBF is primarily intended for the 104-key terminal 'unsaver' keyboards. The rejigging of the numpad was an afterthought. That's left it with two keys for num-lock - remapping one will also remap the other.

For a full clear out of anything Keytweak might've done to the registry, run regedit and navigate to 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout', then delete the 'Scancode Map' key. Also, check that 'HKEY_CURRENT_USER\Keyboard Layout' doesn't have a 'Scancode Map' key.

Then you can reboot and go back into KeyTweak to try again - but don't try remapping the pause key!!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 08 October 2011, 21:40:19
Hi, it's me, harrymoss, I just felt like I needed to change my ID to something less mundane than my actual name.

Still a pesky question-asker, of course.

So this thing is working well, but these 3 keys continue to bother me. Of all the keys to be out of whack, "Escape" and "F2" (edit cell, etc) are two of my favorite "go to" keys that I use pretty often.

I guess I am trying/hoping to misunderstand Soarer telling me that I cannot fix the fact that the top left of the numpad, once NumLock, now F2, cannot be my second Escape.

And that the top right of the left function keys is permanently stuck as "Pause" instead of F2.

I really like having those important keys in the main body of keys without having to reach up for them.

Maybe I will get another shot, I got a couple of ugly trashed Model F-122s from rawko (5 minutes from my office) that I think may build into a good chassis or maybe even two, without the top half of the case. More trial and error, I will move my Teensy around and see if I can get closer to the layout that I want.

ps - none of them have the DIP switches, are those rare?

thanks again, Harry
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 09 October 2011, 04:23:24
As it stands, I'm afraid you'll have to accept that you can't get all of the layout that you want. Pause being the main key that gets in the way. You can either:
1) start with the default layout, and accept that Pause will be Pause on the numpad, or
2) start with the AFBF layout, and accept that you can't have F1-F10 on the left.

I'm positive that attempting to remap Pause is what's causing the problem with remapping NumLock.

I've just started work on the user remapping stuff, but it will take at least a few weeks before even a basic version is available.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Thu, 13 October 2011, 09:35:23
That's really weird, honestly. I remapped nearly everything in Linux with no issues whatsoever. But then, it's a different mapping system entirely, so that might be the difference.

Have you tried AHK to do it?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 14 October 2011, 16:22:50
So, my amateurish trial and error fumblings continue. I post this stuff, not in a narcissistic way, but to contribute to the greater knowledge, since I have found many answers I needed in ground previously plowed by others. If I should stop, tell me.

I have disassembled 2 Model F 122-key terminals today, 1 from 1984 and 1 from 1985. Below are pictures of the circuit board/metal backplate assemblies, which I do not wish to take apart. They are surprisingly different. The 1984 (August) model is the one that looks all green, as if there is a much thicker layer of fiberglass over the printed contacts. It was in much better condition, and the metal back plate is quite shiny.

The 1985 (January), which is much like the 1985 (June) that I re-habbed and have been discussing for the past month, has the coppery-looking contacts.

My question is which of these boards should I use for my next project? I like the idea of the stronger coating over the circuit, since I have seen a Model F board (an XT 83-key) in which the copper looked like it was more than half eroded (or otherwise erased) away.

The 1984 looks very clean and nice otherwise, and unless there is a compelling reason for the actuation to be harder, such as the electrons have to work harder to get through the extra thickness of fiberglass, then I will use this one.


[ATTACH=CONFIG]28633[/ATTACH]


[ATTACH=CONFIG]28634[/ATTACH]


I am an Industrial Designer, not an Electrical Engineer, so my intuition is not so deep in this realm. All else being equal, I will chose physical strength, but not at the expense of free flow of energy. Many of you must understand the subtleties and/or minutiae of this process better than I, but you know, miniscule differences matter to me.

Lastly, the rubber mats were in "bad" condition. I was spoiled because the June 1985 in my previous project had a very nice mat, not only was the rubbery surface quite nice, but the foam side was also mostly intact, shedding some 10%-20% but hanging together pretty well.

The mat of the 1985 was terrible, the foam was completely gone, transformed into a very ugly and hard-to-clean rubbery grit, and the thin remainder tore in more than a couple of places. It might possibly be almost "useable" but probably not.

The 1984 was considerably better, although still pathetic, in that the foam was pretty well gone, but the rubbery side was intact and workable. I can probably make it function properly, with some careful jiggling. I am careful and pretty good at making marginal situations viable.

Am I correct in assuming that it would be insanely optimistic of me to imagine that there is any way of getting replacement rubber mats, besides buying Model F 122-key keyboards and taking them apart to see what is inside? Please don't think I am smoking crack or living in La-La Land to even ask.

Probably Monday, I will re-assemble this thing and see what I can make happen. This has been a very difficult week for me (death in the family), and it would be nice if something worked out nicely.

So what was my question(s)? Is the green board better than the copper one, and how do I utilize/improve the rubber mats?

thanks a lot, folks
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LETE on Sat, 15 October 2011, 16:55:26
You don't need to worry about the thicker coating affecting performance. When the keyboard was designed they would have balanced the gain to account for the distance between the conductors, and capacitive sensors aren't especially sensitive to obstructions anyway. My iphone still works with 9 layers of painter's tape on it.

I'd like to figure out a solution to the decomposed mats as well. I'm sure you can't buy them ready made or anything, but there should be a way to make your own. It's worth looking into.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 15 October 2011, 21:42:20
It might not be all that hard to make one, provided that you had a hole punch of just the right size.

A fresh firm mat might even improve the feel, my daughter has foam art supplies that are probably a very good thickness for this, slightly deeper and firmer than the original.

Exactly what I need, another tedious time-consuming project!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LETE on Sat, 15 October 2011, 22:11:28
Let's both give it a shot and compare notes. Of course, if we get a proof of concept laid out, it wouldn't be too hard to make a CAD file of the design and send it in to get laser cut for a group buy.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 17 October 2011, 08:54:12
May be getting far enough off-topic to warrant a new thread.

Since I am really fond of the Model F terminal, in spite of my mapping problems, and since I have an extra used board to experiment on, I am considering a bolt mod to tighten this thing up.

This will require drilling the circuit board and the metal, and I don't figure to use too many bolts. In fact, I can't put any where I really want them, scattered among the letter keys, since the barrels are in the way.

Please look at the diagram below, and let me know if this might be a good layout, and/or if the benefit is work wasting a couple of hours on, at all.

Thanks, Harry

[ATTACH=CONFIG]28821[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LETE on Mon, 17 October 2011, 14:25:01
Yeah, I made us a thread of our own (http://geekhack.org/showwiki.php?title=Island:23007&do=comments&page=1).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 19 October 2011, 15:49:20
Soarer -

I have put together a 2nd keyboard, and left all the jumpers open to default. It works great and I have all but 2 keys set the way I want them.

For whatever reasons, NumLock refuses to be re-mapped to "/" Slash as I would like, and I did not even try to change "Pause" to "-" minus even though I would like that.

That is a lesser price to pay than losing the Escape on the top left of the Numpad and keeping the left function keys proper.

I want to bolt-mod and floss this Model F and see what that is like. I am excited about the next phase of the project, even though I have pretty well given up on getting those last 2 keys like they are on the Model M.

I really appreciate your generous work and help on this. Thanks again.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 20 October 2011, 15:09:02
I wish I knew why that numlock won't remap! Does it just stay as numlock then?

True, it's not wise to hold your breath waiting for me to implement the remapping stuff, but it will happen :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 20 October 2011, 17:08:55
Yes, it just stays NumLock regardless of what I tell it to be. I was using KeyTweak and everything else obeyed my commands just fine.

If you are taking requests, I would like to make it as close to a Model M as possible, for the alphabet and numpad, with the exception that I will not need NumLock at all anymore, so I would want the top left of numpad to be Escape, a la the Model F AT.

Also like the Model F AT, I would like the left side to be a second F1-F10 pad.

At the top, I am happy with the bottom row being F1-F12 as usual.

The uppermost row, I would probably use for music controls and program and internet hot buttons.

But I would want the uppermost left button to be another Escape, a la Model M.

This would allow me to hop around between my Model Ms, Model F AT, and other "standard" keyboards with as little disorientation as possible.

Thanks again.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 22 October 2011, 09:44:04
No requests, sorry! The two alternative mappings came about for specific reasons - the first one was for someone who was helping out a lot during early testing, and the second is so that escape is available on the 104-key terminal 'unsaver' keyboards (and thus helps a whole group of people).

A little progress on the remapping utilies - I've compiled the sample rawhid code (http://www.pjrc.com/teensy/rawhid.html) into a DLL, and added the rawhid interface and endpoints to the converter, with a simple test that echos back whatever it receives. That works, but it remains to be seen if it interferes with normal keypresses in any way while stuff is being sent over the rawhid channel. So, now to decide what language to use for the next bit (that calls the DLL), and how it will transfer to other OS.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Sun, 23 October 2011, 09:49:40
I would recommend something like C++/Qt combination, or possibly python using wx or similar. Those 2 combinations are the best I've seen at providing actual cross platform support, and the former is used quite extensively, actually, including products like Picasa, google earth, VLC, photoshop elements, and Skype.

You can do most of the processing in straight C even, if you prefer, and just use C++ for the GUI aspect. Qt really excels at the MVC model of programming, and provides some really slick scripting support for generating dynamic GUIs.

Now, if you're going CLI rather than GUI, just write it in C or C++, and let people compile it themselves, I suppose.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 23 October 2011, 20:23:55
C++/Qt would suit me - I'd only need to learn the Qt bit!

I think I'll just go with CLI for the first version, so I can concentrate on getting the protocol and formats right. All it needs to do is talk to the DLL I've made, and deal with files. Might as well be C or C++ since that will be easiest (for me).

Beyond that, it could certainly use some nice UI. I guess there's two main criteria for that - only requiring that users install a minimal amount of other stuff, and that the toolkit has a stable interface. The latter so that these tools aren't too fussy about which version of the toolkit they are built with.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: HaaTa on Mon, 24 October 2011, 16:07:05
Heh, I know Qt :D
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RPro on Sat, 29 October 2011, 17:35:59
Hi - dumb question,but I couldn't find it with search:

Does this Teensy PS2 adapter work with the Dell AT101W (alps) keyboard? Thanks!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 29 October 2011, 18:08:32
It should - it certainly works with my Dell AT102W and SGI Granite :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RPro on Sat, 29 October 2011, 18:21:32
Quote from: Soarer;441968
It should - it certainly works with my Dell AT102W and SGI Granite :)


That's great! Gonna order a teensy board soon then. :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 30 October 2011, 18:28:44
A couple of things:

First, do you want the Teensy for the Dell AT-101 for gaming? Because my son and I both use the AT-101 and it plugs in almost anywhere and works great (although, I must admit, that since I have been obsessed with buckling springs and my current Model F 122-key terminal conversion projects for a few months ..... ) I am not a gamer so maybe the Teensy does some kind of rollover thing that I don't understand ??

Second, I have finally completed my second Model F 122-key conversion, and it is "BAD-ASS" to say the least! I tore it down and bolt-modded it using about half a dozen bolts in the Imperial/American 4-40x1/2" or 4-40x3/4" sizes (don't know comparable metrics), painted the metal back plate several coats including rubber paint on the rubber side, flossed the springs, and stuffed the case with old pillow stuffing.

This is a clean mean machine. It clicks without undue resonance, and will probably last for years being stabbed at with full force. Now I just need to find a good paint/stain system, and repair procedure, for the case and I will be all set.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Sun, 30 October 2011, 23:31:54
And that really does sum up a lot of why so many of us love these things...the Fs, especially a terminal Model F (122 or 104, there are others though) are just so machine-like.

(even terminal Ms are beast-like compared to all sorts of things, but an F really goes above and beyond)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 31 October 2011, 17:34:32
You have to take the Model F apart to really appreciate its construction. It seems monumental even by 1980s standards, not 1 but 2 large hunks of metal in the thing.

As the Model M is alleged to have the rivet weakness that can be fixed by bolt-modding, I have found 2 weaknesses with my Model Fs. The big one, and I did not realize this immediately, is the deterioration of the rubber mat that sits between the barrels and the metal inner plate. My first one had a wonderful mat with nice pliable black rubber and even the foam layer on the plate side was in good condition.

Since then, I have realized that a good mat is hard to come by and can be a "deal-killer"

One day I will try to make my own replacement mat, but I need to get a 1/2" hole punch.

The other problem is that the cases seem very prone to crack or break, particularly at the front (spacebar) edge. I have 3 F-122 cases that are broken diagonally from the lower corner of the key openings to the corner of the case. Even JB Weld epoxy has only proven up to the task once, and it is dark gray.

Can these cases be dyed, or must they be dye/painted?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Fri, 04 November 2011, 16:26:52
I know the M cases can be dyed, but it's a challenge due to the size. Some folks have suggested an automotive vynal based dye/spray paint stuff, if I remember correctly. Krylon also makes a substance that works, from results that have been posted here, as well.

I'm actually going to be looking into this in the next few weeks, since I would prefer a cleaner looking keyboard, and the case on my F is pretty stained and dirty. I'll let you know what I come up with.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 05 November 2011, 16:11:53
I decided that the advice was mostly against dyeing the Model F case, so I went to the automotive store and bought Dupli-Color Dye/Paint and used a half-dozen very light coats.

Came out pretty nice, if I do say so myself, and covered up the "JB Weld" repair job I had to do at the lower left (these cases are not the battleship quality that everything else is). Besides seeming brittle, the surface texture layer comes off leaving a very glossy under substrate.


[ATTACH=CONFIG]30964[/ATTACH]

[ATTACH=CONFIG]30965[/ATTACH]

[ATTACH=CONFIG]30966[/ATTACH]


And yes, I did paint the metal back plate red !

Dyeing the keys will be a future project.

And, whenever I can find a gray cord, it will go on, too.

Thanks, everyone !
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RPro on Sat, 05 November 2011, 20:05:03
Quote from: fohat.digs;442398
A couple of things:

First, do you want the Teensy for the Dell AT-101 for gaming? Because my son and I both use the AT-101 and it plugs in almost anywhere and works great (although, I must admit, that since I have been obsessed with buckling springs and my current Model F 122-key terminal conversion projects for a few months ..... ) I am not a gamer so maybe the Teensy does some kind of rollover thing that I don't understand ??


Actually, my new Sandy Bridge Asus P8Z68V-Pro motherboard does not have any PS/2 ports. The PS2->USB converter I have does NOT work with the AT101W --- is one of the models I got from monoprice - according to the wiki here on geekhack it should work on most but definitely NOT the Dell - it frequently resets but even worse - I can't use Control-C properly! So hey, I might as well get a Teensy for a little more than the price of a belkin converter. And it'd be a fun little project to try anyways.

I would like to use the Dell for gaming. But it is impossible to crouch and move in Left4Dead with my current converter haha!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 05 November 2011, 21:20:29
Quote from: fohat.digs;446313
And yes, I did paint the metal back plate red !

Looks great, I like it!

Quote from: RPro;446412
Actually, my new Sandy Bridge Asus P8Z68V-Pro motherboard does not have any PS/2 ports. The PS2->USB converter I have does NOT work with the AT101W --- is one of the models I got from monoprice - according to the wiki here on geekhack it should work on most but definitely NOT the Dell - it frequently resets but even worse - I can't use Control-C properly! So hey, I might as well get a Teensy for a little more than the price of a belkin converter. And it'd be a fun little project to try anyways.

I would like to use the Dell for gaming. But it is impossible to crouch and move in Left4Dead with my current converter haha!

This code can't add NKRO to a non-NKRO keyboard of course, but it should work as well as if it were plugged into a PS/2 port :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Tue, 08 November 2011, 16:08:33
Quote from: fohat.digs;446313
I decided that the advice was mostly against dyeing the Model F case, so I went to the automotive store and bought Dupli-Color Dye/Paint and used a half-dozen very light coats.

Came out pretty nice, if I do say so myself, and covered up the "JB Weld" repair job I had to do at the lower left (these cases are not the battleship quality that everything else is). Besides seeming brittle, the surface texture layer comes off leaving a very glossy under substrate.


(Attachment) 30964[/ATTACH]

(Attachment) 30965[/ATTACH]

(Attachment) 30966[/ATTACH]


And yes, I did paint the metal back plate red !

Dyeing the keys will be a future project.

And, whenever I can find a gray cord, it will go on, too.

Thanks, everyone !

That's GORGEOUS!

Very well done.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RPro on Thu, 10 November 2011, 19:10:46
I got the teensy converter programmed and the connector soldered (stole it from an old broken motherboard). Works great with the Dell AT101W! Looks like the Dell only has like 3KRO (or more depending). But way better than the POS monoprice Ez-PU21 converter - ugh, it can't even do Control-C correctly! Which is odd because I think the converter wiki said it should've been ok.

Whatever - if I upgrade to those NKRO gaming keyboards with the PS/2 connector it will be even more awesome! Thanks Soarer!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RPro on Fri, 11 November 2011, 15:01:07
Whoops - guess the Dell AT101W is a 2KRO. Oh well.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 11 November 2011, 15:48:33
Ah cool, you got it working ok!

You never know exactly what you're going to get with a cheap converter; they'll change the chips they use if it makes it cheaper!

And yup, it's 2KRO or NKRO, there isn't really anything in between unless it's NKRO that's limited in some way :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RC-1140 on Fri, 11 November 2011, 16:07:46
Hey,
Currently I'm using this adapter for a 1990's 122-Key Terminal Model M, and in general it works great. But when I tried to remap the keys in the same way as my Unicomp Terminal Emulator, I encountered a problem. I wanted to assign different keycodes to the scancodes using the ”setkeycodes“ utility, and used the evtest utility to read the scancodes. This is what it showed to me:

Event: time 1321047872.908643, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70088
Event: time 1321047872.908648, type 1 (EV_KEY), code 93 (KEY_KATAKANAHIRAGANA), value 0

So it says the scancode of LF1 would be ”70088“. Interestingly enough all Scancodes look this way, like an ordinary hexadecimal scancode, prefixed by ”700“. LF2 shows up as ”7008a“ e.g.. When trying to remap it to Escape using ”setkeycodes 7008a 1“ I get: ”failed to set scancode 6210a to keycode 1“. But if I try to remap only the suffix, without the 700 it doesn't give any error message, it just won't change anything.

I'm really confused by this behaviour. Until now evtest has never failed on me...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 11 November 2011, 17:00:16
Hmm, I dunno!

Although...

7 is the HID usage page for keyboard keys, and 88 is the HID code for 'International 2' (katakana/hiragana), which is assigned to LF1.

So what's 93? (or 5D?)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RC-1140 on Fri, 11 November 2011, 17:17:30
well, 93 is the X keycode for the Hiragana_Katakana Symbol. I don't know why, but one always has to add 8 to the keycode the kernel sends to get the keycode X sees. I really don't know, what causes this behavior.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 11 November 2011, 18:12:03
Oh, ok. I don't really know anything about remapping USB keyboards in X, but something's surely wrong since it refers to 6210a when you try to set 7008a!!

Where are the beardy types when you need them?!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RC-1140 on Fri, 11 November 2011, 19:50:09
d'oh!

when in doubt, read manpages…


Quote
USB keyboards have standardized keycodes and setkeycodes doesn't affect them at all.


m(

Well. Looks like I have to do it by editing all my xmodmap files…

At least it wasn't your fault.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RPro on Sat, 12 November 2011, 00:07:56
Hmm, I seem to be having an issue - it seems when I let the PC idle for a while (it does not go into sleep, only the display goes into power savings), the LED lights up for a couple of seconds on the Teensy board whenever I type. Also, spaces seem to be inserted (like if I had notepad open) out of the blue. Another time, it seems that the down arrow key is permanently pushed down.

I have to unplug the converted from the USB port and plug it back in to get it to work normally again, without the LED lighting up. Any ideas?

I will try plugging it into the backport of the motherboard instead of using the PC case front panel USB ports (Antec 1200 case).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 12 November 2011, 08:49:05
That sounds odd, I'm gonna hope it works ok on a rear port!

Power saving can be an issue because the converter can't reduce its power consumption, and it depends a lot on the hardware/bios/drivers whether that causes any issues. For example, on this machine I had to set the standby mode to S1 instead of S3, but on another machine S3 works fine. That said, the converter is clearly getting into a weird state, which shouldn't be happening.

Which OS are you using? Does it do the same thing if you put the computer to sleep?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RPro on Sat, 12 November 2011, 16:58:59
I have an Asus P8Z68-V Pro motherboard. Windows 7 64 bit. It is set to S3. It BSODed last night after putting it to sleep, but I don't know if that was a coincidence (needed a couple of BIOS updates to stop more frequent crashing). This time, I'll plug the converter into a powered USB hub. Before, I was using a 3 meter PS2 extension cable with the converted plugged into the back of the motherboard. Yes, the converter has 1 K pullup resistors on the data and clock to VCC.

*fingers crossed*
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 12 November 2011, 19:18:57
I doubt the converter caused a BSOD! Wish I knew what to suggest for that, getting a PC to sleep without problems can be a real pain :-(

For the original problem, disabling USB selective suspend might help:

(http://kishy.dyndns.org/misc/usb_selective_suspend.jpg)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RPro on Sun, 13 November 2011, 00:52:47
Yeah I don't think it was the converter. If I have more issues with the keyboard itself acting funny I'll try out your setting - thanks for that! USB and power management has always been voodoo for every motherboard I've tried! I remember the "good old days" when the manual would actually say, "Use only THIS USB port if you want the USB device to turn on the PC or wake the PC."

Maybe the PS/2 extension cable I used is not properly shielded or has a bad connection that caused the previous problems, which is why I switched to using a USB hub and use a longer run USB cable that has been working fine for a year with 3 other devices on it. :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: dorkvader on Wed, 07 December 2011, 10:50:52
Hmm, Can I use something like this to decode a normal ascii keyboard?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 07 December 2011, 15:26:59
Dunno... I'm not sure what you mean...?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 07 December 2011, 17:08:34
General Status Update...


What are the Settings then?!


Remaps
Are not whole translation tables! As a silly example, if you wanted to swap the '1' key with the '2' key, you might write:
1=2
2=1
(with some additional bumph around that to define a block).

Macros
Can trigger for any single key with any of the standard modifiers.
Separate macros can be defined on make and break (although, on make only is the most useful and reliable).
Macros are sequences of comands which can currently be: key events, modifier manipulation, and delays.

Layers
Up to 8 keys can be defined to act as a 'Fn' key to access further layers.
Any key can be used in this way - the keys are defined using the remap mechanism, so remapping a key to, say, 'FN1' defines it.
A layer is defined as any combination of those keys - so theoretically up to 256 layers! However, since each layer takes up a fair bit of memory, roughly 3 is the max on a Teensy 2.0, and maybe 25 on a Teensy++.
Each remap block is tagged with the layer it applies to (if not the base layer).

Selects
Up to 7 keys can be defined to toggle configurations of settings.
As with layers, these can be defined as remaps (to SELECT1 etc). But they can also be put in a macro, so that you can define a combination of keys to select a configuration.
All of the blocks for remaps, macros and layers can be tagged with a Select ID (1 to 7). But it is not required. In fact, base settings would usually not be marked as a Select.
Triggering a Select toggles that group of settings, but leaves the others alone.

So, basically... enough Settings to shoot yourselves in the foot with! :-)

Back to the todo - does anyone have experience with Boost::Spirit?
It looks interesting for the compiler part...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: hasu on Wed, 07 December 2011, 18:50:35
mmm, nice features!
and can't wait for trying new your firmware!

If the syntax is simple enough, hand written LL parser must be fun too :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Wed, 07 December 2011, 19:02:06
I want.  I am not patient... but I haven't succeeded in getting anywhere with my own firmware.  Being a dad, and a land lord  and having a full time job just doesn't give me the time to learn electronic design and how to program an MC.  *sigh*  So you will still beat me to it ;)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 07 December 2011, 19:36:07
Soarer -

Have you come up with a way to remap those 2 pesky numpad keys on the F-122?

"Num Lock" -to- "/"

and

"Pause" -to- "*" ?

If I could get those, I would be delighted !

Thanks ever so much, Harry
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 07 December 2011, 21:30:00
Quote from: hasu;466149
mmm, nice features!
and can't wait for trying new your firmware!

If the syntax is simple enough, hand written LL parser must be fun too :)


Thanks! I'm looking for the quickest way to get something usable - a better syntax, or even a GUI, would be nice, but can be written later. The first version will probably be some very dirty code!

Quote from: alaricljs;466159
I want.  I am not patient... but I haven't succeeded in getting anywhere with my own firmware.  Being a dad, and a land lord  and having a full time job just doesn't give me the time to learn electronic design and how to program an MC.  *sigh*  So you will still beat me to it ;)

I wish I had some more time available to spend on this as well :(

Quote from: fohat.digs;466187
Have you come up with a way to remap those 2 pesky numpad keys on the F-122?

Yes - all these settings are completely un-pesky!

At least, they will be once I don't have to manually hex-edit the settings file by hand...

If anyone really wants to have a play with doing it that way, I guess I could upload a new version and my notes on the binary format - I wouldn't be able to help much though!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LukStarkiller on Sat, 17 December 2011, 18:06:19
I have one question in mind, which is the slower response time (latency) that we can expect to happen between pressing a key and the signal output via USB on the Tensy board

It may be a negligible time, but I would be interested to know what could be the delay caused by the Tensy board and if it exceeds the millisecond (I doubt it, but for asking I don't lose anything ^^)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 17 December 2011, 19:46:02
Hmm, good question! I haven't tested it, but I think the worst case should be just under 2mS, with the average being 1mS.

Since the converter uses Full Speed USB, it has no problems reporting at 1000Hz. Even so, that could mean a delay of up to 1mS before a report is sent.

I also queue events inside the converter, and since that queue is also (asynchronously) processed at 1000Hz that means another up to 1mS delay.

Even the worst case is negligible compared to the delay (http://geekhack.org/showwiki.php?title=Keyboard+scan+rates&viewfull=1&page=8&do=comments#post409032) between pressing a key and the converter receiving it - which could be 10 times that!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: LukStarkiller on Sat, 17 December 2011, 21:26:33
:eek:
Surprising information
I never thought that the delay caused by the keyboard's controller boards were so ""extreme"", I guess that manufacturers give more importance to the proper functioning and estabilidady that latency.

It may seem silly but for a gamer these milliseconds can mean a lot in terms of playability.

I guess at this point the Aikon controller is better for this (don't know), but the Teensy is almost solderless and easy to understand.
I supose it's posible to do a direct controller with the Teensy board (or Teensy+ if you need more conections) that work with less latency. Well that's another crazy idea XD

If all of us are used to standard keyboards with this latency, then this doesn't needs to be changed, but I have to take a look at the Teensy documentation.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: dorkvader on Sun, 18 December 2011, 00:14:21
Quote from: dorkvader;465833
Hmm, Can I use something like this to decode a normal ascii keyboard?
I had to do some research, to know what I meant by that (I had to look up and double check everything). The keyboard in question is a WYSE 840013 (that came with a WYSE 30 terminal in 1993) It is one-way (no LED's) and has a 4-pin RJ10-like (4P4C) connector.
http://www.kbdbabel.org/conn/kbd_connector_wyse.png

I wasn't able to find any information either way, but I assume that it's not a normal XT interface keyboard, either. I did find a IBM guide on connecting an "ascii" keyboard to their old computers, but I'm still not really sure what that means.

Since it's just one-way, I assume it shouldn't be too hard to get it working: I mean, it should send a scancode for each individual key press, right?

So, what are my options? I'm sure I'll build one of these either way, as I can certainly use it for PS2 -> USB on at least two of my keyboards, but can I use it for this?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mikelittoris on Mon, 19 December 2011, 13:59:15
Okey, so i've got my terminal 122 key model f (6110347), my teensy with a female 5 pol din attached. I've programmed the teensy with the firmware. I've rebooted it and my keyboard is inserted in the female din connector. Nothing happends. Everytime I reboot the teensy it says "press button to activate" I do it and then nothing happends again. When I say nothing happends I mean that the keyboard doesn't work at all. Am I doing it all wrong somehow? The soldering looks ok. If I look straight in to the female din connector and counting clockwise i've got it connected like this: 1-D1, 2-GND, 3-D0, 4-VCC and 5 is not connected. Please help me im clueless about waht to do.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: DaemonRaccoon on Mon, 19 December 2011, 14:06:48
Quote from: Mikelittoris;473902
Okey, so i've got my terminal 122 key model f (6110347), my teensy with a female 5 pol din attached. I've programmed the teensy with the firmware. I've rebooted it and my keyboard is inserted in the female din connector. Nothing happends. Everytime I reboot the teensy it says "press button to activate" I do it and then nothing happends again. When I say nothing happends I mean that the keyboard doesn't work at all. Am I doing it all wrong somehow? The soldering looks ok. If I look straight in to the female din connector and counting clockwise i've got it connected like this: 1-D1, 2-GND, 3-D0, 4-VCC and 5 is not connected. Please help me im clueless about waht to do.

Assuming counting from the bottom left (facing the connector).
That's AT (and PS/2), you want the 3179 pinout: 1 - VCC, 2 - GND, 3 - NC, 4 - D0, 5 - D1.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mikelittoris on Mon, 19 December 2011, 14:13:00
Oh crapper! Thanks alot DeamonRaccoon yo're the best, I shall get back to the soldering iron right a way. BRB :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mikelittoris on Mon, 19 December 2011, 15:50:28
Well I've connected the cables as you said DaemonRaccoon. Still nothing is happening. I'm not even sure how I'm suppose to start of with this. Shall I have the keyboard connected to the adapter at all times or should i first program and reboot the Teensy and then connect the board? I've tried all of this a few times now and I'm starting to worry that i might have fried the teensy somehow, it says it should have a blinking led, I saw it the first time i started the teensy but not anymore. I can still reprogram the teensy and reboot, and then it says "press button to activate" again. I'm not even sure what the teensy is suposed to say when it's on and working.

Sorry for being a complete airhead.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: DaemonRaccoon on Mon, 19 December 2011, 16:15:12
Start with flashing the Teensy without the keyboard connected, make sure you have the right firmware file there is a difference. The blinking LED is the default program that is flashed to the Teensy.

The "Press Button to Activate" is to drop the Teensy into the boot loader for flashing.

Make sure you're following the official guide for flashing (http://www.pjrc.com/teensy/loader.html).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 19 December 2011, 16:26:46
Don't panic just yet - it's not easy to kill a Teensy with this mod! I think about the only way it might happen is if there's a short of +5V to one of the input pins - which won't happen by getting the wires to the socket mixed up.

Have you got hid_listen (http://www.pjrc.com/teensy/hid_listen.html) yet? That will give you some output that will help to figure out what's wrong. (The blinky LED is gone once you program my code into it, and the LED is used to indicate errors).

edit: The keyboard needs to be connected to the Teensy when the Teensy starts up (either when rebooting after programming, or when plugging the USB side of the Teensy in).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mikelittoris on Mon, 19 December 2011, 16:31:23
Ok thanks I will have to try that tomorrow, been up for 32h straight now and I thoguth I'd just open the case to se what it looks like IRL before I went to bed, you can't guess what i found, the keyboard cable is detached from the controller inside the keyboard :P haha. Therefenc you bastard ^^. So hopefully it will all work like a charm tomorrow when I connect it.

btw i'm using v0.996 for teensy 2, since I don't got the ++. Should be the right one if i'm not completly lost.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 19 December 2011, 16:35:35
LOL! Yeah, helps if everything is plugged in!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 19 December 2011, 17:22:10
Quote from: dorkvader;473077
I had to do some research, to know what I meant by that (I had to look up and double check everything). The keyboard in question is a WYSE 840013 (that came with a WYSE 30 terminal in 1993) It is one-way (no LED's) and has a 4-pin RJ10-like (4P4C) connector.
http://www.kbdbabel.org/conn/kbd_connector_wyse.png

I wasn't able to find any information either way, but I assume that it's not a normal XT interface keyboard, either. I did find a IBM guide on connecting an "ascii" keyboard to their old computers, but I'm still not really sure what that means.

Since it's just one-way, I assume it shouldn't be too hard to get it working: I mean, it should send a scancode for each individual key press, right?

I've no idea! There is another Wyse that kbdbabel has signalling info for, and it is quite different even though still only using 4 wires - the clock line needs to be driven by the host, and the keyboard only drives the data line in response to that clock. Keyboards like that are a pain to work out, if you only have the keyboard!

Quote from: dorkvader;473077
So, what are my options? I'm sure I'll build one of these either way, as I can certainly use it for PS2 -> USB on at least two of my keyboards, but can I use it for this?

Probably not, unless it happens to use XT or AT protocol. There comes a point where it's often simpler to replace the controller, rather than try to convert the external protocol - at least then you know you're simply dealing with switches! (although, capacitive boards present a extra challenge... not sure what switches this thing has).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Mikelittoris on Tue, 20 December 2011, 10:11:49
There we go, connected the cable to the controller and it works! I've done it, YEY! :D I really like the feel of it, it's like the model m but lighter, i'd imagine that the difference betwen the m and f is somewhat like the difference betwen black and red cherrys, i've never tryed reds so this is only me imagening stuff.

Now i've got to get it clean, it is terribly dirty atm. I'll post some pics later. :)

Thanks for helping me with the pinout/teensy problem DeamonRaccoon, and Soarer you're the MAN! :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: thebum on Fri, 30 December 2011, 21:52:21
Wow. Soarer thanks so much for putting your time into this.

Just got my teensy today. Spent about twenty minutes prepping some wires, soldering, and flashing the teensy.

And now here I am, happily typing away on my XT Model F.

Everything seems to be working amazingly well (much better then I even expected it possibly could).

Will continue to use your firmware and if I encounter any problems or think of anything I could do to help, I will be sure to let you know.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 03 January 2012, 20:43:02
You're welcome - thanks for posting :-)  The XT support was actually one of the easier bits, apart from the fiddly moving around of PrtSc etc. So the mappings should be 100% correct - let me know if you find any that aren't, I haven't tested an XT in a while!

And... Welcome to geekhack!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Tue, 03 January 2012, 21:10:40
Soarer, is your mapping without recompiling part ready yet?  I am wondering if I could use your code on the Phantom Teensy 2.0 controller.  Thanks.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 03 January 2012, 21:37:15
Afraid not - I haven't had time to do any more since the last status update (http://geekhack.org/showwiki.php?title=Island:17458&p=466081&viewfull=1#post466081) :-(

The other part you would need is for me to make a 'controller' version. That's planned (because I want it for my own 'board :-) ) but I really want to get the settings compiler done first!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Tue, 03 January 2012, 23:13:12
That's cool, Soarer.  We can wait.  Thanks.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: thebum on Wed, 04 January 2012, 18:00:20
Quote from: Soarer;482787
You're welcome - thanks for posting :-)  The XT support was actually one of the easier bits, apart from the fiddly moving around of PrtSc etc. So the mappings should be 100% correct - let me know if you find any that aren't, I haven't tested an XT in a while!

And... Welcome to geekhack!

Thanks for the welcome.  I've spent quite a bit of time on the board and have encountered zero mapping issues on it, so from my experience  I believe you are correct about the key maps being perfect.

I've also been testing an AT NTC kb-6251 with it, which seems to be working quite well.  With the exception of two keys, but it seems likely that is a problem with the keyboard itself, once determined if not I'll report it to you and see if it is anything which could benefit your code.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 26 February 2012, 14:41:20
New version (http://geekhack.org/showwiki.php?title=Island:17458&redirect=no#History) posted. For the brave!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: timofonic on Sun, 26 February 2012, 14:57:18
Quote from: Soarer;527014
New version (http://geekhack.org/showwiki.php?title=Island:17458&redirect=no#History) posted. For the brave!


Features list? Please? :)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 26 February 2012, 15:10:35
Quote from: timofonic;527041
Features list? Please? :)
Not brave enough - you're barred! :-p

There is some (scant) documentation in the tools archive.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 26 February 2012, 19:38:18
Ok, so what's new is all the stuff outlined in this post (http://geekhack.org/showwiki.php?title=Island:17458&p=466081&viewfull=1#post466081), and media key support.

You can now define a bunch of settings in a text file, compile it, and upload it to the converter. There's a few example config files in the tools zip.

The tools are Windows only, but should be very easy to build for Linux and Mac.

You probably want to get all three zip files anyway - there's a list of HID codes in the src archive which might come in handy.

The HID codes are mostly the same as the standard, but I've used up a lot of the unused codes to add the  functionality I needed while still keeping the code to a single byte. These are the FAKE, FN, SELECT, and MEDIA codes.

The converter now outputs the HID codes that come from the first (fixed) stage of translation to the debug output (hid_listen), preceded by + or -. This should help a bit if you're not sure which code you need to remap for a key.

I've removed previously hard-coded settings. They are now in the legacy.sc config file. If you want the v0.997 converter to act exactly like v0.996:


There's two versions of the hex file for each Teensy. The _temp versions will reset all settings each time they boot up. Hopefully they won't be needed, but if I've screwed up, or writing the config to the Teensy is interrupted, they can be used to clean things up.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Tue, 28 February 2012, 13:49:01
HOOOOOOOOOORAAAAAAAAAYYYYY!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Tue, 28 February 2012, 13:54:24
Can you explain a 'SELECT'?  It sounds as tho it can be used to set a layer/keymap via a keypress/combo.  So for instance I have a qwerty and a colemak map I could use Fn-1 to select qwerty and Fn-2 to select Colemak and the map changes "permanently" to that map.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Tue, 28 February 2012, 13:57:09
This new update sounds very awesome.  We need someone to help port it over to use on Phantom  :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 February 2012, 14:34:08
Quote from: REVENGE;529599
HOOOOOOOOOORAAAAAAAAAYYYYY!

Pretty much what I thought when I finally found some time to work on it again!!

Quote from: alaricljs;529605
Can you explain a 'SELECT'?  It sounds as tho it can be used to set a layer/keymap via a keypress/combo.  So for instance I have a qwerty and a colemak map I could use Fn-1 to select qwerty and Fn-2 to select Colemak and the map changes "permanently" to that map.

FN and SELECT are two different things here - I'm not sure if you mean FN keys as I understand them...? I use FN for a key that will act something like a shift, to access keys on a different layer, and it's effect is temporary while you hold it down. SELECT is permanent, until you output that SELECT again. There's an example in the tools zip that does pretty much what you want: colemak_select1.sc. It uses lctrl+lshift+lalt+1 to toggle between the two layouts.

Perhaps the easiest way to explain it is to explain how it works - when a SELECT code gets to the output stage of the converter, it toggles the state of that select and then _all_ the settings are reloaded from the eeprom. If you've tagged blocks with ifselect, and the state of that select has changed, you'll get different settings loaded up.

Since SELECT's toggle, you could end up running with more than one select enabled - maybe SELECT1 gets you colemak, SELECT3 gets you some fancy Java programming macros, and SELECT7 gets you media controls on your numpad. (I dunno, it's entirely up to you!).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Tue, 28 February 2012, 14:44:28
Quote from: Soarer;529636
It uses lctrl+lshift+lalt+1 to toggle between the two layouts.

Where you use crazy chords, I would use Fn.  I'm also not a fan of toggles, hence using 1 and 2 instead.  So given that a SELECT is what I thought (except toggling seems to be required), is it not possible to assign arbitrary commands to key combinations, such that Fn+1 would execute a select?

To be more clear on the whole Fn thing.  I expect anything typed with standard modifiers to make it to the computer intact, therefor I want to be able to have anything that doesn't make it to the computer to be activated via non-keys, that being Fn, Fn(n), ... So given an arbitrary set of keyboard management functions, Fn+1 through Fn+5 could be 5 different keymaps: qwerty, colemak, dvorak, and so on.  Then Fn-win could be enable/disable the Win key (outside of the Fn layer of course).  Fn-?? combos for media keys, Fn-?? combos for moving/disabling CapsLock...   stuff like that.  

I use crazy chord combos to manage least-common computer settings changes, like ctrl-alt-shift-L is turn on both monitors and set the left to primary.  Following that notion, your ctrl-alt-shift-1 would be turn on all monitors and set #1 to primary ;)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 February 2012, 15:11:28
Quote from: alaricljs;529642
Where you use crazy chords, I would use Fn.  I'm also not a fan of toggles, hence using 1 and 2 instead.  So given that a SELECT is what I thought (except toggling seems to be required), is it not possible to assign arbitrary commands to key combinations, such that Fn+1 would execute a select?


The crazy chord was just an example :) There must be millions of ways you could put these pieces together... but one thing you can't do currently is get my FN codes to do anything other than I've described above.

Don't forget the toggle can toggle the very key that does the toggling! So if qwerty was your base mode you might have a layer with FN1 + 1 assigned to SELECT1, to get you to colemak. In your colemak mode FN1 + 2 could be assigned to SELECT1 to take you back to qwerty. Settings later in the file override earlier settings (if they're trying to set the same thing), so maybe something like this would work for you...

Code: [Select]
remapblock
    LCTRL FN1 # whatever key you want, obviously!
endblock

layerblock
    FN1 1
endblock

remapblock
layer 1
    1 SELECT1
    2 FAKE_01 # do nothing
endblock

ifselect 1

include colemak.sc

remapblock
layer 1
    1 FAKE_01 # do nothing
    2 SELECT1
endblock


Course, if you've got enough spare keys to remap, you could do it without the layer stuff.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 February 2012, 18:31:15
Oh yeah, forgot to mention - SELECT_0 can be used to reset all toggles to off.

So you could do it as macros I guess. Remap Fn+1 to something unused (e.g. FAKE_01), then have a macro that triggers on that, and executes:
PRESS SELECT_0
PRESS SELECT_1

Maybe one day I'll put in a specific macro command to do that in one step, but don't hold your breath!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 February 2012, 20:32:10
Quote from: litster;529611
This new update sounds very awesome.  We need someone to help port it over to use on Phantom  :-)

Currently got about a dozen items on my to-do list, and making this sort of thing possible, somehow, is quite high on the list. I really can't say at the moment how quickly I'll be able get to it though.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Tue, 28 February 2012, 20:51:56
Well, there's people willing to help if you want to share the load  ;)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 29 February 2012, 07:43:06
Has anyone had a go at compiling the tools for Linux or MacOSX?

(Linux I could try sometime, but not Mac).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Wed, 29 February 2012, 15:12:00
I can try it on Mac later today or tomorrow, if you want. I'll be trying Linux, as well, since that's where my Model F is currently connected, and I'd prefer to just do it there.

Just to check, before I flash, are the "slow" fixes still in the latest version?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 29 February 2012, 16:41:14
Quote from: theferenc;531133
I can try it on Mac later today or tomorrow, if you want. I'll be trying Linux, as well, since that's where my Model F is currently connected, and I'd prefer to just do it there.
Either would be great! Linux is probably the one I'm more worried about, in case different distros need different runes to get the rawhid stuff working.

Quote from: theferenc;531133
Just to check, before I flash, are the "slow" fixes still in the latest version?
Yup.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 01 March 2012, 15:23:14
Lego!

[attachimg=1]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 01 March 2012, 15:34:56
I call the bastardized version of usage page 7 HID codes that the converter uses internally HIDX. It's an amalgamation of page 7 codes, plus MEDIA (page 12), SYSTEM (page 1), FN, SELECT and FAKE. I'm not happy with FAKE, now that it's visible to users. I'm thinking of changing it so there's a set of names that are better suited to making readable remappings for - for example, the ten keys on the lhs of a 122-key 'board could be called LF1 to LF10 (Left Function).

So... just a heads up that some things are likely to change in the config files before I call it version 1.0!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Thu, 01 March 2012, 19:50:43
Quote from: litster;529611
This new update sounds very awesome.  We need someone to help port it over to use on Phantom  :-)


Quote from: Soarer;530048
Currently got about a dozen items on my to-do list, and making this sort of thing possible, somehow, is quite high on the list. I really can't say at the moment how quickly I'll be able get to it though.


Good to hear that this is on your to-do list!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: mkawa on Fri, 02 March 2012, 00:24:50
i can port this to phantom, i just need some pointers on how to get simulavr running for teensy code (using the package in the ubuntu oneiric repos). basically, it looks impossible as the man page doesn't list atmega32 as a supported arch at all. so, either this is true and i need to order a teensy to play with before my phantom kits come, or it's not true and i need the incantation to get it to work.

i also have a mac i can work on if there's a newer/better simulavr i can work with on that.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 02 March 2012, 05:22:07
I haven't used the simulator at all, just a combination of debug print output, extra LEDs, test signal outputs, and an oscilloscope. If it supports AT90USB162 (Teensy 1.0) or AT90USB1286 (Teensy++), they're close enough for you to be able to familiarise yourself with the tools and the CPU architecture (reading/writing ports and pins etc).

I'll probably give you libraries that include everything except the except the left hand block in the diagram a couple of posts ago. So you'll feed it key up and key down events, ask it for LED status, call its task function... and that's about it. It's almost a drop-in replacement for the PJRC sample usb_keyboard code. My code uses Timer 0, but that's about it as far as resources goes I think. Amongst other things, I use that to maintain a 32-bit millisecond tick counter, which is probably useful to you.

You'll need to scan the matrix, debounce, and translate matrix codes into HIDX codes.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 03 March 2012, 12:57:13
Built myself a neat converter today :-)

A while back I spotted some console hack dongles on sale (http://www.easymg.com/avr-micro-sd-development-board-atmega32u4.html) for only $10, that have ATmega32U4 chips in them. I bought two, but unfortunately one was DOA. Oh well. The other one works fine. There's a schematic (http://www.tiaowiki.com/w/TIAO_AVR_/_Micro_SD_Development_Board_%28ATMEGA32U4%29) for it.

[attachimg=1]

It started off looking like this inside...

[attachimg=2]

Then I...
Removed the card socket.
Removed the 3.3V regulator and replaced it with a bit of wire, so that everything was running at 5V.
Soldered some thin single core wire to two pins on the chip for data and clock, and two SD card socket pads for power and ground.
Used hot glue to (hopefully) keep them from coming loose.
Cut the trailing socket from a PS/2-USB adapter (a crappy Belkin that kept reconnecting).
Put some heatshrink on near the end of it to stop it pulling out of the case.
Joined it up to the single core wires, with heatshrink on each connection.
Filed a hole in the case for the cable exit.

[attachimg=3]

[attachimg=4]

[attachimg=5]

[attachimg=6]

And ended up with this...

[attachimg=7]

:-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: SmallFry on Sat, 03 March 2012, 13:04:45
SWEET! Nice package to keep your converter in!
Since it uses Atmel's stuff to program it, is it compatible with the Teensy programming utility if you reflash the Bootloader?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 03 March 2012, 13:23:01
Thanks! Still one thing left to do... drill a hole in the case so I can reset it for flashing without taking it apart. Just pondering on exactly how I'll do it - thinking about gluing a flat piece of plastic onto the reset switch, so that it fills the gap between the switch and the case. Hmm. Anyway, the spot to drill is neatly marked by the cross of the 'T' in 'portable' :-D
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Sat, 03 March 2012, 13:30:55
How much does the case flex in that spot?  You might not need a hole, just fill the gap with a chunk of plastic and squeeze it to actuate the button.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 03 March 2012, 13:31:59
Quote from: SmallFry;534039
Since it uses Atmel's stuff to program it, is it compatible with the Teensy programming utility if you reflash the Bootloader?

Sorry, missed your edit... No, it's not compatible with the Teensy utility, and you can't load the Teensy bootloader onto it (or anything else for that matter, since you can't get the Teensy bootloader off a Teensy!). Atmel Flip works fine though, the 'problem' is just that the bootloader takes up more space than the Teensy one.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: mkawa on Sat, 03 March 2012, 13:35:18
Quote from: Soarer;532999
I haven't used the simulator at all, just a combination of debug print output, extra LEDs, test signal outputs, and an oscilloscope. If it supports AT90USB162 (Teensy 1.0) or AT90USB1286 (Teensy++), they're close enough for you to be able to familiarise yourself with the tools and the CPU architecture (reading/writing ports and pins etc).

I'll probably give you libraries that include everything except the except the left hand block in the diagram a couple of posts ago. So you'll feed it key up and key down events, ask it for LED status, call its task function... and that's about it. It's almost a drop-in replacement for the PJRC sample usb_keyboard code. My code uses Timer 0, but that's about it as far as resources goes I think. Amongst other things, I use that to maintain a 32-bit millisecond tick counter, which is probably useful to you.

You'll need to scan the matrix, debounce, and translate matrix codes into HIDX codes.
ok message received -- it sounds like simulators are pretty hopeless. this will have to wait until i have a teensy in hand.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 03 March 2012, 13:39:26
Quote from: alaricljs;534047
How much does the case flex in that spot?  You might not need a hole, just fill the gap with a chunk of plastic and squeeze it to actuate the button.

Hardly any flex, surprisingly, but it might _just_ work... with a very firm squeeze!

The other alternative is to figure out how to reboot to the loader from firmware, and then trigger it from a key combo, or by sending it some rawhid on the config interface.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 03 March 2012, 13:52:32
Quote from: mkawa;534050
ok message received -- it sounds like simulators are pretty hopeless. this will have to wait until i have a teensy in hand.

Dunno about hopeless, but I always find using them a mixed bag. It's nice to be able to step through code and check that it's doing what you intended, but on the other hand, you end up spending a fair bit of time working out how to simulate the external inputs. For example, for a keyboard controller, it would be fine to simulate the matrix scan code, but not so good at the debouncing code - you'd need to record some bouncing signals and replay them to the simulator, at the simulator's speed, and take into account how the matrix scanning interacts with it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: mkawa on Sat, 03 March 2012, 13:58:12
agreed. i was hoping there was a nice debugging toolkit that would let me do these things, but it sounds like most people working on teensy and duino projects just end up firing the actual boards up on their builds. (it's a good thing the code is all rather simple!)

i'll check back in in a bit when we have phantom boards and teensies in hand
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 03 March 2012, 17:29:31
Quote from: Soarer;534057
The other alternative is to figure out how to reboot to the loader from firmware, and then trigger it from a key combo, or by sending it some rawhid on the config interface.

Hmm. This looks quite easy, actually, but which address to jump to depends on the bootloader.

Jumping To The Bootloader (http://www.pjrc.com/teensy/jump_to_bootloader.html) - PJRC
USB DFU Bootloader Datasheet (http://www.atmel.com/Images/doc7618.pdf) (pdf) - Atmel Corporation

It would be nice to determine which bottyloader is present in code, rather than having specific builds. Hmm.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: drteming on Sun, 04 March 2012, 21:56:08
Newbie here.  Just got a terminal 1390572 last week.  Cleaned it up and did a full bolt mod and built a converter per Soarer's instructions.  I am typing this on the behemoth.  What a hoot.  Here's some pics of the converter.

In the box.
(http://farm8.staticflickr.com/7180/6808489832_f74f1208cb_b_d.jpg)

In action.
(http://farm8.staticflickr.com/7195/6954598029_8cf1957693_b_d.jpg)

Thank you, Soarer!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 05 March 2012, 17:00:05
Thank you for posting pics - I love seeing a nice tidy build!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 05 March 2012, 20:47:29
Oh that is beautiful. I am doing something similar when I have some spare time, and you just raised the bar on my expectations.

Very nice box.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Tue, 06 March 2012, 13:10:15
Soarer, do you want compilation feedback via PM or in the thread?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 06 March 2012, 13:45:29
Aha, cool! Probably here, in case others might want to try as well.

Unless it's embarassing...
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: theferenc on Tue, 06 March 2012, 18:43:45
I don't think it's embarrassing, no. This is all on Linux (RHEL 6).

I was able to get 2 of the tools (scas and scdis) to compile, after futzing around with them for a while. I'll PM you with the exact fixes I had to make. I can't get the other two (scwr and scrd) to compile. I'm pretty sure it's due to a missing usb.h file on RHEL. I'm going to keep trying to make them work, though.

To make these completely cross platform, there will need to be some conditional compilation, depending on platform. I've added the necessary code to the two files I was able to make compile, but not in a cross platform fashion. Everything is just hard coded. I'll add the macros to make it work on at least windows and linux, and I'll try and get mac done this weekend, then send everything back to you.

Anyone else able to get it to work?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 06 March 2012, 18:46:14
Quote from: Soarer;534197
Hmm. This looks quite easy, actually, but which address to jump to depends on the bootloader.

Jumping To The Bootloader (http://www.pjrc.com/teensy/jump_to_bootloader.html) - PJRC
USB DFU Bootloader Datasheet (http://www.atmel.com/Images/doc7618.pdf) (pdf) - Atmel Corporation

It would be nice to determine which bottyloader is present in code, rather than having specific builds. Hmm.

Knocked together some code that should work for nearly all Atmel AVR chips (except xmega), and with any bootloader :-)

Not tested it much yet... would be a good use of a simulator!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 06 March 2012, 19:06:01
Quote from: theferenc;537280
I don't think it's embarrassing, no. This is all on Linux (RHEL 6).

I was able to get 2 of the tools (scas and scdis) to compile, after futzing around with them for a while. I'll PM you with the exact fixes I had to make. I can't get the other two (scwr and scrd) to compile. I'm pretty sure it's due to a missing usb.h file on RHEL. I'm going to keep trying to make them work, though.

To make these completely cross platform, there will need to be some conditional compilation, depending on platform. I've added the necessary code to the two files I was able to make compile, but not in a cross platform fashion. Everything is just hard coded. I'll add the macros to make it work on at least windows and linux, and I'll try and get mac done this weekend, then send everything back to you.

Thanks for putting the time in! I'll plug my Linux (Mint, Debian) box back in so I can have a look see if it's got a usb.h on it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 06 March 2012, 22:10:08
Quote from: Soarer;537299
I'll plug my Linux (Mint, Debian) box back in so I can have a look see if it's got a usb.h on it.

Got scrd and scwr working on Mint! Needed libusb-0.1-4 and libusb-dev installing to get the required files. To keep it simple I used the PJRC Makefile, and changed my source files from C++ to C (to avoid any g++ vs gcc complications), which then only needed a few minor follow-up changes.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RC-1140 on Wed, 07 March 2012, 08:54:01
Hey Soarer,
at first: thank you very much for creating such a fantastic converter software. I use it all the time, for multiple keyboards. But now I was thinking about using it in an embedded project. And since I'm a cheapskate I don't want to order 6 more teensy's from pjrc. Would your precompiled hex file work on an ATMega 32U4 connected in the same way as a teensy, or does the bootloader do anything crazy, so teensy code doesn't run on ATMegas? Too sad that your code is too big to fit an ATMega 16U4...

RC-1140
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 07 March 2012, 10:13:47
It should work fine on any 32U4, as long as you can get it in there! The dongle I adapted has the Atmel bootloader on it, and that works OK.

I might be able to trim my code down to 16KB, but I'm not sure if I could get it down to 12KB to leave room for the bigass Atmel bootloader :-(
And of course, I'm not sure I can keep it under 16KB as I add new features.

The other issue is RAM - the 16U4 might only have enough for basic functionality (i.e. no layers or macros).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RC-1140 on Thu, 08 March 2012, 06:08:39
Actually even this would be great, as I'm currently using 0.996 anyway. This might be an interesting idea: having some kind of a "light" version. Maybe this would be interesting for anybody wanting to use it in some kind of an embedded project. (Noncommercial of course)

But I don't think RAM would be an issue on the Atmega16U4, if I read the datasheet right, the only difference between the 32U4 and the 16U4 is the Flash. Both have 2,5kB SRAM and 1kB EEPROM, and the same layout of Ports/Pins.

I would really appreciate if you did this one day.

RC-1140
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 08 March 2012, 07:25:34
The trouble is, I'm not sure why it helps much - the '32U4 chip is about 5EUR, and the '16U4 is about 4EUR - so there's not much reason on the basis of price. The other 16KB chip with USB, the AT90USB162 used in the original Teensy, is getting more expensive (relatively). There are a number of Teensy-like boards out there using the '162, but they aren't generally much cheaper than the Teensy 2.0, if at all.

The '16U4 has 1.25KB SRAM and 512 bytes EEPROM. The current build uses 1174 bytes of SRAM, and that's without counting stack space. More than half of that is related to layers and macros though.

How about the '32U2? It doesn't have enough SRAM or USB endpoints for the latest version, but 0.996 should run fine on it already, I think. It's about the same price as the '16U4.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 08 March 2012, 07:45:42
In other news, I just added Jump to Bootloader (http://geekhack.org/showwiki.php?title=Island:17458&p=537283&viewfull=1#post537283) support for the next release, with two ways of triggering it - a macro command so it can be done from the keyboard, and a utility so it can be done from the host PC.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: RC-1140 on Thu, 08 March 2012, 13:58:59
Yeah, of course that little price difference doesn't justify the extra work you would have with it. It was just a small idea I had,because I will have access to many dev boards with an 16U4 soon, and I thought I could use them, so I don't have to buy Teensy's from the US anymore. Apparently the easiest will be to get the dev boards, get some 32U4s and solder them in.

Thanks anyway!
RC-1140
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 08 March 2012, 14:34:34
I will have a look in case there's some easy memory saving that can be done, but otherwise I should pander to the masses... get the converter and tools up to v1.0 standard, make a library of my USB stuff, make a controller version, make a model F controller version, ... :-)

(OK, the last one is just because _I_ want to!)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 08 March 2012, 16:24:34
Well, I managed to reduce the size by about 2KB. (Stupid makefile forcing inclusion of vfprintf and vfscanf!)
So down to about 14.25KB for the latest (unreleased) build.
There's still about 0.5KB used by malloc and free that I could get rid of, but I'm pretty sure that wasn't there in 0.996 anyway.

So I think it might fit, but not with the default Atmel bootloader in place. Perhaps LUFA has one that's 2KB or less? Or, you could use one of your dev boards to ISP the others, and do away with the bootloader altogether.

I'm not sure yet, but I think I'd rather make it a cut down version of the latest code (cut down to fit in 1.25KB SRAM, and get under 14KB FLASH). That means you could still have the config stuff for basic remaps and macros. But not have layers, or macros that trigger on key release.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: SmallFry on Thu, 08 March 2012, 22:23:48
Will you ever open source your code? I know I've asked before, but can't recall off hand.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 March 2012, 07:20:01
Quote from: SmallFry;539786
Will you ever open source your code? I know I've asked before, but can't recall off hand.

I really don't know if or when. Once done it cannot be undone - last time I started thinking about it I got bogged down in trying to decide what license to use (and I still don't really like any of them). All I can honestly say is that it might happen eventually, but it's not at all high up on my to-do list.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Fri, 09 March 2012, 14:31:50
Which IBM keyboard would be best to use for this project if I want to keep it small and have NKRO?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 March 2012, 14:44:11
The AT (84-key). It's not 'small', but there's only about an extra inch on the RHS compared to a TKL, so you can still have your mouse close.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Fri, 09 March 2012, 14:50:41
Right, the AT.  But it would be hard to get one now.  Could I do this on a Phantom, without changing your source code, by rewiring the Phantom rows and columns to what your teensy firmware expects?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 March 2012, 15:51:22
Hard, but far from impossible. You just have to keep looking, and be prepared to pay whatever the going rate is.

Errr, no. This is a converter, not a controller. Until I make it a controller too. Or more likely, make it so that you can make it a controller. Who is the software bod for the Phantom?

I've brutally reduced my to-do list for v1.0, so that I can move on to other things like controllers. Anything not directly related to making a stable version for config files etc. has been postponed. But still, it will happen when it happens.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Fri, 09 March 2012, 15:55:40
Ah, I get it now.  The Phantom firmware we have now came from PrinsValium.  His code is based on the Teensy's keyboard sample code.  It has 6KRO over USB.

Another question.  Could your converter work in this way?

Filco in PS/2 mode -> Soarer's Converter -> PC USB port == NKRO over USB?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 March 2012, 16:12:24
OK. I'll talk to him when I'm ready to make plans for controller stuff.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 12 March 2012, 16:07:01
Quote from: litster;540413
Another question.  Could your converter work in this way?

Filco in PS/2 mode -> Soarer's Converter -> PC USB port == NKRO over USB?

Yes.

(I missed seeing the edit again!)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: drteming on Mon, 12 March 2012, 22:05:59
Well, I worked up the courage to delve into Soarer's 0.997 firmware.  My last foray into any sort of programming was in 1988 during high school using Pascal so I'm a bit behind the times.  Interestingly, we used IBM PS/2's with model M keyboards.  Anyway, I wasn't happy with the default mapping of the keys on my terminal 1390572.  With a little patience and persistence, I figured how to use hid_listen and found the key syntax in the hid_tokens.cpp file (opens with notepad) located in the source code of Soarer's sctools "common" subfolder.  

I use the number pad a lot in my work so I remapped the terminal pad to be exactly like a standard model M, and for the heck of it, I remapped Cmd13-Cmd24 to media keys.  The code is as follows.

Code: [Select]
[FONT=Courier New]ifset set3
remapblock
EUROPE_1 BACKSLASH # the key to the lower left of Field Exit/Enter

ESC NUM_LOCK # This block remaps the number pad
NUM_LOCK PAD_SLASH # to be identical to a regular model M
SCROLL_LOCK PAD_ASTERIX #
PAD_ASTERIX PAD_PLUS # Field - to + key
PAD_MINUS PAD_PLUS # Blank to + key
FAKE_19 PAD_MINUS # The top right key of the number pad
PAD_PLUS PAD_ENTER

FAKE_08 ESC # This block remaps the function keys
FAKE_09 DELETE # on the left side of the keyboard
FAKE_10 PRINTSCREEN
FAKE_11 SCROLL_LOCK
FAKE_12 PAUSE
FAKE_13 F1 # Help
FAKE_14 UNASSIGNED
FAKE_15 UNASSIGNED
FAKE_16 LGUI # Windows key
FAKE_17 APP # Menu Key

F13 MEDIA_WWW_HOME # Function/Cmd keys 13-24, my preference
F14 MEDIA_WWW_SEARCH
F15 MEDIA_MAIL
F16 MEDIA_MY_COMPUTER
F17 MEDIA_CALCULATOR
F18 MEDIA_PLAY_PAUSE
F19 MEDIA_STOP
F20 MEDIA_PREV_TRACK
F21 MEDIA_NEXT_TRACK
F22 MEDIA_VOLUME_UP
F23 MEDIA_VOLUME_DOWN
F24 MEDIA_MUTE

EUROPE_2 LSHIFT # The < > key to the right of left shift
LANG_4 UNASSIGNED # The key in the middle of the arrow keys
endblock
[/FONT]

Copy and paste the above code into notepad and save it as a .cs file.  Then use Soarer's sctools to convert and load it into the Teensy converter.  Of course, feel free to change the mapping to your liking.

This is only for the default 122 key model M terminal keyboard.  YMMV.  Hope this helps a fellow newbie.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Mon, 12 March 2012, 22:34:30
Quote from: Soarer;539358
..., make a model F controller version, ... :-)

(OK, the last one is just because _I_ want to!)
if you are serious about this, i'ld like to talk to you about a project i'm working on. some discussion is here:
http://geekhack.org/showthread.php?28021-a-modern-Model-F
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 12 March 2012, 23:14:27
Quote from: drteming;544056
Well, I worked up the courage to delve into Soarer's 0.997 firmware.

Hail to the Brave!

Thanks for posting up what you've done, and how. Sorry about the lack of documentation, one day I'll get round to putting some reference material together for the codes and default layouts etc. I'll probably be annoying and change some stuff around before then though - I certainly want to rename those FAKE_ codes - but I'll make it easy to update any config files.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 12 March 2012, 23:16:30
Quote from: wcass;544074
if you are serious about this, i'ld like to talk to you about a project i'm working on. some discussion is here:
http://geekhack.org/showthread.php?28021-a-modern-Model-F

I'm serious, but it's possibly not quite what you're after - my plan is to replace just the CPU on the Model F (or beam spring) controller board, and drive their square silver capacitive sensing chip from the Teensy.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Parak on Thu, 15 March 2012, 22:44:42
Quote from: Soarer;544119
I'm serious, but it's possibly not quite what you're after - my plan is to replace just the CPU on the Model F (or beam spring) controller board, and drive their square silver capacitive sensing chip from the Teensy.

I'm entirely too lazy to check this at the moment, but isn't the teensy++ and the main micro on model F the same DIP dimensions? That'd make for quite the convenient drop in replacement.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 15 March 2012, 23:29:45
Quote from: Parak;547334
I'm entirely too lazy to check this at the moment, but isn't the teensy++ and the main micro on model F the same DIP dimensions? That'd make for quite the convenient drop in replacement.

Yup, same size, but the ++ has GND and AREF in the middle of one side, which aligns with some signals that would be needed! (at least, on the particular controller board I'm looking at doing first that's the case).

So I was thinking of using the regular Teensy mounted so it matches up with as many needed signals as possible, and then linking the rest with (solid core) wire. It would only need a couple of these messy wires, and they need to go to space that isn't blocked by the Teensy.

The first step in this is to remove the CPU and replace it with a socket (so the original CPU could be replaced to revert the mod). The Teensy would have little pins soldered into it (the usual header pins are too large) for about 3/4 of it's pins, then the 2 or 3 wires added.

Many of the Model F controllers have some form of multiplexing, so they don't need lots of pins on the CPU - which is nice!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Parak on Thu, 15 March 2012, 23:57:01
They would align in every one of the four possible orientations of a teensy++? Still, that's awesome work that you're doing :D
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 16 March 2012, 07:57:41
Quote from: Parak;547433
They would align in every one of the four possible orientations of a teensy++? Still, that's awesome work that you're doing :D

Well, there's also that +5V and GND are on diagonally opposite corners of the CPU, vs opposite corners at one end of the Teensies. That means only two orientations are really worth thinking of - either lining up +5V or GND - and both put those other two pins somewhere in the Port 1 set of pins (P10 to P17).

Here's the CPU, with the 29 pins that might be used marked...

[ATTACH=CONFIG]44416[/ATTACH]

It varies quite a lot between the various Fs which pins are actually used for scanning, on some it's not many at all! And of course all of them use some pins for the interface to the host, which can be ignored.

edit: BTW, the main reason for doing this is to be able to use keyboards that can't possibly work with a converter because they don't send break codes for most keys, like the beam spring and bizarro F 'boards. But there's no reason why it couldn't be used for XT, AT and 122-key F 'boards too.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Parak on Fri, 16 March 2012, 10:18:19
Quote from: Soarer;547732
Well, there's also that +5V and GND are on diagonally opposite corners of the CPU, vs opposite corners at one end of the Teensies. That means only two orientations are really worth thinking of - either lining up +5V or GND - and both put those other two pins somewhere in the Port 1 set of pins (P10 to P17).

Hmm, I see. Does T0 have to be used for something? If not then using teensy++ with +5V oriented to Vcc, GND and C7 could be left without the machine pins, with just one wire going from GND to Vss. Regardless, I'd be able to deal with the problem in whichever way you decide on; I'm just excited about the possibility to be able to use it "natively" on my F 122 key at some point :p
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 16 March 2012, 13:12:10
Quote from: Parak;547815
Does T0 have to be used for something?

Depends on the 'board - the XT, AT and DisplayWriter use it for signalling to the host, so we don't need to use it in those cases. The 3104 uses it as part of the scannning, so yes in that case. I think the 122-key is most similar to the AT (from memory).

Another idea for mounting it would be to match the good side of the ++ with the busy side of the CPU (pins 21 to 39), and hang the ++ off to that side (if there's room). Then use wires to reach over to the other side. Not quite as stable, but easier to work with.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Mon, 19 March 2012, 00:05:55
thanks Soarer.

i used this in my IBM AT project here:
http://geekhack.org/showwiki.php?title=Island:25919

and my TSSK project here:
http://geekhack.org/showwiki.php?title=Island:29086
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: ed_avis on Sun, 01 April 2012, 10:58:36
With a Dell M6300 (BIOS rev A14) and Windows XP x64 SP2, and the converter driving a Model F terminal keyboard, you have to plug in the converter when the machine has already booted.  It does not work for hitting F2 to enter BIOS setup, for example.  Background thread

http://geekhack.org/showthread.php?29425

This is using the latest stable version of the converter code.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Sun, 01 April 2012, 11:36:41
Quote from: ed_avis;563473
With a Dell M6300 (BIOS rev A14) and Windows XP x64 SP2, and the converter driving a Model F terminal keyboard, you have to plug in the converter when the machine has already booted.  It does not work for hitting F2 to enter BIOS setup, for example.  Background thread

http://geekhack.org/showthread.php?29425

This is using the latest stable version of the converter code.

Yeah, I've had troubles with a Dell Inspiron 630m doing the same thing. Presuming BIOS defect.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: ed_avis on Sun, 01 April 2012, 15:19:15
Strangely, although the M6300 does not recognize the Soarer-adapted keyboard for hitting F2 to enter Setup, it does work fine once you're in Setup.  But then once booted into Windows you have to disconnect and reconnect - which suggests it's not purely a BIOS issue?  (I imagine Windows talks to USB keyboards directly rather than via the BIOS.)

The Ziotek PS/2-to-USB adaptor on the same system had a different problem, where it would work if booting from cold but would require unplug and replug if resuming from suspend.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 01 April 2012, 15:29:16
There must be something peculiar that these machines have in common. I mean, they work with a regular USB keyboard, right?

Baffles me, because I am sending a basic, boot-compatible report, at all times!

The PS/2 to USB adapter is interesting, because it too will be a composite device. Perhaps the BIOS deals badly with all composite devices in some way, and has only been tested with the most basic of keyboards? It doesn't seem likely, but...

When Windows boots, it should be completely resetting all of the USB devices. I am at a loss to imagine what the BIOS can be doing to prevent this. Same presumably applies to any other OS these days.

I'm hoping that if this problem becomes more common a pattern will emerge that makes clear what is going on. It would certainly be useful to test as many composite devices as possible, to help in that.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: ed_avis on Mon, 02 April 2012, 04:05:47
Soarer I see that you are in the same country as me.  If you are near London and you want to borrow the laptop to investigate I could lend it for a week or two.  In the meantime I will also test it with a blue cube.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 02 April 2012, 17:54:56
Quote from: ed_avis;564466
Soarer I see that you are in the same country as me.  If you are near London and you want to borrow the laptop to investigate I could lend it for a week or two.  In the meantime I will also test it with a blue cube.

Many thanks for the offer! For me, that wouldn't be feasible for a month or two though, so plenty of time to think of other things to try on it in the meantime.

TBH, I was hoping that kishy's machine was a one-off, so I haven't put any effort in to try and sort this problem out at all yet :-) That you have the same problem makes it a higher priority... once I've released v1.0 I'll probably knock up some test versions for you and/or kishy to try out, if we haven't spotted anything before that.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Mon, 02 April 2012, 19:26:12
Quote from: litster;540413
Another question.  Could your converter work in this way?

Filco in PS/2 mode -> Soarer's Converter -> PC USB port == NKRO over USB?


Quote from: Soarer;543629
Yes.



Sweet!  I am going to get a few parts to build this.  I have Teensys at home ready to go.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Morning Song on Sat, 07 April 2012, 17:44:59
Just a little report/question: I'm using one of the earliest teensy adapters, made by DFJ, and it seems mostly, but not all compatible--my un-jumpered 6011668 seems to be reporting this through hid_listen, with the 0.997 test:

Keyboard ID: AB83
Code set: 2 (extended)

wED rFE !!FEwED rFE !!FEwED rFE !!FE



Does this mean I'm out of luck with your firmware? (dfj's still works mostly, but has a couple pokeys that i hoped yours might fix.)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 07 April 2012, 18:30:03
Hey, that's an odd one! What's a 6011668? I'm guessing it's a 122-key terminal board that we'd expect to use code set 3...

In which case, I wonder why it's reporting its ID as AB83... and if we could change that, without any jumpers to swap around...

Or... there's an undocumented command that you could put in a config file, which would force it to use set 3... I haven't had anything like this to test it on yet though, so I can't guarantee it will work!!

Code: [Select]
force set3
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Morning Song on Sat, 07 April 2012, 19:04:12
Quote from: Soarer;570157
Hey, that's an odd one! What's a 6011668? I'm guessing it's a 122-key terminal board that we'd expect to use code set 3...

In which case, I wonder why it's reporting its ID as AB83... and if we could change that, without any jumpers to swap around...

Or... there's an undocumented command that you could put in a config file, which would force it to use set 3... I haven't had anything like this to test it on yet though, so I can't guarantee it will work!!

Code: [Select]
force set3

Er, whoops! It's a 6110668, not 6011668. (Same as, i believe, Sethstorm's).


 Force Set3+slightly modded legacy.sc for sane mapping did the trick, though. Additionally, that did change the keyboard ID to 0000, according to hid_listen.


and now that i actually took a look with a flashlight, there are some jumpers on the pins. Whoops! (I donated the dipswitch block to Kishy, and i thought he hadn't put any jumpers on the pins)

Sorry for the derpiness on my part.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 07 April 2012, 19:14:28
Quote from: Morning Song;570182
Er, whoops! It's a 6110668, not 6011668. (Same as, i believe, Sethstorm's).


 Force Set3+slightly modded legacy.sc for sane mapping did the trick, though. Additionally, that did change the keyboard ID to 0000, according to hid_listen.

Cool, 'force' works! Using it stops the converter querying the board at all, so it's no surprise that the ID is no longer reported correctly. (I should fix that. It hardly matters, but it's confusing).

Quote from: Morning Song;570182
and now that i actually took a look with a flashlight, there are some jumpers on the pins. Whoops! (I donated the dipswitch block to Kishy, and i thought he hadn't put any jumpers on the pins)

Sorry for the derpiness on my part.

Ahhh... so had you or kishy tried kishy's driver mods etc with that board before? IIRC that required the ID to be set to AB83, to fool Windows into thinking it was a normal 101-key 'board... fooled my converter too!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Morning Song on Sat, 07 April 2012, 19:44:07
Exactly! Back in the Dark Times before you guys came out with these adapters, Kishy helped me with (read: Did all the real work because my cabling skills aren't worth crap) a cable mod, and i ended up trading dfj for one of his Teensy adapters several months later; his firmware didn't bother with supporting multiple keyboards, so it happily ignored the ID.

Incidentally, would it help at all for someone(i.e. me) to draw up a chart of the default mappings' symbolic names? I'm futzing with re-creating my wonky layout, and half put one together for my own reference. I could clean it up and toss it your way.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 07 April 2012, 20:51:13
Heh, I finally started to try and get some better documentation sorted out today! A diagram would be great! I should warn you that I've renamed all the FAKE codes (in v1.0, which is pretty much ready apart from the docs). They will have recognisable names - EXTRA_F1 to EXTRA_F10 for the Terminal board's left hand function keys, for example - all listed in the attached html. Actually, I had a go at a diagram a while back, based on one of John Elliot's SVGs, but it didn't work very well (long names vs. small boxes!) and never got finished :-(

[ATTACH=CONFIG]47751[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Sat, 07 April 2012, 21:16:44
i was thinking i would like to help with an .hta GUI wrapper for your code. it would work in Windows only, but once programed the keyboard would work with any OS.

if you are not familiar with .hta - it is like classic .asp, but requires no server. easy to read code, nothing to compile, can use css.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 07 April 2012, 22:23:18
Quote from: wcass;570268
i was thinking i would like to help with an .hta GUI wrapper for your code. it would work in Windows only, but once programed the keyboard would work with any OS.

if you are not familiar with .hta - it is like classic .asp, but requires no server. easy to read code, nothing to compile, can use css.

The more the merrier! I've managed to get the command line tools compiling on all platforms, so there would be that fall-back available for when a Windows box isn't handy. I'm no fan of IE though; I haven't touched it for years! :-)

One idea I had for making a cross-platform GUI was to make a minimal web server (accepting connections from localhost only, of course) that contained the command line tools' code. It wouldn't need to support much, just a form post or equivalent. That end of it I could write fairly easily. What I'm not experienced with is the browser side of it - javascript, dynamic web pages, etc.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Morning Song on Sat, 07 April 2012, 23:35:24
My thoughts on the matter is that if there's a nice simple one-file way of including a windows GUI, there's less of a need for cross-platforming. On Linux, the command line is a little more easily available and comfortable.

Incidentally, here's a couple INCLUDE-able .sc files--the only bits of my layout that might be of wider interest.

Standard US Dvorak keyboard layout:
http://dl.dropbox.com/u/187059/dvorak.sc

Macintosh style layout for the Tenkey pad:
http://dl.dropbox.com/u/187059/macnumpad.sc

Sun Type 6 mappings for L1-L10 (Not compatible with Windows):
http://dl.dropbox.com/u/187059/sunkeys.sc
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Sun, 08 April 2012, 08:08:46
A gui could probably be built across the command line tools with AutoHotKey.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 08 April 2012, 17:55:04
It partly depends on what you all think a GUI should do! I know it wouldn't start off all singing and dancing, but it would be nice to make a roadmap for how it could get there.

There is one potential feature that might not work nicely just by running other programs: it would be very nice for the GUI to be able to grab a key-press, or a combination, from the converter. That would want to be the 'raw' internal code(s), rather than what is sent to the host already (i.e. before remapping for a key, and before macro expansion for a combination).

So, what do you all think a GUI should do, and look like?


MorningSong - thanks very much for sharing your config includes!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: SmallFry on Sun, 08 April 2012, 18:34:03
The gui should include a verbose just for debugging stuff:) Other than that, and being red (just because I like red) I have no real suggestions! Good Luck Soarer!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Parak on Mon, 09 April 2012, 01:09:39
I think the GUI could basically just be a front end to the tools. One would select from a list the physical layout that they are using, and remap keys by pressing on them physically or in the GUI, and reassigning their raw codes to something else via a dropdown or similar. Applying the changes would save it in the .sc format and upload it to the converter. Conversely, it could be also made to open the .sc files for editing via the GUI.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 09 April 2012, 07:35:07
Heh, a minimal front-end could just be a text editor with a 'send to keyboard' button.

As in, _just_ enough to remove the need to open a command prompt  :-p

I started thinking about Java, and went looking to see what rawhid code there is around already. I found a project called waxbee (http://code.google.com/p/waxbee/), which has a Java config app that talks to a Teensy using JNI wrappers around the PJRC rawhid routines (http://code.google.com/p/waxbee/source/browse/WaxBeeConfig/rawhidlib/jni_stubs.c?r=12&spec=svn70). I think it might only support Windows currently, but could easily be made cross-platform. And most people have Java installed, I guess.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fruktstund on Mon, 16 April 2012, 16:04:41
I'm a bit tired right now, and this might therefore be somewhat a stupid question, but I'll ask it anyway: would it be possible to use this converter for a USB keyboard (without using a USB -> PS/2 adapter)? I think it could've been nice to have all your keyboards remapped the same way, with the same function layers and so on.

Thanks for a great converter anyway. I used it a couple of weeks ago for an old XT keyboard I found, and it worked really well!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 16 April 2012, 18:04:09
Glad you find it useful!

USB-to-USB might happen at some point in the future - there is suitable hardware out there (the Vinculum 2 etc. - the Teensies just can't do it).

But I'll be honest... although I'd like to see such an adapter exist, I don't have much use for it personally. Or rather, there are a few other projects I'd like to play wiith first :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Mon, 16 April 2012, 21:37:57
Quote from: litster;540413
Another question.  Could your converter work in this way?

Filco in PS/2 mode -> Soarer's Converter -> PC USB port == NKRO over USB?


Quote from: Soarer;543629
Yes.



Quote from: litster;565097
Sweet!  I am going to get a few parts to build this.  I have Teensys at home ready to go.


Hi.  I just built a Soarer converter.  But I am running into some problem.  Here is the setup:

Teensy 2.0
V0.997 Soarer firmware
mini 6-pin DIN
Windows 7 64-bit

I got it to work when I connected an old Cherry G80 or G81 keyboard and set to PC (instead of AT) on the DIP switch.  All keys work.  But if I plug in a regular IBM Model M or a Filco over PS/2 connector, I only get "R06" as I type in the HID_LISTEN debug app.  

I will re-read the thread from the beginning to see if I missed anything.  Any hint would be much appreciated.  Thanks.

Edit: looks like I am having the same problem that 8_Inch_Floppy had (http://geekhack.org/showwiki.php?title=Island:17458&viewfull=1&page=10&do=comments#post349632), but there was no update on whether he fixed it or not.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Tue, 17 April 2012, 06:09:16
Silly question, but are you unplugging the USB connector before changing keyboards?

Even on a converter, those interfaces are not supposed to be hotplugged.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 17 April 2012, 06:16:54
Aha, I hope it is just that!

It's the only thing I can think of that makes sense of the evidence.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Tue, 17 April 2012, 09:52:35
Hi.  I tried cold plugging different keyboards.  The result is the same.  On the old Cherry keyboards with DIP switch, the converter should be able to detect and work with the keyboard set to either PC mode or AT mode, correct?  Thanks.

Edit: I assume if I swapped wires and pins, it wouldn't work at all in either mode.  Since it works with at least one mode, that means wiring is correct, right?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 17 April 2012, 10:18:36
So you're plugging the keyboard into the converter, and then the converter into the PC, right?

Otherwise, yeah, the wiring must be sound for the XT mode to work.

Model M is known to work without problems (normally), so that's distinctly odd.

It's not the same as 8_inch_floppy's problem, that's a very specific issue relating to certain keyboards.

If you have hid_listen open and then plug in the converter with the M attached, is anything printed up?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Tue, 17 April 2012, 11:23:12
Quote from: Soarer;576976
If you have hid_listen open and then plug in the converter with the M attached, is anything printed up?

Thank you!  That was it!  I always connected the Teensy to the PC first, and then plug in a keyboard.  That is not the correct order.  The correct order should always be disconnect Teensy from PC, plug in keyboard through PS/2 connector, then connect Teensy to PC.  It is working now!  

Thank you!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Tue, 17 April 2012, 11:55:29
Good to hear - and yes, hotplugging XT, AT or PS/2 interfaces is not really the best thing for them.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 17 April 2012, 11:55:56
Quote from: litster;577034
It is working now!

Phew!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Tue, 17 April 2012, 12:48:26
Soarer, is it possible to detect a disconnect of the PS/2 connection, and reset the Teensy when PS/2 connector is plugged back in?  That would stop noobs like me from screwing it up.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 17 April 2012, 13:14:13
Quote from: litster;577098
Soarer, is it possible to detect a disconnect of the PS/2 connection, and reset the Teensy when PS/2 connector is plugged back in?  That would stop noobs like me from screwing it up.

Hmm. Probably, with some work, but I'm not sure I want to encourage it! (There is a risk of damaging the Teensy).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Wed, 18 April 2012, 05:41:43
What about detecting the unplug, and then blinking an error condition? Or even having the Teensy spew out "DO NOT HOTPLUG KEYBOARDS, UNPLUG THE TEENSY FIRST" into the connected PC?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: litster on Wed, 18 April 2012, 15:52:19
Hehe, I thought more people need to know how cool Soarer's converter is, so I posted a new thread on the keyboard forum.  :D

Thanks Soarer for your awesome firmware!

http://geekhack.org/showthread.php?30466-Filco-NKRO-over-USB-for-REALZ!&p=578220#post578220
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 18 April 2012, 22:08:28
Thanks for that! Hope you enjoy it, and find a use for some of the other features as well!

Was bound to attract at least one OCN-style know-it-all though... let's find out just how little he knows about USB :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 18 April 2012, 22:39:42
Been working on the docs a bit - any comments and/or tips would be welcome!

[ATTACH=CONFIG]48570[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Thu, 19 April 2012, 14:19:40
Quote from: Soarer;578542
Been working on the docs a bit - any comments and/or tips would be welcome!

(Attachment) 48570[/ATTACH]
Oh man, this looks great! I'll do a read through, let you know if I have any suggestions.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Gawkbasher on Thu, 19 April 2012, 14:23:16
Very cool documentation.  Thanks!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 19 April 2012, 14:56:53
It's pretty much the first time I've messed with CSS, so, um, don't look at that!

The FAQ section will get some content... once I've skimmed through all 400 posts in this thread again :-D
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Thu, 19 April 2012, 20:44:16
FWIW, you can do the navbar stuff in CSS, too - no need to do it in JavaScript.

Typo on the firmware page:

"Teensy++ (no longer vailable)"

Looks quite nice, though.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 19 April 2012, 21:27:43
Quote from: bhtooefr;579331
FWIW, you can do the navbar stuff in CSS, too - no need to do it in JavaScript.
The navbar is done in CSS, but effectively it's a client-side include I really wanted... just happened to find a .js solution and moved on to something else... it would be great if there's a neater way :-)

Quote from: bhtooefr;579331
Typo on the firmware page:

"Teensy++ (no longer vailable)"

Looks quite nice, though.

Thanks! Going for a simple and clean look, mainly because I can't be bothered too much with two sets of styles for print and screen! Also, content is key, at this stage.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 23 April 2012, 07:33:12
(I posted this yesterday, then a database rollback killed it...)

Happy Birthday to my Converter!!!

One year old today!!!


To celebrate, I present v1.0, with these new and improved features...



(Be warned: I've rushed this out, and haven't fully tested it all yet!)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Zorael on Mon, 23 April 2012, 12:03:36
Quote from: Soarer;579614
Happy Birthday to my Converter!!!

One year old today!!!

Congratulations!

Pre-built linux tools sounds awesome! Excuse me if I'm sobbing; I've just spent the better part of yesterday putting together a patch (http://pastie.org/3815490) to fix compilation on linux (including a Makefile) which is all suddenly hopelessly irrelevant! ;'3


I'm preparing to solder my new Teensy2 onto the controller board of an old Model M keyboard (the 8P5C terminal connector kind), but I'm still at the point where I need to drill holes for bolts. I had to take it apart to clean it out properly and replace some springs. Besides finding a proper config to flash, still remaining is to figure out which controller board surfaces and joints to solder to! D: (any help/pointers/links appreciated)

Quote from: Soarer;539989
Quote from: SmallFry;539786
Will you ever open source your code? I know I've asked before, but can't recall off hand.

I really don't know if or when. Once done it cannot be undone - last time I started thinking about it I got bogged down in trying to decide what license to use (and I still don't really like any of them). All I can honestly say is that it might happen eventually, but it's not at all high up on my to-do list.

Do I understand it correctly then that the tools are open source, but the firmware itself is not? If so, that's a bummer. :( You're certainly free to do with your software as you wish! I had just hoped to learn from it.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 23 April 2012, 12:54:40
Quote from: Zorael;579916
Congratulations!
Thanks! And welcome to geekhack!

Quote from: Zorael;579916
Pre-built linux tools sounds awesome! Excuse me if I'm sobbing; I've just spent the better part of yesterday putting together a patch (http://pastie.org/3815490) to fix compilation on linux (including a Makefile) which is all suddenly hopelessly irrelevant! ;'3
Oh man, I'm really sorry :-(  There were a few posts about porting a while back (but they might've been lost in one of the rollbacks).

Your patch looks pretty interesting - my build is lame by comparison, I fear!

Quote from: Zorael;579916
I'm preparing to solder my new Teensy2 onto the controller board of an old Model M keyboard (the 8P5C terminal connector kind), but I'm still at the point where I need to drill holes for bolts. I had to take it apart to clean it out properly and replace some springs. Besides finding a proper config to flash, still remaining is to figure out which controller board surfaces and joints to solder to! D: (any help/pointers/links appreciated)
Hmm, I guess you might be able to trim an IDC connector to fit where the cable plugs onto the controller. Maybe from a USB header, if 2x5 pins would cover the ones you need.

Quote from: Zorael;579916
Do I understand it correctly then that the tools are open source, but the firmware itself is not?
That's right, yes. The tools need to be open IMO because you shouldn't run exes from anonymous people without being able to check them somehow! :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: andrewjoy on Wed, 25 April 2012, 06:00:40
will this work on the rubber dome wise boards also ? i got one off ebay quite cheap i was expecting plate mounted blacks but this is one of the best rubber domes i have typed on what to convert it and use it at work ( i cannot have a loud keyboard :(
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 25 April 2012, 06:10:30
I don't know the keyboard - any idea what protocol it uses? What connector?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: andrewjoy on Wed, 25 April 2012, 08:24:34
it uses a phone type connector similar to other terminal boards

i am amusing it uses the terminal scan codes but i cannot be sure i will get a modelf number when i get home
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: John Boone on Wed, 25 April 2012, 11:38:31
Quote from: Soarer;579614

Reduced hex size (now fits in 16KB, just)


Congrats and happy birthday for your Converter !

I would like to know if it is possible to run the code on an ATmega16U4, which has less ram (only 16kB) ?

Thx
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 25 April 2012, 13:45:16
Quote from: John Boone;581868
Congrats and happy birthday for your Converter !
Thanks!

Quote from: John Boone;581868
I would like to know if it is possible to run the code on an ATmega16U4, which has less ram (only 16kB) ?
Yes, it can, with some caveats...

First, it won't fit with the standard Atmel DFU bootloader (which is 4KB), so some other means of loading the firmware has to be used.

Second, the 16U4 has less RAM, so that limits how complex you can make your config (re. layers and onbreak macros).

Third, it's completely untested, since I don't have a 16U4. I'm pretty sure that it will work fine, but I had to admit that!

That said, there is a 16U4 hex file in the v1.0 zip :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: John Boone on Mon, 30 April 2012, 18:40:15
Thanks for the answer, well I will stick with the 32k version as for now, since i am not very experienced and don't know yet what will be my future needs.

Another little question, i saw that there is a "RC" version of the ATmega32U4, but could your code run on a RC clocked MCU ? It would be clocked at only 8mhz instead of the 16mhz of the cystal quartz "powered" teensy v2.0.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 01 May 2012, 05:37:09
Quote from: John Boone;586774
Thanks for the answer, well I will stick with the 32k version as for now, since i am not very experienced and don't know yet what will be my future needs.
Unless you already have some 16k chips, then it's definitely worth going for the 32k. It's not hugely complicated to program them another way, but it does mean buying a programmer, or adapting another USB dev board to be a programmer.

Quote from: John Boone;586774
Another little question, i saw that there is a "RC" version of the ATmega32U4, but could your code run on a RC clocked MCU ? It would be clocked at only 8mhz instead of the 16mhz of the cystal quartz "powered" teensy v2.0.
No, it needs the 16MHz crystal. The RC oscillator isn't good enough for full-speed USB.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Sun, 27 May 2012, 02:09:57
Woo, busted out the Unsaver tonight. Converter works great, and now I finally have the layout I've always wanted!

One note: it might be handy if you could include PS/2 set 1 make codes in your manual side by side with the HID codes. I use Aqua's key test which prints out the PS/2 make codes, so I had to go grab the Translate.pdf from Microsoft to do a lookup.
Or: you could also make a note that LANG_4 is the center key in the arrow cluster for 122s. :D
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 27 May 2012, 05:24:48
BTW: LANG_4 is the center key in the arrow cluster for 122s. :-p

There is an easier way to find that out - HID codes are printed to the hid_listen output as +XX / -XX, and the HID code list in the docs is in numeric order ;-)

Actually, that's the best way because then you know the code that needs to be remapped, rather than seeing the code after any remappings you might already have. (Of course, if you haven't loaded any remaps, it's the same thing!)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Sun, 27 May 2012, 14:19:13
Quote from: Soarer;601190
BTW: LANG_4 is the center key in the arrow cluster for 122s. :-p

There is an easier way to find that out - HID codes are printed to the hid_listen output as +XX / -XX, and the HID code list in the docs is in numeric order ;-)

Actually, that's the best way because then you know the code that needs to be remapped, rather than seeing the code after any remappings you might already have. (Of course, if you haven't loaded any remaps, it's the same thing!)
Good tip, thanks!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 31 May 2012, 15:23:26
New version which fixes a bug that stopped jump to bootloader functions working on AT90USB1286 (Teensy++ 2.0). Not quite sure why the ATmega32U4 (Teensy 2.0) wasn't affected - it would've been jumping into the middle of the bootloader instead of the beginning!!

Just the .hex files in this zip, you still need the v1.0 zip for the tools and docs.

[ATTACH=CONFIG]51924[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 June 2012, 17:20:31
Quote from: ed_avis;563473
With a Dell M6300 (BIOS rev A14) and Windows XP x64 SP2, and the converter driving a Model F terminal keyboard, you have to plug in the converter when the machine has already booted.  It does not work for hitting F2 to enter BIOS setup, for example.  Background thread

http://geekhack.org/showthread.php?29425

This is using the latest stable version of the converter code.


Quote from: kishy;563521
Yeah, I've had troubles with a Dell Inspiron 630m doing the same thing. Presuming BIOS defect.


We can add Dell Latitude D800 to that list :-(

At least I have one to play with, so if I could just think of some things to test... :-D
Title: Linux/Ubuntu 12.04 problem with Teensy
Post by: fohat.digs on Tue, 05 June 2012, 21:43:23
I have installed 12.04 as a dual-boot with Windows 7, and the OS does not seem to recognize the Model F-122 keyboard anymore.

Can you suggest some way to wake it up? Do I need to download some sort of driver for the Teensy?

All was OK in 10.04

Thanks!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 June 2012, 07:18:31
Oh crap - what have they gone and done! :-(

No driver needed, it should be all there already, it's just HID. Apart from plugging it in after booting I can't think of any other way to wake it up.

One thing I noticed on the Dell is that some of it is still active - two devices show up in device manager. I haven't checked which yet, but it appeared to be the dummy keyboard and the hid_listen output (it connects, but no debug print gets to it). The lock LEDs still toggle. So maybe I've got something slightly out-of-spec which is upsetting both the Dell and Ubuntu 12.04.

So it would be helpful if you could try some tests...
1. see if hid_listen still connects
2. connect a keyboard with lock LEDs to the converter and see if they toggle (using another keyboard to press caps lock etc, obviously!)
3. see if v0.996 works, since that's the last one before the config interfaces were added
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Wed, 06 June 2012, 07:37:10
Also check if the USB on the other side of the Dell works.  I haven't been able to find references to it but I would have swore that one side provided less power, it might be enough to upset the teensy.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Wed, 06 June 2012, 08:07:16
Quote from: alaricljs;608452
Also check if the USB on the other side of the Dell works.  I haven't been able to find references to it but I would have swore that one side provided less power, it might be enough to upset the teensy.


FWIW, all of my tests on the 630m involved all 4 ports (which are on the same "side", right hand, two on the side and two on the back).

Not seeing any issues yet, again FWIW, with my Lenovo ThinkPad W520 via the dock or built in ports. Win7 Pro 64 bit.

The Dell Vostro 3750 that I owned for a brief time also had boot-up issues with Soarer's adapter - but only AFTER a BIOS update. The version that was on mine when it shipped worked fine, after an update it started killing the adapter on boot.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Wed, 06 June 2012, 08:10:56
My D820 and e6410 both have opposite side USB ports, I was under the impression that 6xx series were quite similar to the 8xx.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 June 2012, 08:40:25
Actually, on the D800 (A11 BIOS) it seems to work OK from a cold boot, but not on restart :-/

Doesn't seem like a power issue, but I could try an external powered hub to be sure.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 June 2012, 11:12:04
Hmm... so on this Dell actually all devices are showing up. Strangely, the scinfo command manages to get info so the config pipes are (sort of*) working, and as I said, LED output seems fine too. But there is no input to hid_listen, even though it connects.

* USBlyzer reports the scinfo output request as successful, but not the input response. Even though scinfo gets and displays a response!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 08 June 2012, 13:38:48
I not sure that this D800 has the quite same problem as those other Dells. On this one, my converter only stopped working if I pressed F2 (or any key) before the BIOS had turned on the USB, or after it had turned it off and before Windows had turned it back on. (I think!). There is an A13 BIOS I could upgrade to and test.

I have managed to fix that bug though - the converter was getting stuck trying to wake up the PC when it was already awake. There's a couple of USB commands that I wasn't handling which enable and disable remote wakeup, so I've added handlers for them which fixed it. I've also reset a couple of internal state tracking flags when the USB connection is reset, as a precaution, since if they are wrong it could prevent any output from the converter.

Here's a new version with those fixes. I doubt it, but there is a slim chance it might fix the Dells and Ubuntu 12.

[ATTACH=CONFIG]52483[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 08 June 2012, 15:32:59
I don't know about anybody else's Ubuntu 12.04 problem, but mine was fixed immediately after I booted up using a (Dell) PS2 keyboard and then plugging in the F/Teensy "hot" to the USB port.

I had read about that from other people, but I never had to do it before, it had always worked for me right away.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 08 June 2012, 15:48:33
Quote from: fohat.digs;609928
I don't know about anybody else's Ubuntu 12.04 problem, but mine was fixed immediately after I booted up using a (Dell) PS2 keyboard and then plugging in the F/Teensy "hot" to the USB port.

I had read about that from other people, but I never had to do it before, it had always worked for me right away.

Interesting... that actually makes it more similar to the Dell laptops' problem, in that something's going wrong during boot that can be worked-around by connecting the Teensy later. Or do you mean it now works through bootup, now that you've done that once?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 08 June 2012, 17:33:19
Yes, I think that it just had to recognize the USB device once, smooth sailing after that.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 08 June 2012, 17:40:09
Ah good. Just these pesky Dells to deal with now then! :-D
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Mon, 18 June 2012, 19:07:28
Hey guys I need a little help with my teensy install.  I'm converting an XT to usb.  I want to wire the AT cable directly to the teensy and keep everything internally within the XT chasis.

I know I wire these 4 cables to GND, VCC, PF0 (clock), and PF1 (data).  But which wire colors correspond to those pins?
This is what I'm looking at when I open my XT.

(http://i50.tinypic.com/rh1gt3.jpg)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 18 June 2012, 20:01:44
Brown = Vcc
Red = Ground
White = Data
Black = Clock

:-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Mon, 18 June 2012, 21:31:17
Quote from: Soarer;616598
Brown = Vcc
Red = Ground
White = Data
Black = Clock

:-)

Thank you so much Soarer.  I was pulling my hair out and second guessing myself with these wire colors.  I would have soldered them all wrong.  I`m typing this up right now on my XT.  Thanks for the guide, your help, and the awesome coding!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 19 June 2012, 06:53:56
Quote from: AKIMbO;616661
Thank you so much Soarer.  I was pulling my hair out and second guessing myself with these wire colors.  I would have soldered them all wrong.  I`m typing this up right now on my XT.  Thanks for the guide, your help, and the awesome coding!

Haha, yeah, IBM (and Cherry) sure did pick some unintuitive colours! Good to hear of another success :-)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Paranoid on Tue, 19 June 2012, 13:13:59
Hi everyone. I'm also trying to convert XT to USB (IBM model F), but when I wire it like mentioned above I don't get any result (doesn't seem to connect at all) and the teensy gets really hot! Any idea's why this is happening? I've tried v0.996 and v1.0.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 19 June 2012, 14:36:57
Quote from: Paranoid;617116
Hi everyone. I'm also trying to convert XT to USB (IBM model F), but when I wire it like mentioned above I don't get any result (doesn't seem to connect at all) and the teensy gets really hot! Any idea's why this is happening? I've tried v0.996 and v1.0.

Ouch, that doesn't sound good at all - the Teensy shouldn't even be warm :-(

Where the wire colours on the same pins as in akimbo's pic?
Might you have (or had) a short circuit between any wires?
If you disconnect the teensy from the keyboard, does it still get hot?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Paranoid on Tue, 19 June 2012, 14:46:55
The wire colours are in the same order as in the picture (brown-red-white-black) with the tip of the connector facing upwards.
Could be that when I was testing it at first some wire pins might have touched, but now I soldered the wires so a short circuit now shouldn't exist.
If I connect only the teensy it doesn't get hot and I can still program it.

Does it matter where you connect the VCC and GRND? Because there are connections at the USB port and on the other side of the teensy board.. (I've tried both btw after the teensy wouldn't do anything)
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 19 June 2012, 16:21:46
Either Vcc and GND are fine. Hate to say it, but I think somehow the Teensy has died :-( There was someone else who had a short happen, a bit more dramatic... thread (http://geekhack.org/showthread.php?27401-Need-help-with-my-Teensy-Model-F).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Paranoid on Wed, 20 June 2012, 02:36:12
Damn that would suck! I also can connect it to my computer and run and load the LED blinking program like the guy in your link. But I did do something before, that you mentioned in that post, when I was trying to find the correct wires (and apparantly measured it wrong the first time):
"I don't know what dies (if anything) if you apply +5V and GND swapped over - and I'm not about to try it! " - So I did actually switch GRND and VCC..
Stupid that I can't test something else to see if it works! Is there any way PJRC has a return policy or would it mean that I have to buy another one? I can't seem to find anything on their website.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 20 June 2012, 07:44:09
Reversing Vcc and GND is more likely to damage the keyboard than the Teensy, and I'm not sure if it would explain why the Teensy gets hot. (The power comes straight from the USB port, so it doesn't pass through the chip).

You said measure... does that mean you have a multimeter?

A basic test for the Teensy would be to load my firmware (any version), and measure the voltage on the clock and data pins (with no keyboard connected) - they should show 5V, if not, the chip is damaged. Then connect both clock and data to ground - it shouldn't get hot, if it does the chip is damaged.

A basic test for the XT keyboard is similar, but first I'd measure the current the keyboard is taking when connected (just to power; leave the clock and data lines disconnected). It should be between 100mA and 125mA. Then measure the clock and data line voltages - clock should show 5V, and data should show 0V. Then I'd go back to measuring the current the keyboard is taking, and short the clock and data lines to GND - the current should increase, but only by a few mA. (If you can't read the current or aren't comfortable with that, then it's still worth testing the voltages on the clock and data lines).
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Paranoid on Wed, 20 June 2012, 13:16:45
Yes, I do have a multimeter :)

I did the test that you asked. Let me sum it up:
Basic test for teensy:
 - voltage on clock and data pins with no keyboard connected: both 5V
 - clock and data to ground: the teensy (or usb cable for that matter) does not get hot

Basic test for the keyboard:
 - Current of the keyboard (only with power): 0,024A = 24mA
 - Data and clock voltage: both 0V, power dropped to 0,8V
 - Current of the keyboard (clock and data to grnd): 0,097 - 0,1A = 100mA
 - Data and clock voltage: both 0,02V, power also 0,8V
In all these cases the teensy and cable get hot.

I would say that there is something wrong with the keyboard then?
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 20 June 2012, 14:26:21
I dunno... something doesn't quite add up :-)

I don't see how the Teensy would get hot when just power and ground are connected to the keyboard, and the keyboard is only drawing 24mA!

And not sure how enough current is flowing (somewhere) that the cable can get hot, without the computer just switching off the port and giving a warning.

I'm reluctant to ask you to do too many tests, since it getting hot could damage something more!

So, I'll have to think for a while :-)

Just to check - I'm imagining measuring the current goes something like this:

[attachimg=1]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Paranoid on Wed, 20 June 2012, 15:16:15
yes that's exactly how I did the current measurement. Maybe there's something wrong with the circuit board on the keyboard.
I'll see tomorrow evening if I can connect the teensy to another keyboard (with XT or AT) that doesn't work through a passive converter. If that works I'll probably know more.
Thanks for the help so far!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: REVENGE on Thu, 21 June 2012, 01:03:30
You could double check the wire config by using a multimeter and testing for continuity between the known XT pin-outs and the contacts on the internal connector.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Paranoid on Thu, 21 June 2012, 02:07:02
Hi Revenge,
I checked that in the beginning. The VCC, ground and data were correct, only the clock was on pin 3 instead of pin 1. Don't really know if that's a bad thing.
But I connected the teensy either directly on the circuit board pins or through the cut wires of the connector.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 21 June 2012, 06:30:15
Quote from: Paranoid;618482
The VCC, ground and data were correct, only the clock was on pin 3 instead of pin 1. Don't really know if that's a bad thing.

I think that means you were reading the pinout diagram backwards - it's drawn looking looking into a socket, so you need to mirror it when looking into a plug.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Paranoid on Thu, 21 June 2012, 07:15:04
hehe, that would explain why I got the grnd and vcc wrong the first try ^^ the pins and wires are correct then.

*update: so I hooked up my Cherry G80-0779H (that doesn't work through a passive converter) to the teensy and it works! With v0.996 it wouldn't work (just tried it real quick), but with v1.0 it does work :)
So the teensy isn't broken hooray!

Less hooray is that there is something wrong with the model F.. any clues as what could cause this?
There doesn't seem to be anything slighty burned on the circuit board. Although that doesn't really tell us anything. (the white stuff is from the sticky thing that's covering the board)
[ATTACH=CONFIG]53572[/ATTACH][ATTACH=CONFIG]53573[/ATTACH][ATTACH=CONFIG]53574[/ATTACH][ATTACH=CONFIG]53575[/ATTACH][ATTACH=CONFIG]53576[/ATTACH][ATTACH=CONFIG]53577[/ATTACH]
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 22 June 2012, 15:34:06
Sorry, I missed the update :-)

I'm still puzzled why the teensy and cable get hot, with the keyboard apparently only taking 24mA of current... that doesn't make any sense!

If it wasn't for that, I would agree that the keyboard has been damaged.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Parak on Sat, 23 June 2012, 22:26:54
For my second F122 refurbishment, I took some of these (http://www.ebay.com/itm/130682956953) that I had lying around and four pin headers with the posts removed bent slightly at the end:

[ATTACH=CONFIG]53798[/ATTACH]

Apply shrinkwrap:

[ATTACH=CONFIG]53799[/ATTACH]

Now that I think about it, this would have been better if I soldered the pins from the back instead. Oh well.
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 23 June 2012, 23:06:59
That's pretty neat :-)

Put the pins on the back you mean? But then you'd have bits sticking out on both sides!
Title: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Parak on Sun, 24 June 2012, 00:47:44
It would have looked a bit neater as the d0/d1 pins could have been flush, but then I guess there also would have been a slight worry with the teensy being all covered up by the heatshrink and the button being possibly permapressed..
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 23 August 2012, 14:45:16
I am probably just dense or incompetent, but here are 2 questions:

1. How to I get to the original article and instructions? I can get this thread, but not the article itself. I want to re-read the instructions from the beginning.

2. Can multiple Teensies be run simultaneously?

I have an F-122 with internal Teensy that I cut, wired, and installed last year, and have been running flawlessly since, including surviving a format and upgrade from XP to 7 with no additional work on my part (Wow!).

Now I have a new keyboard Teensy which I want to install in an outboard box with a socket to accept original cables. I would also like to upgrade to the latest firmware/software "just because" it seems to make sense.

First, if 2 Teensies are plugged in via USB, will my computer be confused? Should I use a conventional keyboard while setting up the new Teensy?

Second, what is involved in upgrading from 0.997 or whatever to 1.02?

Thanks!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: neocalm 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 (http://www.seasip.info/VintagePC/ibm_1397000.html)

2. The Affirmative 1227T keyboard (Unicomp)

http://www.seasip.info/Misc/1227T.html (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 (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
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: neocalm 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

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: neocalm 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
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: neocalm on Sat, 01 September 2012, 12:47:28
... well that ended pretty quick :(

(http://i49.tinypic.com/34g99ns.jpg)

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

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: N8N on Sat, 01 September 2012, 16:59:29
Rear defogger repair kit?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 01 September 2012, 17:46:29
Rear defogger repair kit?
Yeah. Or from electronics suppliers (example (http://www.rapidonline.com/Tools-Equipment/Conductive-Silver-Leitsilber-L100-3g-87-0781)).

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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar 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
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 (http://geekhack.org/index.php?topic=17458.msg339706#msg339706)).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar 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

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 :)

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: __red__ on Sun, 09 September 2012, 20:43:21
Another satisfied customer here - IBM Model F 122 key, 6110344 5 August 1986. :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar 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.

[attachimg=1]

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!

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 (http://www.ebay.com/itm/DIN-female-jack-Cable-Connector-6-Pin-Plastic-Handle-/270792631490?pt=US_Audio_Cables_Adapters&hash=item3f0c7fa4c2) or panel mounted (http://www.ebay.com/itm/DIN-Female-Jack-Cable-Connector-adapter-6-Pin-plug-panel-mount-solder-type-/270837493107?pt=US_Audio_Cables_Adapters&hash=item3f0f2c2d73)? (Those are just the first ones I found on ebay, there are probably nicer looking panel mount ones somewhere...).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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?

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 (http://www.pjrc.com/teensy/hid_listen.html) program? There might be some debug output that would help us figure out what's wrong.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar 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 (http://www.ebay.com/itm/DIN-female-jack-Cable-Connector-6-Pin-Plastic-Handle-/270792631490?pt=US_Audio_Cables_Adapters&hash=item3f0c7fa4c2) or panel mounted (http://www.ebay.com/itm/DIN-Female-Jack-Cable-Connector-adapter-6-Pin-plug-panel-mount-solder-type-/270837493107?pt=US_Audio_Cables_Adapters&hash=item3f0f2c2d73)? (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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 (http://www.ebay.com/itm/DIN-female-jack-Cable-Connector-6-Pin-Plastic-Handle-/270792631490?pt=US_Audio_Cables_Adapters&hash=item3f0c7fa4c2) or panel mounted (http://www.ebay.com/itm/DIN-Female-Jack-Cable-Connector-adapter-6-Pin-plug-panel-mount-solder-type-/270837493107?pt=US_Audio_Cables_Adapters&hash=item3f0f2c2d73)? (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):

[attachimg=1]

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!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 (http://www.seasip.info/VintagePC/5271.html#dongle), 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 :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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...

[attachimg=1]

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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 (http://deskthority.net/workshop-f7/xt-at-ps2-terminal-to-usb-converter-with-nkro-t2510-90.html)!!

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 (http://deskthority.net/wiki/Category:IBM_keyboards), and it may well have more now.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 (http://geekhack.org/index.php?topic=17458.msg349707#msg349707) 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 :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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...

[attachimg=1]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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 (http://geekhack.org/index.php?topic=17458.msg617942#msg617942) 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer 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.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs 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!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 22 September 2012, 09:06:32
Thanks! I'm still hopeful that it's not that much of a disaster though :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy 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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 24 September 2012, 10:44:11
True, I'm not forgetting it, but dfj would need quite some prodding to release code or hex, schematics, and diagrams!

He did write an article (http://geekhack.org/index.php?topic=21459.0) last year, but of course, there's no pics in it now :(
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Tue, 25 September 2012, 08:32:55
Fohat, just a heads up -- I got two 122-key Terminal Model M's from eBay. One has a cracked case, and one is in much better condition. I'm using the cracked one for exploratory purposes (extra keys, mistakes, practicing bolt-modding, etc.) -- so if you needed the controller or some other part of it for your project just send me a PM. I don't fully know the condition of the 'good' keyboard, but if I end up not needing the controller it's all yours.

My plan is to get the nicer 122 up and working, and trying to get it closer to the classic Model M layout (T-arrows keys, and replacing the Enter key to a wide version). Taking detailed pics and will post a full writeup. Thanks Soarer for the links to the DIN connectors on eBay; they're on the way. Now I just have to learn how to solder.  :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 25 September 2012, 09:25:16
Unfortunately, Model M controllers don't have the special capacitive sensing chip that the Fs do... we don't really need a pic to describe that! :)

In other news, I've bought Paranoid's dead XT to have a closer look at (but it could be a while before I have time to).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Tue, 25 September 2012, 21:06:16
I've got a Leading Edge DC-2014 and the internal connector has six wires coming out. Grey, Black, Red, Yellow, Brown, and a thick black with a ring terminal going to the steel switch plate. Can I assume the grey is white and to ignore the yellow and thick black one?

EDIT: So I guess I'm going to need to test with a multimeter for which is which unless anyone happens to know which wire is which for this board. Anyone who would like to help me, here's what the cable looks like. http://i.imgur.com/hfAE0.jpg
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 25 September 2012, 22:17:32
Yeah, I'm afraid they need to be properly identified. Either by using a multimeter, or by following traces on the PCB, if you can see them well enough.

It's important to identify power and signal ground - nearly all logic chips have power on these corners with one end identified by a cut-out, like this:

[attachimg=1]

Referring to your picture (which is looking at the bottom of the PCB and shows a 40-pin chip), ground will be on the top-right and power on the bottom-left pins of that chip.

My guesses are... the trace from the ground pin looks like it might go to the brown wire, but I can't tell for sure from the pic. The red wire goes to pin 4 of the chip, so is probably one of clock or data, and it also has a resistor on the trace - I would expect the other end of that resistor to be +5V, and it goes to the yellow wire. The other traces go off the pic :)

But don't take my guesswork as fact!! For one thing, there's an extra wire. It won't need to be used, but you need to figure out which one is the extra one!

Finally, clock and data can be determined by trial and error, since no damage will occur if they are swapped over.

That said, 5 minutes with a multimeter testing the cable would be quickest!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Wed, 26 September 2012, 13:57:28
Heres another pic focusing more on the traces. (http://i418.photobucket.com/albums/pp265/hi1405/2012-09-26_14-48-14_400.jpg?t=1348685566)

It seems the Yellow is definitely the +5V, Brown is ground, Red is clock / data. Now I've just got to find out what red is exactly, and which the other wire is. Here's also a pic of the top of the pcb showing the actual 40-pin and resistors, etc.

(http://i418.photobucket.com/albums/pp265/hi1405/2012-09-26_14-54-39_307.jpg?t=1348685775)

Thanks a bunch for all of the help by the way
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 26 September 2012, 14:19:13
LOL, I said DON'T take my guesswork as fact!!  :p

Still need a pic that shows the traces around that 14 pin chip.

If that's a buffer, and if the other two wires go to / come from it, then they are more likely to be data and clock than the red wire.

Actually, if that's an 8048 CPU, pin 4 is the reset pin, and we can ignore the red wire.

What markings are there on that 14 pin chip? We're looking for something like 7407, perhaps with some letters in the middle.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Wed, 26 September 2012, 14:45:47
Traces of the 14 pin ---> (http://i418.photobucket.com/albums/pp265/hi1405/2012-09-26_15-42-36_358.jpg)

The 40-pin is an 8048 and the 14 pin reads 6A1 8(New line)HD74LS125AP
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 26 September 2012, 15:40:26
Cool.

74LS125 is a tri-state buffer chip. Black and grey wires both go there, so they're data and clock. We can't tell which is which though, the circuitry is the same for both.

That chip also gives us confirmation that the yellow is +5v, since that fat trace that runs along the edge of the PCB goes to pin 14.

So I guess it's reasonably safe now to try hooking it up...
yellow ... +5V
brown ... ground
black ... clock?
grey ... data?

If that doesn't work, just swap the black and grey :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Wed, 26 September 2012, 15:50:00
Cool.

74LS125 is a tri-state buffer chip. Black and grey wires both go there, so they're data and clock. We can't tell which is which though, the circuitry is the same for both.

That chip also gives us confirmation that the yellow is +5v, since that fat trace that runs along the edge of the PCB goes to pin 14.

So I guess it's reasonably safe now to try hooking it up...
yellow ... +5V
brown ... ground
black ... clock?
grey ... data?

If that doesn't work, just swap the black and grey :)

Trying that now, Teensy just came in the mail so I'm getting to the soldering :) Thanks.

edit: fixed, I think.  alaricljs
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Wed, 26 September 2012, 16:33:43
Well my Teensy just arrived so I tried it out and got everything soldered up. Loaded the ATMega32u4 firmware, that's what the HTML files said to do at least, rebooted, and nothing. No key responses from the KB. I swapped black and grey and nothing as well. Dead in the water atm. Any ideas?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 26 September 2012, 17:04:11
Bah :(

Is it giving any output to hid_listen (http://www.pjrc.com/teensy/hid_listen.html) when you press keys?

Also, with hid_listen running, what gets printed when you connect the converter to USB?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Wed, 26 September 2012, 17:53:40
It gave no output when keys were pressed, I hadnt used it with the black and grey swapped the other way so im trying that now. It says
Listening:
wEE

remaining: FFFC


Keyboard ID: 0000
Code Set: 1

EDIT: Same thing with swapped wires. Either the board is dead or I just suck. I also managed to **** up the copper trace ring on the top side of the teensy so I had to solder to the bottom side for PD1. I should learn from the past and get a better Iron, a wick / pump, and good solder. There goes $20.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 26 September 2012, 18:14:25
Sounds like what is happening to me.

Could there be a bad batch of Teensys shipping recently?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Wed, 26 September 2012, 19:06:08
Sounds like what is happening to me.

Could there be a bad batch of Teensys shipping recently?

As much as I'd like that to be the case so I could get a replacement, All software detects it properly so unless it has problems with pinouts / ins and whatnot, it seems to be a problem on my / our end.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Wed, 26 September 2012, 19:08:40
Hi,

from my experience this error means that there's a problem with the connection between keyboarsd controller and Teensy. I can't say much more though.

While you are solving those problems I'd like to maybe motivate everyone by posting a few pictures of my Terminal Model M 122-key (German layout). As all the old attachments  from this forum seem to have been lost, I think we maybe need new ones.

The keycaps were partly taken from a Standard PC 102-key Model M that also came with several transparent keycaps.

Halvar

[attachimg=1]
[attachimg=2]
[attachimg=3]
[attachimg=4]
[attachimg=5]
[attachimg=6]


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 26 September 2012, 19:28:47
I also managed to **** up the copper trace ring on the top side of the teensy so I had to solder to the bottom side for PD1. I should learn from the past and get a better Iron, a wick / pump, and good solder. There goes $20.

Oh man, that really sucks... I think the track away from the PD1 pad is on the top side of the teensy :(
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Wed, 26 September 2012, 19:37:17
I really need a better iron. This 25w POS has been with me for far too long. I need something that's actually decent. Now I'm pissed.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Wed, 26 September 2012, 19:46:28
I also managed to **** up the copper trace ring on the top side of the teensy so I had to solder to the bottom side for PD1. I should learn from the past and get a better Iron, a wick / pump, and good solder. There goes $20.

Oh man, that really sucks... I think the track away from the PD1 pad is on the top side of the teensy :(


Do you know if there's any way to reprogram the code to look to PD2 instead of PD1? Or even if it is, can the Teensy not read / support a KB that way?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 27 September 2012, 05:32:42
It would be possible, but the problem is I don't want to add such a build to the release, because it would need documenting, maintaining, testing, etc, etc!!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: oTurtlez on Thu, 27 September 2012, 06:12:21
It would be possible, but the problem is I don't want to add such a build to the release, because it would need documenting, maintaining, testing, etc, etc!!

I'm guessing it's not as simple as going into the code and changing all PD1 to PD2? (I've never dealth with or looked at hex. I'm a Java / C person.)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Thu, 27 September 2012, 13:08:12
How would you know if a keyboards controller were faulty, broken?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 27 September 2012, 18:26:51
It would be possible, but the problem is I don't want to add such a build to the release, because it would need documenting, maintaining, testing, etc, etc!!

I'm guessing it's not as simple as going into the code and changing all PD1 to PD2? (I've never dealth with or looked at hex. I'm a Java / C person.)

It's written in C :-)

The point is, it would be fairly easy for me to mod it, but I don't want the ongoing work of keeping a modded version updated. As for modding the hex directly, that's probably not viable.

Now, about that red wire... I've looked again at the PCB pics, and I can't see any decent sized capacitor hanging off that line. (Normally, reset is handled inside the keyboard with a resistor and capacitor set up to hold reset low while power stabilizes). There's a 47pF, but that's too small, and there's also one of those on each of the clock and data lines, so I think that's just noise prevention. Sooo... I should probably make an output on the Teensy to drive it, to make sure the CPU gets reset properly.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 27 September 2012, 18:52:25
While you are solving those problems I'd like to maybe motivate everyone by posting a few pictures of my Terminal Model M 122-key (German layout). As all the old attachments  from this forum seem to have been lost, I think we maybe need new ones.

The keycaps were partly taken from a Standard PC 105-key Model M that also came with several transparent keycaps.

That is a properly sorted 122-key! The LEDs and relegendable keys really make it splendid :-)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 27 September 2012, 22:17:09
Now, about that red wire... I've looked again at the PCB pics, and I can't see any decent sized capacitor hanging off that line. (Normally, reset is handled inside the keyboard with a resistor and capacitor set up to hold reset low while power stabilizes). There's a 47pF, but that's too small, and there's also one of those on each of the clock and data lines, so I think that's just noise prevention. Sooo... I should probably make an output on the Teensy to drive it, to make sure the CPU gets reset properly.

From the IBM PC Technical Reference...

[attachimg=1]

So although the IBM keyboards didn't use the Reset output, it was there for keyboards to use if they wanted to. It was certainly there on the PC and XT, and presumably possibly on the AT (even though it says 'spare' in the reference), but then dropped on the PS/2.

From the IBM PC AT Technical Reference...

[attachimg=3]

From the IBM PS/2 Technical Reference...

[attachimg=2]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Wed, 03 October 2012, 09:51:05
Soarer, just wanted to give you a huge thanks! Got your converter working late last night. There's still a lot of work to be done, but it works. Will post details later. Thanks again Soarer -- awesome to get one of these old keyboards working again!  :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 03 October 2012, 10:50:12
That's good to hear! Let's have some pics :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 03 October 2012, 11:21:31
Paranoid's dead XT arrived, and I started examining it. Testing revealed a complete short circuit between power and ground, caused by this capacitor...

[attachimg=1]

It didn't occur to me before that a capacitor might've died; I expected the chips to die first. Pehaps the age of the capacitor made it weaker. A new one can withstand reverse voltage for quite a while - I tried to kill one with 5V and got bored!

Of course, since it was shorted, it triggered the over-current protection on the USB socket. That meant that the current readings were misleading, and I should've paid more attention to the voltages that Paranoid reported at the same time.

There's no markings on the old one to tell what value or voltage rating it is, but since it's just for power smoothing it's not important to get it exactly right. I chose a 47uF 16V, but 100uF would also be fine, as would a 10V rating. This kind with leads at each end is known as axial. I presume the original was an electrolytic, it certainly had polarity markings, and anyway that's a suitable type to use as a replacement.

So, here is the replacement 47uF 16V axial-leaded electrolytic in situ...

[attachimg=2]

It lives again! :D

So this might be good news for anyone else unfortunate enough to apply power in reverse. It's easy to test for, at least. But I think it's unlikely that this humble capacitor (or the other one smoothing power near the capactive sense chip) will always take one for the team and protect the chips.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: __red__ on Thu, 04 October 2012, 08:14:57
Any sign of bulging or other physical defecT?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 04 October 2012, 08:33:18
Not that I can tell. I'm sure it would've been more dramatic without the USB port's over-current protection!!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: page2pagepro on Fri, 05 October 2012, 13:54:31
Terminal keyboards usually have a 5 pin, 270 degree, DIN connector...
Show Image
(http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png)


Please note, for IBM Model M 1390572, the image above is for female socket, not male plug - they are mirrored (as Soarer stated). I used the link http://www.seasip.info/VintagePC/ibm_1390876.html (http://www.seasip.info/VintagePC/ibm_1390876.html)

Here's the pin-out I used (using original cable and Teensy 2.0)
(http://s15.postimage.org/7qpunexih/1390572.jpg)

PS: Is there 1.03 source code (C) available? I found some info similar @ https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb), but I am trying to map the keyboard to be more ANSI compliant. thx!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 06 October 2012, 10:46:57
Is there 1.03 source code (C) available? I found some info similar @ https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb (https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb), but I am trying to map the keyboard to be more ANSI compliant. thx!

That on github is hasu's great repo :)

There's no source code available for my converter (apart from for the tools). However, there is full configuration available using the tools in the v1.0 zip - you should be able to get it ANSI compliant easily. I just recently made a post on DT (http://deskthority.net/workshop-f7/xt-at-ps2-terminal-to-usb-converter-with-nkro-t2510-90.html#p78403) helping out another new user, which might be helpful to you as well.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 06 October 2012, 11:06:19
Recently I've been working with oTurtlez trying to figure out his Leading Edge DC-2014.

The main problem is that it runs very fast, with the clock only low for 5 microseconds...

[attachimg=1]

That's even faster than 8_INCH_FLOPPY's weirdo Monterey (http://geekhack.org/index.php?topic=17458.msg362823#msg362823)!

Here's an IBM PC keyboard for comparison, where clock is low for about 30 microseconds...

[attachimg=2]

Those traces are produced by running a small test program that prints a hex code every time the clock line changes state, giving an output like this for each key press or release:
Code: [Select]
D907 D95F DD67 DDBF E0A7 E0FF E3F7 E44F E737 E78F EA87 EADF EDC3 EE1B F113 F16B
F453 F4AB

The first 3 digits of each sample are a timecode (in microseconds), and the last digit is the state of pins PD0 to PD3. Passed through a Perl script to make a CSV, it's then plotted as an XY graph in excel.

Since it only samples when the clock line changes state, any changes in the data line have actually happened before they are shown on the graph.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: page2pagepro on Sat, 13 October 2012, 18:02:06
Anti-Ghosting with Teensy?

Using tool, http://www.microsoft.com/appliedsciences/antighostingexplained.mspx (http://www.microsoft.com/appliedsciences/antighostingexplained.mspx), I am coming to a sad conclusion that my IBM Model M 1390572 122 keyboard has short comings.

(http://www.microsoft.com/appliedsciences/images/MultiKeyDisplay/KeyboardDefault.gif)

My results are here: http://www.mmo-champion.com/threads/1185198-Keyboard-anti-ghosting-%28NKRO%29-thread?p=18740921&viewfull=1#post18740921 (http://www.mmo-champion.com/threads/1185198-Keyboard-anti-ghosting-%28NKRO%29-thread?p=18740921&viewfull=1#post18740921)

Any thoughts or options to avoid the ghosting?

thx!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 13 October 2012, 18:25:33
I'm sorry to disappoint you, but the Model M isn't NKRO and the converter can't change that :(
Title: Re: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: __red__ on Sun, 14 October 2012, 09:01:34
Those traces are produced by running a small test program that prints a hex code...

I think we as a community need to buy soarer a logic analyzer.  Given what he's given to the community it kills me to see him messing around with stuff like this when for fifty dollars or so we can give him something to make his life easier.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 14 October 2012, 10:55:49
Thanks red!

Actually, I've already got this one (http://dangerousprototypes.com/open-logic-sniffer/) with a wing (http://dangerousprototypes.com/2012/05/18/logic-sniffer-16-bit-input-buffer-wing-back-in-stock-2-2/)... here's some sniffing (http://deskthority.net/workshop-f7/replacing-an-8048-cpu-with-a-teensy-t4019.html#p78662)! ;D

But mostly for converter stuff I just use (http://geekhack.org/index.php?topic=14290.msg296052#msg296052) a two channel 'scope (http://www.picotech.com/entry-level-oscilloscopes.html). Its software has the really useful feature of storing loads of previous sweeps - so flicking through multiple codes to/from a keyboard is a doddle.

However... neither is much use if the oddball keyboard is 5000 miles away!! sctrace is something I can send out to get info, and just swaps in place of my converter code using the same pins - no probes, no extra wiring :D

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Sun, 14 October 2012, 19:34:00
Is my converter weird or something? It's working -- if press keys on my 122 Terminal keyboard and they come out (I'm using it now, in fact) -- but the configuring of remaps is eluding me. In the docs, it references what scan set my keyboard could be, but I can't seem to determine whether I'm using 1, 2 or 3. Running hid_listen opens a command window (running Win 7) and I see:

Code: [Select]
Waiting for device:
Listening:

Keypresses register and are listed as:
Code: [Select]
r1c    +04
rF0     r1C   -04
r32    +05
rF0    r32    -05
r21    +06
rF0     r21   -06

The above corresponds to pressing a, b, and c.

But nowhere do I see a code that represents what scan code my keyboard is using. I tried to remap some keys (my 122 keyboard does not have an ESC key) and tried to use the 'scas' to compile the 'legacy.sc' config file, loaded it using 'scrd' and it apparently remapped the NUMLOCK key to ESC. So, a little confusion here on how to remap.

According to the docs, I can remap based on the name of the key itself, but I'm trying to remap to the lefthand cluster of ten command keys, the upperleft most, to become my new ESC key, but I don't for the life of me know what that key was called.

Help please? I'm thisclose to having a completely kickass keyboard!




Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Mon, 15 October 2012, 00:12:11
@Krogenar:

To see the scan set, you'll have to have the hid_listen.exe window open while you plug the converter with attached keyboard into the usb port of your computer.  The detected scan set is displayed during the converter's startup phase.

For the names of the 122-key function keys: I posted the commented full config file of my Terminal Model M some weeks ago here:

http://geekhack.org/index.php?topic=17458.msg658161#msg658161

Here's some pictures of my keyboard with corresponding keycaps (German though):

http://geekhack.org/index.php?topic=17458.msg671233#msg671233

Maybe that helps you to get started, IMHO it's a better starting point than using legacy.sc for a 122 key Model M.

In Soarer's default setup (if you don't use any mappings), ESC is actually the upper lefthand key of the numeric keypad (!), at the place where you'd expect NumLock on a PC keyboard. NumLock is the key to the right of it. That corresponds more or less to what IBM used on some keybords (see Model 1397003 here: http://www.9999hp.net/keyboard/temp/ )

Escape on the upper lefthand key of the left function key block would be:

    EXTRA_F1   ESC


Soarer will hopefully correct me if I posted any rubbish, but I just got my own "kickass" 122key MM finished, so I went through all of this not too long ago...

Halvar

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 15 October 2012, 06:05:51
Thanks Halvar, that's all great!

Krogenar, you don't really need to know which scan set! The remapping is done from HID code to HID code. These are printed in hid_listen prefixed by '+' and '-', and correspond to the codes table.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: urbanus on Mon, 15 October 2012, 06:38:08
Works with my 83-key Model F XT -- typing on it right now!  :)

Thank you very much Soarer.  I really appreciate your efforts.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Mon, 15 October 2012, 08:51:19
@Krogenar:

To see the scan set, you'll have to have the hid_listen.exe window open while you plug the converter with attached keyboard into the usb port of your computer.  The detected scan set is displayed during the converter's startup phase.


Yes, I discovered that when I remove the keyboard cable and reinsert, that there's more information there. I see 'BF' represented in the identifying codes. I will post them tonight when I get home. I finally got the converter tucked into a project box, and it is horrifically ugly as I have no experience with electronics. I actually went to Maker Faire 2012 in New York just to buy some hobby kits to slaughter as I marched along the learning curve. I built a 'mousebot' that races in a very tight circle as a result, but can now solder to a limited degree.

I was inspired by an earlier posting of a converter build -- here's the image:
[attach=1]

That was posted on page 11 of this thread. I will post my own converter tonight. Then I will open the box of horrors inside it. It works, but I consider unplugging it to avoid a fire hazard.  ^-^

I opted out of the LEDs because I wasn't really sure how to wire up the resistors.

Oh, and when I disconnect the keyboard from the converter and reattach I get some weird behavior -- I get R06 errors sometimes (clock timing error from docs IIRC) and it registers keypresses but then repeats then ad infinitum, until I disconnect the converter as well. Not sure if that's usual or not. I will post some pics this evening.

For the names of the 122-key function keys: I posted the commented full config file of my Terminal Model M some weeks ago here:

http://geekhack.org/index.php?topic=17458.msg658161#msg658161

Here's some pictures of my keyboard with corresponding keycaps (German though):

http://geekhack.org/index.php?topic=17458.msg671233#msg671233

Maybe that helps you to get started, IMHO it's a better starting point than using legacy.sc for a 122 key Model M.

Halvar, thanks so much for that -- I will give it a shot. I commented out some lines from the legacy.sc, assembled that file into 'test-122.sca' and then imported that file. When the behavior didn't seem quite right (ESC key in odd place) I assembled and write an empty file, and that really didn't work. How would I 'undo' that original 'test-122' file that I read into the converter?

Eventually I'm going to go for a bolt mod and replace the vertical enter key and give it a full size left shift. Then it will more like a conventional Model M. Thanks again Soarer, for this great solution!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Mon, 15 October 2012, 08:58:24
If I recall from my reading of this thread.... you're not supposed to detach/attach the keyboard while the converter is live.  Any hot plugging is purely on the USB side.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Mon, 15 October 2012, 17:18:54
Ok, here we go. Keep in mind I have no experience building electronics. My goal was the photo from my previous post. The final result brings to mind this woman's attempt at artwork restoration:

http://www.huffingtonpost.co.uk/2012/08/23/before-and-after-pictures-woman-restores-christ-fresco-in-spanish-church_n_1824036.html (http://www.huffingtonpost.co.uk/2012/08/23/before-and-after-pictures-woman-restores-christ-fresco-in-spanish-church_n_1824036.html)
[attach=3]

 ;D

And now my version:
[attach=1][attach=2]

Notice the gigantic single screw holding down the perfboard. There were no copper pads on this board, so I just used wire leads. I have no idea how to properly do this, but it works. Am I going to burn my house down? Any and all tips would be greatly appreciated. I'm going to this of this as my first attempt. I have another Teensy, and enough spare parts to build another. What I wasn't sure about was how to properly finish the whole thing. If I were to try to stick it inside the keyboard case what would I do? Just tape it to the inside? Or wrap it up in electrical tape? Been reading electronics textbooks to learn more.

It makes me laugh to look at my goal and the end result, but for my first (well, second) project I'm fairly pleased.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 15 October 2012, 17:41:22
I commented out some lines from the legacy.sc, assembled that file into 'test-122.sca' and then imported that file. When the behavior didn't seem quite right (ESC key in odd place) I assembled and write an empty file, and that really didn't work. How would I 'undo' that original 'test-122' file that I read into the converter?

Hmm, that should work to clear things back to the defaults. You can check by running scinfo - if it reports that EEPROM Free is 8 bytes less than EEPROM size then there is no config loaded. You'll probably need to map ESC somewhere yourself in a new config.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Mon, 15 October 2012, 19:06:14
I tried using Halvar's config file -- worked beautifully. I'm trying to find some nice symbols for the keycap legends. Thanks so much!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Tue, 16 October 2012, 11:31:10
The painting restoration story is hilarious.  :D

Some symbol fonts I found and partly used:

http://www.dafont.com/stmedia.font
http://www.dafont.com/heydings-icons.font
http://www.dafont.com/heydings-controls.font
http://blog.guifx.com/2009/04/02/guifx-v2-transport-font/

(Sorry if this is becoming slightly offtopic...)

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Tue, 16 October 2012, 14:20:49
The painting restoration story is hilarious.  :D

Yeah, she started out trying to restore Jesus, and wound up making him look like Mr. Bill.

Quote from: Halvar
Some symbol fonts I found and partly used:

http://www.dafont.com/stmedia.font
http://www.dafont.com/heydings-icons.font
http://www.dafont.com/heydings-controls.font
http://blog.guifx.com/2009/04/02/guifx-v2-transport-font/

Ah yes, I was fooling around with the labels last night, will check these out! Thanks again Halvar, I salute you!
Oh, I noticed right before collapsing that there's a keypress function called 'APP' -- anyone know what it does, offhand? I'll just plug it in tonight and find out, but, was curious.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 16 October 2012, 15:06:45
Nothing exciting... it's just the Window's menu key.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Tue, 16 October 2012, 16:12:15
http://www.clker.com/clipart-15445.html
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 31 October 2012, 20:58:20
Since it only samples when the clock line changes state, any changes in the data line have actually happened before they are shown on the graph.

New improved version (sorry __red__!) now samples whenever any of PD0 to PD3 change, and at higher time resolution. Plus a hacked together MFC app to parse and draw them nicely without messing about.

All traces are from the release code for 'Z'...

IBM PC/XT:
[attachimg=1]

Leading Edge:
[attachimg=2]

IBM PC/XT:
[attachimg=3]

Leading Edge:
[attachimg=4]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Arbiter343GS on Wed, 07 November 2012, 22:39:45
I actually did this project about a month ago after I bought a 122 key model M off of ebay and it went perfectly. I honestly just have no clue how to remap it so I can make use of the extra keys. Could someone point me in the right direction?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 08 November 2012, 06:55:19
I have used Key Tweak, but most people seem to prefer Auto Hot Key.

I plan to try AHK when I rework my rig.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Arbiter343GS on Thu, 08 November 2012, 09:58:03
Ive been trying auto hotkey but I have no idea how to go about programming the extra keys as another key press like a windows key.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 08 November 2012, 10:24:54
Remappings are best done in the converter because then there's no restrictions (like autohotkey) or rebooting (like keytweak). (But I also use autohotkey for some things).

First things first... have you got the v1.0 zip as well the latest? (since it contains the docs and tools etc).

There's a few samples in the configs folder, and there's also a few in this thread (best to scan through backwards to find them).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 08 November 2012, 16:02:07
Do you remember that I went through hours/days of anguish trying to get a Teensy to work, once about a month ago and once about a month before that? I ran out of time each time and gave up for a while. I also ordered a new Teensy which I never took out of the envelope until today.

So, after lunch, I got out the old Teensy and wired it up every which way to my 2 Model F-122s - absolutely nothing.

Then, I cracked open the new Teensy, did the standard setup, and it worked right away on both boards!

Clearly, I have a bad Teensy on my hands. Whether it came that way or not, I don't know. I might have screwed it up myself, because at one point I did solder wires to 4 of the leads, as well as putzing around in several other ways.

Has anybody else gotten a defective Teensy, and should I, in all fairness, ask for a replacement?

I have bought a total of 4 units, and the people out there are so very nice I would not want to take advantage of them, but I really do think that this one was probably defective.

You said that if I wired it up improperly, it was likely to cook the controller on the keyboard and not the Teensy, and clearly I did not kill the boards, whatever I did, right or wrong.

So what do you think I should do?

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 08 November 2012, 18:01:48
That's a tough one to call!

I think the only likely way to electrically damage a Teensy when making this converter would be to connect +5V to one of the input pins (data or clock), or to connect ground directly to one of the LED driving pins. But there could be other ways, perhaps more indirect, to cause damage.

It's also possible to physically damage PCB pads and traces. That damage would usually be visible, although perhaps only with magnification.

They say that "all Teensy boards come fully assembled and tested", so I doubt they'll take one back.

I could put together some sort of 'self-test' program for a Teensy fairly easily, but it would require making a few connections on the Teensy. Nothing complicated, just joining PD0 and PD1 to a couple of other pins so input and output functions can be tested.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 08 November 2012, 19:50:56
I emailed "Paul" and he was nice but I am not going to push for a replacement. He is going to look up my order first.

I am pretty sure that all my wiring was correct, but the one boo-boo I might have made was when I had alligator clips on some of my leads.

It is possible that they might have flopped around and touched each other .....

My HUGE relief is knowing that I did not wreck the circuit boards on either of the keyboards.

$23 will put a new Teensy in my mailbox in 72 hours, but it takes months to find a Model F and almost the price of the Teensy in shipping alone. And that is domestic US.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 08 November 2012, 21:03:11
Yes, that is a relief. I've used about half a dozen Teensies, and had no bad ones. I haven't killed one yet either, but it's bound to happen at some point! :D

I made a few one-off versions that use the PD2 and PD3 pins instead, as part of improving the XT mode to handle oTurtlez Leading Edge. (The XT mode changes will only benefit those who have XT 'boards that don't currently work with the converter, and there will be a proper release soon that includes them, using the normal pins). I don't plan on making alternate-pin versions available regularly, but it might mean you can use that Teensy for something...  [attachurl=1].
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Thu, 08 November 2012, 21:14:56
I actually did this project about a month ago after I bought a 122 key model M off of ebay and it went perfectly. I honestly just have no clue how to remap it so I can make use of the extra keys. Could someone point me in the right direction?
it is actually quite easy. first, go to the DOCS folder and double-click on index.html. since you only need help re-mapping keys, go to the Config section and read the Command Reference. if you are starting with a 122 then you probably will only need to study/learn remapblock. you will also need to learn (or keep a cheat sheet handy) what the program expects you to name any keys you will be working with. you will find these in the Codes section. then open one or more of the .sc files in notepad and look at these as examples.

create your own sc file with a text editor. start with a comment line (line begins with #) that identifies what you are trying to do. add a line remapblock to start the remap block. list the keys you want to change and what you want to change each to. then close the remap block with the endblock command. save this file with a .sc extension.

Code: [Select]
# Billy's TSSK layout

remapblock
        F7     DELETE
        F8     END
        F9     PAGE_DOWN
        F10    LEFT
        F11    DOWN
        F12    RIGHT
        F13    F7
        F14    F8
        F15    F9
        F16    F10
        F17    F11
        F18    F12
        F19    INSERT
        F20    HOME
        F21    PAGE_UP
        F22    SCROLL_LOCK
        F23    UP
        F24    PAUSE
    FAKE_06    BACKSLASH
    FAKE_08    ESC
    FAKE_09    PRINTSCREEN
    FAKE_10    MEDIA_MEDIA_SELECT
    FAKE_11    MEDIA_PLAY_PAUSE
    FAKE_12    MEDIA_PREV_TRACK
    FAKE_13    MEDIA_NEXT_TRACK
    FAKE_14    MEDIA_VOLUME_DOWN
    FAKE_15    MEDIA_VOLUME_UP
    FAKE_16    APP
    FAKE_17    LGUI
endblock

open a dos prompt. navigate to your tools folder and drag&drop scas.exe to the command prompt, but don't run it yet. add a space to the end and then drag&drop your custom .sc file to the end of the command line - don't run it yet. add a space and then drag&drop the same .sc file - and then add a B to the end. now hit enter to run the command. this "compiles" your code. you will find it in the same folder as your SC file but with SCB as the file extension.

now that your custom file is compiled, you need to send that to the teensy. drag&drop scwr.exe into the command window, add a space, and then drag&drop your .SCB file to the end of the command line. hit enter to program.

test your newly remapped keys to verify that they are remapped.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 09 November 2012, 12:04:04
The last leg of this trip has been surprisingly difficult, but I now have my working outboard converter box.

It is set up to use my genuine IBM female DIN plug to fit the Model F 122-key terminal connection.

Soarer, thank you so much for making this possible!

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Fri, 09 November 2012, 14:03:25
Nice build fohat!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 09 November 2012, 14:27:00
Arrgh! I spoke too soon about my ecstasy.

My old build, F-122 with internal Teensy and Soarer's Converter v0.997 (I think it was) and KeyTweak to remap my keys, has performed admirably for a year.

So, in my happiness, and desire to have a clean update, I downloaded the latest version of KeyTweak and tried to remap my mostly "stock" F-122 running through the new converter box on v1.03.

I had forgotten the grief I had with the numpad. I would really love to have an ANSI-standard numpad (except with a 2nd "Escape" in place of "NumLock")

For whatever reason, the top row is "stuck" and will not let me change it. The left 2 keys act like they are remapping, but don't, and the upper right ("Pause", which I want to be "Numpad -") does not even seem to exist with KeyTweak.

Also, KeyTweak does not seem to recognize the left set of function keys, staying grayed-out altogether when I try to remap them.

hid_listen.exe returns a response to all these keys, but I cannot get the response you show in the OP to see what ID I have. When I run hid_listen, it just starts "listening" without returning any information first.

This board is a 6110347 and does not have DIP switches. Like my other one, there is only one way the controller will plug in.

I remember that last year I fooled around trying to find another way to plug in the connectors, looking for a type 1 or type 2 or something, but there was not other viable option.

Eventually, everything worked except "Pause" so I decided to tolerate it.

Thanks in advance if you can steer me towards a solution.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Fri, 09 November 2012, 15:13:42
hid_listen only shows the ID when the teensy is started. So to see it, unplug your keyboard, start hid_listen, and plug in the keyboard again.

Did you use a remap/confiig file for Soarer's converter at all?

If you didn't, you could start by writing one and try how far you can get without using KeyTweak at all.

I use my M-122 with a config file for Soarer's converter only. I posted the config file here http://geekhack.org/index.php?topic=17458.msg658161#msg658161
You'll probably want other mappings, but it's easier to start with a config file that already has all the relevant key names for your keyboard.

Halvar
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 November 2012, 15:55:14
Yes, the solution is to use a config file and do the remapping on the Teensy - wcass' guide above covers it pretty well (thanks Billy!), and of course we'll help if you get stuck!

Halvar is right, the ID is only printed when the converter is first connected to the computer. You might be thinking of the hacked in alternate mappings I provided before that were enabled by changing the ID - those are now obsolete (although they can be emulated by a config, e.g. legacy.sc, that's not ideal).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 09 November 2012, 16:32:03
Thank you.

When I hot plug the Teensy, I get:

wED rFE !!FEwED rFE !!FEwED rFE !!FE


The keys on the left (which I DO still want as an extra F1-F10, they are very handy there) return:

r05  "F1"
r06  "F2" etc
r04 
r0C
r03
r0B
r83  why is "F7" different?
r0A
r01
r09

I understand that I have to give up on remapping "Pause" to "NumPad -" but I had the other 2 remapped before.
This was touched on in post #112 and #114 but whatever happened?

I am working my way through the thread again to see if I can find out how to jumper my controller, if need be.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 November 2012, 17:05:30
You don't have to give up on remapping Pause if you do the remapping in the converter!

The codes prefixed by 'r' are as received from the keyboard, and are mapped once or twice before reaching the computer. First, the set 3 code is mapped to a USB HID code, which is printed with a '+' or '-' prefix. That mapping is fixed and can't be modified. Second, remappings from the config are applied, and the result is printed with a 'd' or 'u' prefix.

When looking for a code to remap, the one to look for is the one beginning with '+'. For the left-hand F1, you'll see +B7 in hid_listen. In the Code list in the docs, you'll see I've called that EXTRA_F1. So a line in a remapblock to remap that to a second 'normal' F1 would be:
    EXTRA_F1  F1

Similarly, remapping Pause to 'NumPad -' would be done by:
    PAUSE  PAD_MINUS

Really, so much changed when the config stuff was introduced with v0.997 that a lot of this thread is outdated (v0.997 was at post 294). TBH I can't remember much about the exact issue with Pause at posts 112/114, except that it got fixed :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Fri, 09 November 2012, 17:29:17
I don't know if there's a difference between the default mapping of an M-122 and an F-122. Probably not.

On my M-122, there is no "Pause" button any more in the default mapping (with version 1.03).

The upmost row of the numpad on my M-122 had these default mappings from left to right:

ESC
NUM_LOCK
SCROLL_LOCK
EXTRA_SYSRQ






Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 09 November 2012, 17:40:32
Finding the picture (not easy) that went along with my own post at #223 allowed me to place a jumper and set my keyboard ID to AFBF, but that does not seem to have helped anything much.

I am an old man with very little programming experience. I have 4 Model F-122s that I hope will satisfy my keyboard needs for life - which for me is a couple of decades, 3 if I am very lucky. I am not saying this to be funny or flip, I am quite serious.

2 of them have internal Teensy's and work great (although they are running something like version 0.996 at the moment, and I want to update them, if I dare), and 2 are "stock" to go with my clean little outboard converter. I want to build another outboard converter to mess around with XTs and the like, but this one is the "real deal" that I am serious about.

My dream would be to upgrade and program them all to behave exactly the same, and to last through my next several OS's. Dream on, Harry!

I would love to do everything "in the converter" but I don't even know how to open it. Unless I have step-by-step instructions I am just not "there" and my "there" is pretty embarrassing. For example, I have downloaded and extracted a bunch of files, but what exactly do I do with a *.sc file? I feel like an infant. But I am intelligent and can learn.

So, can you point me in the direction of where to learn how to set these things "in the converter"? I know where the Registry is and how to diddle with things there, although I do it seldom and with trepidation.

Thank you again.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 November 2012, 18:06:28
Halvar, that's true... since v0.997 that Pause mapping moved to legacy.sc. It never was in the first stage mapping though (it was in a kind of built-in config), and I can't remember why now!

101-key 'boards use set 2 by default. But they can be told to use set 3 instead - so that gives a defined mapping between between set 3 and set 2 for all the keys on a 101- or 102- key 'board. But the 122- and the 101- both use 84 for the top-right key on the numpad, so there must've been some other reason why I didn't make set 3 code 84 map to 'NumPad -' directly. There were a number of other constraints I had to consider as well, and for sure, when something had to give it was always going to be in the 122-key mappings rather than the others.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 09 November 2012, 18:27:39
fohat, to give a quick idea of the process of getting config 'in the converter', the steps are to:
1. edit a text file,
2. run a command line program (scas) to turn that text file into a binary file, and then
3. run another program (scwr) to transfer the binary file to the converter.
No registry danger involved!

To me, wcass' quick guide (http://geekhack.org/index.php?topic=17458.msg708153#msg708153) seems pretty complete, but I'm aware that I already know (far too much) about what he's describing to judge how useful it is to others!! If you can highlight the parts that fox you, I'll try to unfox :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Arbiter343GS on Fri, 09 November 2012, 22:33:12
I pretty much understand how the entire process works now, but Im stumped on how to get SCAS to assemble the SC file into a SCB file. Because I cant drag and drop items in my command prompt, it just shows a cancel sign as my cursor when i try to do it. Ive also tried opening scas in command prompt but I just dont get how to get scas to see my sc file(I guess is what Im trying to say), because I cant drag the sc file over the exe because the command prompt pops up for a split second and then disappears. Ive had a lot of experience with DOS but for some reason, Im just stumped.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 November 2012, 04:51:16
On Windows, the simplest way to do it without the drag-drop into the command prompt window is to extract the tools zip to C:\sctools, save your config (e.g. Arbiter343GS.sc) in the same directory as the tools, and then open a command prompt and type the following commands:
Code: [Select]
cd \sctools
scas Arbiter343GS.sc Arbiter343GS.scb
scwr Arbiter343GS.scb
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: zz on Sat, 10 November 2012, 09:04:17
hi!

and thank you so much for making this awesome project!
i can confirm that it works right out of the box with my model f.
brilliant documentation too, just wow.

since it worked so well from the start, i got cocky and resoldered the connection cable so that the teensy can be mounted inside.
well, bad idea it seems, because now it doesn't work anymore. even though the soldered contacts look better than what i had on the first try.

here are the symptoms:
- converter is found, scwr and scinfo work
- the orange teensy led flashes on keypress, but no keystrokes are sent
- hid_listen gets just "rFF" signals from every key

whats the problem here, is it just bad contacts or did i switch some pins?

regards,
zz
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 November 2012, 09:14:31
Data line is stuck high - hopefully just a bad connection :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: zz on Sat, 10 November 2012, 09:49:46
aw man and a support reaction time of ten minutes!
there is no hid manufacturer that can compete with any of this  :D
thank you sir, i'm heating up the soldering iron.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Arbiter343GS on Sat, 10 November 2012, 11:18:37
That worked, thank you for all the help!
And wow. I am definitely blind, I was scouring over the entire html file and I conveniently just now saw the (filename).scb part. Sorry, for any inconveniences.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 November 2012, 12:00:41
Yeah, scas takes two arguments, so dropping a file onto it in the GUI doesn't work.

How about - a batch file that runs both scas and scwr, using a default filename for the binary file so it can work by simply dropping a config file onto it...

[attachurl=1]

Put it in the same folder as the tools. If you like, you can make a shortcut to it (on your desktop or wherever) and that can accept dropped config files as well.

Also, it doesn't matter where you save your config then :D

Same thing as text in case attachments get screwed... or you are suspicious of .bat files  :))
Code: [Select]
@echo off
rem scaswr.bat - a drop target for config files

rem Change directory to the location of the batch script file (%0)...
cd /d "%~dp0"

rem Run scas with a default target filename...
echo Assembling %1...
scas %1 %1.scb
if errorlevel 1 goto end

rem Run scwr with that default filename...
echo:
echo Writing %1.scb...
scwr %1.scb

:end
rem Wait for a keypress so the output can be read...
echo:
pause
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 10 November 2012, 13:10:15
Thank you again, you always come through.

I was having a similar problem to Arbiter, not quite the same. And, it all worked, saying that it wrote HCMF-122.scb from HCMF-122.sc but there was no evidence of the second file with the "b" on the end existing in the directory (or anywhere, according to Search!).

Pause, still, stubbornly, will not allow itself to budge. That has always been my one sticking point but I suppose that I have no choice but to live with it.

Last, for some silly reason, F24 does not want to become "Mute" like I like it, but maybe KeyTweak will fix that after all.

Thanks again, I am hoping that this will be a long-term solution to my needs. I plan to use this one, as it is, for at least a week before I update my other boards and Teensy's.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 November 2012, 13:38:42
We can most definitely get it much better than having to live with any annoyances, but you have managed to pack quite a few baffling points into that post :))

So scas said it wrote HCMF-122.scb... did scwr then say it loaded it ok to the converter?
(BTW, the tools don't delete any files as they do stuff, in case you were wondering).

As Halvar reminded me earlier, Pause isn't there in the default mapping in v1.03. So I'm not quite sure what's happening with that in your case!

I will check later that F24 can be mapped to Mute, but I'm pretty sure it can.

I'm wondering if your previous KeyTweaking is now getting in the way of the converter's mapping - have you tried clearing things in KeyTweak?

Oh, and grab that batch file from my previous post - it's really quite nice being able to just drag-drop a config onto it, I'm liking it more than I thought I would :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 10 November 2012, 14:36:10
Sorry to make life difficult.

First, I had already reset everything in KeyTweak back to default, and I almost uninstalled it altogether, but I decided to keep it after all. But currently, nothing is KeyTweaked at all.

Clearly, the .scb file must exist somewhere, since it is working, but it just does not show in any of the directories where I have been working.

F24-to-Mute must have been a problem on the Mute side, so I set F24 back to F24 and it seems happy. I may try KeyTweak for that.
 
When I say "Pause" I am talking about the button at the top right of the NumPad. My F-122s came with a keycap that says "Pause" in that location, so I was going with that concept. Actually the key does not seem to do anything at all, in any case.

With the jumper I added last night, this keyboard is now an AFBF, so is that key really something else? Maybe I am trying to remap a non-existent key!

I use keyboardtest.exe and it has been very good. There are about 3 keys that it chokes on, such as Tab, but it shows pretty much everything on the 122 layout, unlike programs such as aquakey.

However, 2 keys that it does not identify are the center arrow key and the "Pause" or whatever that key really is. Pressing them does not produce any response at all. What else could they be?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 November 2012, 14:45:49
For the top-right numpad key, you need to remap EXTRA_SYSRQ, and the centre key in the cursors is LANG_4, I think.

IFF you started from legacy.sc, and left most of it there, then the ID might still be having an effect. Otherwise not.

The best way to see what codes you need to remap is to use hid_listen, spot the code starting with '+', and find it in the Codes list in the docs.

I'll check on MUTE in a short while, but first I need to go buy food and booze!!!

If you have known file extensions hidden in explorer, and .scb is something already, then the .scb would look like it's the .sc... could that be it? (Still don't know why it wouldn't find it with a search though).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 10 November 2012, 15:54:38
My hat is off to you once again.

And please, never let questions about keyboards get in the way of important things like food and drink!

I had been torturing myself over "Pause" when it was not really Pause at all. How foolish of me to think that what was written on a keycap was what was actually underneath ......

Now I am down to a final KeyTweak, re-creating a "Windows" key. It is not 0x76 "Menu" by any chance, is it?

So, is this "permanently" programmed into the Teensy, until I do something to re-set or re-program the unit?

And if I plug in another keyboard (similar but not identical) to this outboard box, should I expect the Teensy to remain happy or will I need to do it again?

Thank you again.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 November 2012, 16:54:26
All stocked up now  :cool:

If Pause hadn't been EXTRA_SYSRQ, it would've been PAD_MINUS... which wouldn't have helped much either  :)) Various 122-key 'boards have different legends anyway.

I think I've figured out the MUTE problem without even trying it... thanks to you mentioning MENU. There's a group of codes there, from EXECUTE to MUTE, that are defined in the standard but don't work with Windows (or at least don't do anything useful without extra software). I will clearly mark them somehow in the next docs update.

So, the MUTE you want is MEDIA_MUTE :)

And the three Windows keys are LGUI, RGUI and APP.

All of the names that aren't in italics are pretty much straight from HID documentation, so don't go blaming me for the quirks! (Not that you would :) )

Settings stay in the converter. In fact, that's usually true even if you load an updated hex, unless the settings become incompatible with the update. Obviously, I'll try to keep incompatibilities to a minimum, but it's bound to be necessary sometimes. Anyway, all you would usually need do in that case is recompile and reload your config.

Other keyboards should remain happy... or at least, we can make it so they are happy. This is where some of the 'if' commands could come in handy. Let's say you wanted to use it with the 122-key and also an 83-key PC/XT. Then you'd simply put:
  ifset set3
above the 122-key stuff, and:
  ifset set1
above the 83-key stuff, and:
  ifset any
above stuff you wanted to affect both keyboards.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 10 November 2012, 17:35:51
Sweet! Even better than I thought.

I guess that in England you don't have "blue laws" ie no alcohol on Sundays except in restaurants that also serve food. So, if you don't make it to the liquor store by closing time Saturday night - horrors - no drinking at home until Monday morning. And who would argue that Monday morning is a good time to drink ...... ?

Having the upper right key in the numpad as PAD_MINUS would be fine with me, that is what I want. I use the numpad and am happy with an ANSI layout, even more so replacing the now-useless NumLock with a very useful "Escape".

Now that I understand how easy and straightforward your technique is (now that it is sufficiently dumbed-down to a recipe) I have no use for KeyTweak anymore anyway. I will ditch it.

I always favor the simplest and most direct route, once I find what that actually is ....
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 10 November 2012, 18:05:58
No, nothing like 'blue laws', but big shops are limited to I think 6 hours opening on Sundays. So I'll have to get there before 4PM tomorrow instead of the rush round before 10PM I did tonight!

It can be a hurdle to get started with the config stuff, but now you know a little you can learn the rest as and when  you need it, one thing at a time. I get disappointingly few questions about macros - I guess either because people who get that far are simply fine with it, or because nobody gets that far :))
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Sat, 10 November 2012, 19:26:10
A big shout out to Soarer...I just want to say thank you again for this awesome converter code.  I just successfully converted my F-122. This makes two successful conversions now (an XT and this  F-122).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 10 November 2012, 19:42:38
Good Luck! What was that one dated, April 1984?

The oldest one I have is a 6110344 dated August 1984.

Was the foam mat in decent condition?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Sat, 10 November 2012, 19:47:30
Good Luck! What was that one dated, April 1984?

The oldest one I have is a 6110344 dated August 1984.

Was the foam mat in decent condition?


April 1984....Part # 6110344.  Foam mat appeared to be in decent condition and the metal barrel plate seems to be in good condition too (no visible rusting).  With that being said, I didn't really tear it down yet...I only cut, stripped, & soldered the cable onto the Teensy and programmed the Teensy.  Plugged it in and typed on it just fine.  I'm waiting for an extended time off work/school before I really get into the tear down and modification. 
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: zz on Sat, 10 November 2012, 20:50:48
damn. why did i touch it. it was running perfectly  :'(
after very carefully resoldering the wires both my keyboards seem to be dead!
hid_info only registers keyboard id 0000 and no keystrokes at all..
cable contacts are ok, and programming/restarting the teensy as well as executing the sc tools works fine.
hmmm.. any ideas?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 10 November 2012, 21:05:17
What wires?

As much as I have tinkered with other stuff, I have not touched any "internal" wires in my Model Fs.

The 2 internal Teensy's I installed were attached to the controller board with original connections by cutting the cable and soldering directly to the legs of the Teensy. That is nice, because it appears to be a sturdy, permanently attached USB cable.

Even that makes me a bit nervous, so my current project was to build an outboard box to keep the entire keyboard intact, including DIN plug.

PS - AKIMbO, you should consider yourself fortunate to get a super-early F-122 with decent foam mat and non-rusted plate. I have gotten a couple of "OK" mats but never a plate that wasn't at least a little rusted.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: zz on Sat, 10 November 2012, 22:10:18
i meant the cable.. i just wanted to make it shorter to fit inside.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 11 November 2012, 06:36:48
So it's worse than before? Not even the rFF codes now? :(

Most of the ways to damage things have been talked about recently, so you should be able to find those fairly quickly if you scan backwards through this thread.

At a guess though, it's possible that the Teensy PCB has been damaged as you removed wires - if the solder isn't totally melted, it can pull the pad on the top clean off, which breaks the connection to the trace. The pad on the bottom would likely still be fine, so resoldering would look fine too, but the traces for both PD0 and PD1 are on the top side :(
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: zz on Sun, 11 November 2012, 11:03:56
phew!
got it back to work on pd3 and pd4 with the alternate firmware a few pages back.
seems like i really damaged some teensy connectors..
i'm just glad i got my "BsDef"-button back  :D
thanks again.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 11 November 2012, 15:19:46
Shame about the damage, but at least it's working now :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Sat, 24 November 2012, 13:45:41
Mmmmm.....success.  ANSI layout.  Thanks again Soarer!


(http://i48.tinypic.com/25gxw74.jpg)
(http://i49.tinypic.com/hvcdo0.jpg)
(http://i47.tinypic.com/2eppzpc.jpg)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 24 November 2012, 13:53:18
Nicely done... and very clean!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Sat, 24 November 2012, 15:34:39
I'm having a bit of an issue with the converter.  When I run the command (scwr akimbo.scb) the command prompt spits out:

scwr: looking for Soarer's Converter: found
scwr: reading file failed
too short

I'm kind of stumped here. 

Forgot to mention, my notepad file with the config is akimbo.cfg.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 24 November 2012, 15:50:12
That's odd. No errors from 'scas akimbo.cfg akimbo.scb', presumably?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Sat, 24 November 2012, 15:56:26
^You know what I did wrong.  I didn't use type .cfg when i ran 'scas akimbo.cfg akimbo.scb'
 It worked perfect just now when I added. .cfg.   Man I'm embarassed. :-(

Yup, everything is working now.  Tenkey is reprogrammed perfectly along with F22-F24.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 24 November 2012, 16:03:53
Ahahahahahaha... haaaa.... :p
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Sat, 24 November 2012, 16:05:49
 :-[ Hehehehe
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 24 November 2012, 16:22:39
 :-*

(there is no bro-hug smiley, so...)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 24 November 2012, 21:03:11
Great job, AKIMbO.

I have been working on my instructions for a project similar to this, and have put it up here.

http://geekhack.org/index.php?topic=37753.0 (http://geekhack.org/index.php?topic=37753.0)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 27 November 2012, 11:46:30
Just when I thought it was safe to go in the water again .....

I lost my numpad. The keyboard is acting like "NumLock" is OFF, but I don't even HAVE a NumLock anymore.
I remapped an unused key to "NumLock" and it fixed the problem - but only temporarily - until I restart.

This is the Model F-122 running through an outboard Teensy. Everything else works fine, and all my remapped keys have kept their remappings, even the top row and right column of the numpad, it is just that the number cluster has reverted to the "NumLock OFF" configuration.

First I looked at software - all OK. And besides, according to the "Modified HID Code Set" there is no differentiation between "PAD_8" and "up" as far as I can tell.

Next, I went to Setup in the Boot Menu and it is set to boot up to "NumLock ON".

So I go to regedit and look under Keyboard to see that "InitialKeyboardIndicators" should be set to "2" but instead it is set to "0"

Whenever I change it and reboot, it resets back to "0" for some reason.

Edit: I solved the problem, in case it happens to any of you others:

There are 2 keyboard entries in the Registry.

Above, I referred to: HKEY_CURRENT_USER\Control Panel\Keyboard

But besides that one, there is also:

HKEY_USERS\.DEFAULT\Control Panel\Keyboard

In both cases, the setting should be "2" but in my Registry the second one must have gotten corrupted because there was a number that was at least 6-8 digits long (starting with 2)

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 27 November 2012, 15:06:07
What an odd problem, since the CURRENT_USER setting should override the .DEFAULT!!

BTW, that's a very nice writeup you've done on your mods :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 27 November 2012, 17:24:27
I think that .DEFAULT must have blown everybody's minds.

The choices were 0, 1, or 2, and it was holding a value of something like 2186573 (just making that up) so maybe they all said "Whoa! screw that, let's all just reset to 0 to be safe"

Otherwise, I was logged in as Administrator and changed the setting from 0 to 2. There is no "Save", but, as I understand it, regedit simply keeps the last value it had.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 07 December 2012, 15:12:16
PLEASE VOTE for my converter in the Deskthority Awards 2012: Best input device mod 2012 (http://deskthority.net/deskthority-awards-2012-f34/best-input-device-mod-2012-t4543.html).

The contenders are very strong indeed, so I hope we can at least make it a close race :D

Cheerleading is allowed... hint, hint!!! Sod the hint - post praise in the voting thread (http://deskthority.net/deskthority-awards-2012-f34/best-input-device-mod-2012-t4543.html)!!!


I'm also nominated in the Best deskthority forum contributor 2012 (http://deskthority.net/deskthority-awards-2012-f34/best-deskthority-forum-contributor-2012-t4547.html) category, but since I constantly troll 7bit I don't stand a chance :P So vote for bpiphany! :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 07 December 2012, 17:13:23
Everybody vote for Soarer.

Without him, I would never have known the joy I have experienced every day for a year on my wonderful Model F.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 07 December 2012, 17:32:27
At least I can't lose to thin ABS keycaps (http://deskthority.net/deskthority-awards-f28/best-input-device-mod-2011-t1633.html) again this year!!

That made me sad, but my converter wasn't anything like as complete then as it is now (with all the config stuff).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Fri, 07 December 2012, 19:41:00
Voted. Possibly twice.  ;)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 08 December 2012, 09:43:39
New improved version (sorry __red__!) now samples whenever any of PD0 to PD3 change, and at higher time resolution. Plus a hacked together MFC app to parse and draw them nicely without messing about.

IBM PC/XT:
Show Image
(http://geekhack.org/index.php?action=dlattach;topic=17458.0;attach=7102;image)


Leading Edge:
Show Image
(http://geekhack.org/index.php?action=dlattach;topic=17458.0;attach=7104;image)


Full source and binaries for the logic analyzer now posted on DT (http://deskthority.net/workshop-f7/simple-logic-analyzer-for-teensy-t4567.html) :D

(Sorry GH, but I don't want to maintain two threads, and this is more their cup of tea!)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: jwaz on Sat, 08 December 2012, 18:15:31
http://learn.adafruit.com/usb-next-keyboard-with-arduino-micro/overview

How cute, they thought they were doing something new.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 08 December 2012, 18:34:11
http://learn.adafruit.com/usb-next-keyboard-with-arduino-micro/overview

How cute, they thought they were doing something new.

Well maybe they are - it's a different protocol, after all!

Pains me to see bit-banging though, with interrupts disabled for at least a millisecond at a time by the looks of it. :(
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: precarious on Mon, 10 December 2012, 19:28:59
(http://i.imgur.com/aZLeo.jpg)

(http://i.imgur.com/5E1vV.jpg)

http://deskthority.net/wiki/File:G80-0777.pdf

I purchased a Teensy the other day to try and get an older terminal board up and running, but now I'm wondering if I may have to use it for this Amiga keyboard I just received, too.  The PDF I linked suggests that the model number (G80-0777) can switch between PC/AT, but I've been unable to get it working with my Windows 7 system using a simple Dolch-style converter to adapt the cabling to PS/2.  The PDF also lists the pinout for the keyboard so I don't think wiring should be an issue.  I'm wondering if despite having the ability to switch between AT/PC, I'll still need to use a Teensy-based converter?  Or is the keyboard just dead?

One thing I'm wondering:  there's an Amiga controller on the keyboard that isn't pictured on the PCBs in the PDF, though you can see the empty space for it -- think this is getting in the way?

First time doing this, so I figured this may be an appropriate place to ask. :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 10 December 2012, 20:13:57
Difficult to say what that extra ROM chip changes - it could be an entirely different protocol!

When you get the Teensy, you could load my simple logic analyzer (http://deskthority.net/workshop-f7/simple-logic-analyzer-for-teensy-t4567.html) onto it to see what the clock and data signals are doing... assuming it doesn't need input from the host to make it talk.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Tue, 11 December 2012, 02:15:37
Quite remarkable -- I have never seen an Amiga keyboard like that.

AFAIK, the Amiga 1000 was the only model with that kind of connector, but its standard keyboard looks quite different.

http://eab.abime.net/showpost.php?p=354888&postcount=4

The Amiga 2000 had a totally different layout and a DIN connector.

What kind of switches does this have, if I may ask?

Anyway, I don't think that Soarer's converter can presently be used for any Amiga keyboards, as they use their own different protocol. Here is some info:

http://www.kbdbabel.org/signaling/index.html

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: precarious on Tue, 11 December 2012, 07:47:55
The seller of the keyboard said it was for an Amiga 1000, so I suppose that makes sense.  Thanks for the links and info, this should be easier to play around with and figure out once I have the hardware in hand.  I'll be sure to report back with my results, or more likely, difficulties.  :)

Oh, the keyboard has MX Blacks.  Some of the keys, notably the windowed ones, are lasered with infill, not pad printed.  The rest are DS of course.

Edit:  Is this the best way to get a Dolch keyboard working over USB, too?  Or is there an easier way to go about that, such as replacing the controller on the board with a more recent Cherry edition?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 11 December 2012, 19:57:36
Sure, this would be a great way to convert a Dolch! I don't know if there are any controllers that would swap in... probably not, since the USB controller from a recent G80-1800 would likely expect a different matrix layout (at least Windows keys...). Other commercial converters like the blue cube would probably also work well... but without any fancy config options :D

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: metalliqaz on Tue, 11 December 2012, 21:48:57
Well this was an easy project.  Zero to typing with my Model-M with surprisingly little work, thanks to Soarer.
[attachimg=1]
Thanks man!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 15 December 2012, 07:58:44
Many thanks to everyone who voted for my converter :D

[attachimg=1]

Deskthority Awards - Best input device mod 2012 (http://deskthority.net/deskthority-awards-2012-f34/best-input-device-mod-2012-t4632.html)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: precarious on Sat, 15 December 2012, 08:58:55
the competition didn't stand a chance, congratulations :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 15 December 2012, 15:29:54
Great work, Soarer!

I guess that you have been working on this for the better part of 2 years, just goes to should how far ahead of the curve you are!

Thanks again!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Sat, 15 December 2012, 21:34:13
Congrats Soarer!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: precarious on Tue, 18 December 2012, 03:44:01
Received my Teensy and PS2 connector today, managed to get the Dolch working over USB with relative ease.  However, my old terminal board (some kind of rebranded WYSE) doesn't seem to be doing anything.  After running some of the tests mentioned, data appears to be dead.  I confirmed everything looked good in the test suite with the Dolch, so I'm assuming it has to be something with the terminal keyboard.  I saw elsewhere in the thread mention of terminal keyboards whose data was in relation to the clock signal of the original system, think that may be the case here?  Wiring should be fine, GND and VCC are both marked on the PCB and I swapped the clock/data wires around enough, plus, it was working with the Dolch.

Otherwise, what are my options for replacing the controller for an older WYSE keyboard?  I've seen various ones mentioned around the forum but I'm not really sure what the most suitable or compatible one would be here.  That Select button is looking pretty good for multiple layers, though, if everything can be made to work at some point.

I'll still have to see what I can do with the Amiga, not even touching that one for now. :)

edit: for the terminal keyboard, hid_listen only reports anything when i press numpad 7 -- only key on the keyboard that displays anything in the listen window ;0
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 18 December 2012, 07:22:01
Certainly some (most?) WYSE keyboards aren't handled by the converter, since they have very different protocols to the IBMs. If it doesn't have an AT or PS/2 connector it's very likely to be one of those. You could try out my analyzer (http://deskthority.net/workshop-f7/simple-logic-analyzer-for-teensy-t4567.html) hex to see what's actually happening on the wires, but it won't be much if the host is supposed to supply the clock. But then, why would numpad '7' output anything?!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 20 December 2012, 11:45:49
v1.10 is now available in the OP (http://geekhack.org/index.php?topic=17458.0)!


Nothing essential for most people, but it does have a lot of documentation updates which are worth having :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: samwisekoi on Wed, 02 January 2013, 13:38:41
Congratulations on the win!  Excellent work!

I am making a 60% "Model M", but since I can't imagine actually hacking on a real Model M, it will be made by slicing a Unicomp Classic 104 and exposing some of the secret keys on the main area.

Can I use your box and a PS2 Unicomp to output remapped scan codes via USB?  (The remapping is the important bit for me.)

Thanks in advance,

 - Ron | samwisekoi
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 02 January 2013, 15:41:23
Thanks!

Yes you can - that was actually the first goal of the converter, to handle the extra codes of secret keys :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: samwisekoi on Wed, 02 January 2013, 15:47:38
Thanks!

Yes you can - that was actually the first goal of the converter, to handle the extra codes of secret keys :)

Awesome!  I shall now go read all 21 pages of this thread and order Soarer parts and a Unicomp Classic 104 to mangle.

(I assume you are with me in not wanting to mangle an actual IBM keyboard!)

Thanks very much indeed,

 - Ron | samwisekoi
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: esoomenona on Wed, 02 January 2013, 15:52:25
I want to mangle an actual IBM keyboard. They're cheap and plentiful!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 02 January 2013, 16:53:46
Thanks!

Yes you can - that was actually the first goal of the converter, to handle the extra codes of secret keys :)

Awesome!  I shall now go read all 21 pages of this thread and order Soarer parts and a Unicomp Classic 104 to mangle.

(I assume you are with me in not wanting to mangle an actual IBM keyboard!)

Thanks very much indeed,

 - Ron | samwisekoi

Oh I don't care if you mangle a dozen Model Ms... just leave the Model Fs be!

And definitely don't worry about reading all of this thread!! At least use the thread contents pages that I added to the docs in the latest zip :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Thu, 03 January 2013, 18:38:36
Just downloaded the new version. Your documentation is even more insanely great than it was before!  :eek:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 04 January 2013, 19:40:07
Thanks! But really, I just add a bit here, a bit there, and still wonder what I've forgotten to add :-\
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 09 January 2013, 18:57:37
I see that the Teensy 3.0 is out, and looks like a significantly more robust board than the 2.0 for just $3 more.

I don't know anything about programming, or electrical engineering for that matter, I just follow recipes in the cookbook, but is it a trivial matter to revise the code for the 3.0, or a major chore?


PS - the folks at pjrc.com are just awesome!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Wed, 09 January 2013, 20:15:21
It's like the difference between PowerPC Macs and Intel Macs.  Which is to say, you can make it look the same on the outside, but the inside is completely different.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 09 January 2013, 20:25:44
It would be a chore to convert the code. But the real problem isn't the code, it's that the new chip runs at 3.3V. From a cursory glance at the datasheet it doesn't look like it has 5V tolerant inputs, so some external circuitry would be needed to adjust the voltages, even if it might be fairly simple.

The 3.0 certainly has more oomph, but it would be rather wasted on a keyboard converter :) The ATmega32U4 is far from the end of its life (as proved by the increasing number of breakout boards available) so I'm sticking with it - it's nice that code also works on a Teensy++ 2.0 for those cases that need a bit more EEPROM or RAM. Teensy 3.0 has disappointingly small EEPROM compared to its RAM, and only half that of the ++ (ref (http://www.pjrc.com/teensy/index.html)).

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: larsolav on Fri, 11 January 2013, 05:36:18
Hey. Great work on this converter. I'm using this for my 122 IBM Model M.

I have a couple of things I need help with. First, I want to know how you have counted the 10 keys on the left. Is it like this?
(http://dl.dropbox.com/u/11294170/1.jpg)

I'm also having problems with the key to the left of the enter key. I need it to output an apostrophe/asterisk, but it doesn't, and I don't know the hid-code for it so I can't remap it. :/
(http://dl.dropbox.com/u/11294170/3.jpg)
The key outputs this in hid_listen, so it's not the key that's broken:
r53 +32 d32
rF0 r53 -32 u32

The keyboard has a dipswitch on the back with all the switches in 0-position, if that makes any difference.

Thanks for any help :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 11 January 2013, 07:23:29
I use the method wcass described in post 562. it works great. Soarer gave you the complete list in his docs, but I never use that particular key, it gets covered up by the new ANSI-style "Enter" key that I install.

Would you really want the left F keys to go up and down rather than side-to-side? I use those F keys on the left more than the ones on top.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: larsolav on Fri, 11 January 2013, 09:22:05
Use the method wcass described in post 562

That works great. Soarer gave you the complete list in his docs.

Oh, thanks. Now it works  :)
The only thing is that I can't find the windows key in the list. Do I have to make a macro for ctrl + esc or something?

Do you really want the left F keys to go up/down rather than left/right?
Maybe I should have tried it out before asking about that :P

Edit:
I tried using the key called EUROPE_1 and remapped it to BACKSLASH. It worked perfectly :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 11 January 2013, 10:09:16
LGUI  &  RGUI  are the Windows keys.

Anybody would have guessed that, wouldn't they?

edit - forgot to turn on the "irony" notice
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: larsolav on Fri, 11 January 2013, 10:32:29
LGUI  &  RGUI  are the Windows keys.

Anybody would have guessed that, wouldn't they?
Apparently not me :P

Thanks for the help anyways  :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 11 January 2013, 10:34:39
I suppose if you know it's a modifier you could guess by process of elimination, but people don't necessarily know that!

Next time I update the docs I'll add 'Windows' into the description field for LGUI, RGUI and APP, so that Ctrl-F will find them :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Sat, 12 January 2013, 07:44:18
Well this was an easy project.  Zero to typing with my Model-M with surprisingly little work, thanks to Soarer.
(Attachment Link)
Thanks man!
It looks great. Can you list he material you used ?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: metalliqaz on Sat, 12 January 2013, 12:52:20
It looks great. Can you list he material you used ?

Hmmm... I can try.  I bought the parts at a local electronics shop so I don't have a record of names or model numbers or anything like that.  Lets see...

1. A USB cable, I use one by MiMic
2. A teensy 2.0 from pjrc.com
3. A project board
4. A project case
5. A 6-pin DIN "PS/2" Socket
6. Wire.  I used a multi-strand wire that really isn't quite appropriate, but it's what I had.
7. Screws.  I used 1/4" #4.  Something that can bite plastic.

The project board and the case were from some brands that I don't remember.  The important thing is just to find a few that fit together so you don't have to drill it and cut it to fit.  The other important thing is to make sure that the connections on the project board are made in the correct direction.  The one I wanted to buy was not appropriate because the board would have shorted the pins on the teensy.

If I had to do it again, I'd get proper connections for the PS/2 jack because trying to solder to those pins by hand is impossible to do in a good way.  I was so embarrassed by my hack job I lined up the camera so it wouldn't show up in the photo I posted.

The holes were drilled in the case using a wireless drill and a 1/2 inch wood bit.

Sorry I can't be more help.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Mon, 14 January 2013, 16:24:54
I just received a 6110668 today. Does somebody have a config file for it ? Thanks.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 14 January 2013, 16:34:18
Flash the Teensy according to the OP, and use wcass's technique in post 562 to assign keys.

Look in the Soarer_Converter_v1.10.zip file.

The documentation is now superb and will tell you everything you need to do.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 14 January 2013, 17:30:26
Halvar posted (http://geekhack.org/index.php?topic=17458.msg658161#msg658161) a 122-key config that might be a good starting point. It's also in the v1.10 zip as configs\Halvar.sc.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Mon, 14 January 2013, 19:24:15
Question about wiring. In your document it shows Clock connected to PD1 and Data to PD0. The pin assignment says SCL PDO and SDA PD1.  And AKIMb0 said he connected Clock to PF0 and Data to PF1 for the XT keyboard. Which one is corect ? Or it doesn't matter ?
tks
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 14 January 2013, 19:31:37
The document is correct :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Tue, 15 January 2013, 07:10:58
Halvar posted (http://geekhack.org/index.php?topic=17458.msg658161#msg658161) a 122-key config that might be a good starting point. It's also in the v1.10 zip as configs\Halvar.sc.

Yes, Halvar's config file got me in the right direction for my 122-key project. Glad it was included in the new documentation!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Tue, 15 January 2013, 18:21:02
Thank you Soarer. I'm typing on it now. I used Halvar's configuration file. 
As typing experience, it is identical to the F AT 84-key I have.
This 122-key 6110668 is in very good condition, and I got it for $25. I like it.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Tue, 15 January 2013, 19:01:38
I do have another terminal keyboard, a Model M. I kept it as a donor, but it is in such a good shape, almost new, that I might try to mod it with your converter. But, I don't like model m so much. Will see.
The effort of Sourer & co. is great, for so many high quality keyboards can now be used again. So many have been lost, but still lots of them will survive.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 15 January 2013, 19:17:16
After you are spoiled by the Model F, even a Model M is unsatisfying.

I don't understand the appeal of the M-122, though, the only real reason I did the F-122 mod was to get close to the ANSI (Model M) standard layout.

If I could get a capacitive switch Model M, I would look no further.

But, having said that, after a year I have to admit that I have really gotten used to the function keys on the left and 2 Escapes!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Tue, 15 January 2013, 19:42:16
If only was a way to make the switches lighter on Model M ! I like the layout and the construction, but they are too heavy for me. I'm still keeping my Model Ms, hoping that will be a way to mod those switches in the near future. 70-80 g is heavy.
When I touched an F AT, I was hooked, for this was exactly what I wanted a Model M to be. And I got it for only $5.
I have now two  F  PC AT and one F terminal.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Wed, 16 January 2013, 09:17:57
After you are spoiled by the Model F, even a Model M is unsatisfying.

Gah! Stop saying this sort of stuff! My addiction is already too far gone as it is! LOL!

Quote
I don't understand the appeal of the M-122, though, the only real reason I did the F-122 mod was to get close to the ANSI (Model M) standard layout.

I love having a lot of keys. Makes me feel important. Also, the thing looks like a tank. Still questing for a Cherry G80-2100 HDU, because I love the layout.

That said, the constant talk of how awesome the Model F is, compared to the Model M is eventually going to make me get one. I just don't really like the vertical Enter. But maybe someone will eventually offer up a modded one.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 16 January 2013, 09:23:33
Model Fs are far easier to modify than Model Ms... so there's really no excuse not to acquire one... or several! :cool:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Wed, 16 January 2013, 09:48:02
Quote
I just don't really like the vertical Enter. But maybe someone will eventually offer up a modded one.
I had the same preconceived idea about the vertical Enter. Now I'm typing on this 122-key model f and the vertical Enter doesn't bother me at all.
I feel no difference from the ANSI Enter. You should try first.
Model Fs have the identical exterior as the corresponding Model Ms, but they shine at the key switch level.
And it feels good, indeed, with so many keys. But an SSK Model F would be nice too. I don't know if somebody tried to cut a Model F board to a smaller size.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: metalliqaz on Wed, 16 January 2013, 15:48:29
They definitely did.  I'm too lazy to look it up...
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 16 January 2013, 16:07:58
I seem to remember an unsaver F, but I wouldn't want to try it.

The ISO-style Enter does not bother me at all - what I cannot abide is the small Backspace. I must make a lot of mistakes, and apparently I always go for the left side of Backspace to fix them.

The plethora of keys is nice, but I still have about a half-dozen that I have not assigned (F15-F19). I really like the function keys on the left.

Also, the incredible weight makes for an amazing keystroke experience, it is only about the keys - the board moving around on the desk is simply not part of the scenario (I do employ a rubber mat, too, of course). And I don't think the effect would be the same with a 1 kg keyboard, even if you glued it down to the desk.

PS - Krogenar - I took your advice and changed out the switches in my Joy mouse knock-off, and it made a big difference! I was pretty nervous, but it went well. I am sure that you can mod an F-122 if you can get your hands on one.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Sat, 19 January 2013, 07:23:35
Question for Soarer.
Does your converter work with an IBM 6052101 display writer for 3187 ? The real question is what protocol is used.
Thank you
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 19 January 2013, 08:43:21
No :( The problem is that they don't send release codes for all but a couple of keys. I started on a project to replace the CPU with a Teensy (http://deskthority.net/workshop-f7/replacing-an-8048-cpu-with-a-teensy-t4019.html) (but it's stalled with what could be noise problems causing KRO to be poor). I guess the most surefire approach would be to use a reprogrammed 8048 CPU, but that's not trivial and it would still need a converter to USB as well.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hubbert on Fri, 25 January 2013, 05:51:25
Is it possible to connect one keyboard to two computers using two Converters?  If so, then what's a good way to disable one converter at a time from sending keystrokes: it only needs to maintain the USB connection.  My quick thought is to use diodes on the power connection and maybe something on the grounds (just hope they're the same since the computers are connected to the same AC outlet?), but the clock & data connections are potential problems.

I have tried USB KVM switches, but the handshaking takes too long, and usually after about 5 swaps my Windows box would stop recognizing the keyboard.  I found a manufacturer of ultra high performance KVM switches for professional audio/visual media uses, but they either didn't list a price or I got the impression that they cost $5000 or so.  I don't need to switch monitors, and I don't really need to switch pointing devices (in a pinch, an extra Marble Mouse trackball doesn't take up too much space).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: kishy on Wed, 30 January 2013, 12:48:24
For information's sake:
My previously reported success with the converter 'surviving' from cold boot all the way through to the Windows 7 desktop on my ThinkPad W520 is no longer the case - one or two firmware updates ago (for the W520 - UEFI/BIOS), it started killing the converter during boot.

This seems to be intermittent/inconsistent though as it sometimes works, but seemingly does not work during POST to enter setup. I haven't done any comprehensive testing, and it could well differ from docking station 2.0 ports to built in 2.0 ports to 3.0 ports...
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 01 February 2013, 09:55:14
Is it possible to connect one keyboard to two computers using two Converters?  If so, then what's a good way to disable one converter at a time from sending keystrokes: it only needs to maintain the USB connection.  My quick thought is to use diodes on the power connection and maybe something on the grounds (just hope they're the same since the computers are connected to the same AC outlet?), but the clock & data connections are potential problems.

I have tried USB KVM switches, but the handshaking takes too long, and usually after about 5 swaps my Windows box would stop recognizing the keyboard.  I found a manufacturer of ultra high performance KVM switches for professional audio/visual media uses, but they either didn't list a price or I got the impression that they cost $5000 or so.  I don't need to switch monitors, and I don't really need to switch pointing devices (in a pinch, an extra Marble Mouse trackball doesn't take up too much space).

That's an interesting idea, and I think it could work. Connecting grounds ought to be fine, and as you say, diodes should be enough to prevent problems on the power line and allow it to be powered from either converter. Switching just clock might be sufficient, but since DPDT switches are just as cheap, you may well switch both data and clock.

The main thing is that each converter will need to talk to the keyboard when it (the converter) powers up, so it knows what kind of keyboard it is. You'll just have to remember to switch it accordingly when powering things up!

That said, it would be an experiment, and I can't say for sure that it will all work :)

I use an Aten CS1784 4 port KVM that works very well, but of course in its normal mode it can't deal with NKRO or any of the extra interfaces on my converter. It can be set to switch the keyboard as a general USB device, but then that means a delay as the OS processes the new device(s) it sees when switching. It was about $200, so if you don't need to switch monitors, it would be overkill!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 01 February 2013, 10:03:24
For information's sake:
My previously reported success with the converter 'surviving' from cold boot all the way through to the Windows 7 desktop on my ThinkPad W520 is no longer the case - one or two firmware updates ago (for the W520 - UEFI/BIOS), it started killing the converter during boot.

This seems to be intermittent/inconsistent though as it sometimes works, but seemingly does not work during POST to enter setup. I haven't done any comprehensive testing, and it could well differ from docking station 2.0 ports to built in 2.0 ports to 3.0 ports...

Hmm, not much to go on, and more difficult if it sometimes works, sometimes doesn't :(

Is that using my latest firmware, or at least the one that has the USB compliance fixes (v1.03)?
(I didn't fix anything that seemed likely to cause such problems though).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Fri, 01 February 2013, 18:03:06
Soarer, kishi already pointed out problems with the converter at boot phase, but I still want to ask. It is possible to make the keyboard available at boot time ? This would be desirable for Linux, for instance, when you have to select the image you want to load. I played with it and it did not work. The keyboard is recognised only after the boot.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 01 February 2013, 18:52:16
It should already work in BIOS and during boot, on pretty much everything. As long as any perfectly standard USB keyboard would, of course. Kishy is just adept at finding problem machines!

I'm not sure exactly what the Linux bootloader does for USB keyboards... I guess it might use a simlar mechanism to BIOS. But if it's a problem with my converter, I'm surprised that nobody has mentioned it before. (On the other hand, if more people have a problem, it will probably make it easier to fix!)

What Linux bootloader and version are you using?
Does the converter work to get into, and in, your BIOS? If not, what's your machine, and what BIOS does it use?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 02 February 2013, 12:08:31
Just noting a report of a kernel panic in OpenBSD on a Samsung n130 netbook.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 08 February 2013, 12:45:43
I think I have mentioned this before, but, again, this morning, I wired up my "universal" Teensy outboard converter, and it does not recognize a PS2 keyboard.

Having done the Teensy thing half a dozen times, I am pretty good at it. But, with my final Teensy, I want an outboard box with female PS2 connector, so I can use it for "everything" with various adapter plugs.

It is built, continuity checked properly on all 4 leads (the mini-DIN-6 has 6 total - 2 "extras" that I ignored), and programmed using teensy.exe.

The computer acknowledges that the USB device is connected, and the programming routine seemed to complete successfully.

However, when I plug in a PS2 keyboard (I have tried it with a Dell AT101 and an Alps brand board, both of which work properly, otherwise) I get nothing. I have tried rebooting in a couple of different ways, and hot-plugging the USB from the Teensy before and after, all the usual combinations. Also, I learned this before, there is no other Teensy connected, I am doing this after a reboot with a PS2 keyboard in the PS2 connector to the motherboard.

Is there some other trick to this, or what?

I know that it is pointless to use the Teensy when an ordinary adapter would work, but am I missing something here?

At the moment, the 2 XTs (for which I actually want to use this thing) are dismantled, so are not available for alternate testing.

Thanks!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 09 February 2013, 13:47:11
I can't remember if you have mentioned this problem before! I remember the other outboard, with the real IBM terminal connector, which I think worked in the end...?

The order of connection should always be keyboard to Teensy, then Teensy to computer, so that the Teensy can talk to the keyboard as soon as they are powered up.

Do the LEDs on the keyboards flash just after the Teensy is connected to the computer? That would at least indicate that they were getting power OK.

Does hid_listen say anything when the Teensy is connected to the computer? Or when you press keys?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 10 February 2013, 16:51:57
Thank you for your reply.

I never had a problem with the official Model F terminal connector, it worked great as soon as I got it all hooked up properly.

This is about my 3rd or 4th attempt at this one, I try it, give up, set it aside for a month or 2, and come back.

Going through your steps, I realize that it is completely dead - no LEDs, no hid_listen.

Twice, in recent months, I have had problems with switches and cables, formerly never an issue. Although the continuity checks out, I have a sewing needle soldered to one of my probes, and I am starting to wonder if my female PS2 plug is the problem. Perhaps I can stick the needle farther back into the socket and find a connection, but one or more of the pins on my keyboard cable can't hit it?

Tomorrow, or sometime, I will replace the receptacle pigtail and see if that is it. Otherwise, I am stumped.

The computer sees the Teensy and reports it as operating properly, continuity checks out all around, and the keyboards are OK, so the socket is about the only thing I can't verify.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 10 February 2013, 18:02:03
Yes, it does sound like a problem with the connector. You'll hate me for saying it, but could it be wired wrongly, with the connections mirrored? It would explain the symptoms.

Do you get some output to hid_listen when plugging the converter in without having any keyboard connected to it?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 10 February 2013, 18:19:35
Can't mess with it until tomorrow, but if I wired it wrong I will feel like a monumental dolt! :'(
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 10 February 2013, 18:29:26
I can't think of anything else that would explain zero output to hid_listen (since you already know to only have one Teensy connected)... but only if hid_listen output is working when no keyboard is attached. The logic being that the keyboard gets reverse power, tries to draw too much current, and the USB port shuts down in response. I could be wrong of course!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 11 February 2013, 11:16:04
I re-worked all my wiring, and the keyboard LEDs do flash when the USB is plugged in, so I know that power is getting through, but that is all.

The computer chimes and reports that the device is connected or disconnected, and is working properly.

hid_listen also reports the device being connected or disconnected, and "listens" for the device for a minute or so with a string of dots marching across the screen.

But it never "hears" any keystrokes from the keyboard.

I have re-programmed and rebooted the Teensy a couple of times, and also rebooted the computer.

And, hid_listen gives the same response without the keyboard plugged into the Teensy as with it.

Got any more ideas?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 11 February 2013, 15:13:25
I re-worked all my wiring, and the keyboard LEDs do flash when the USB is plugged in, so I know that power is getting through, but that is all.

The computer chimes and reports that the device is connected or disconnected, and is working properly.

hid_listen also reports the device being connected or disconnected, and "listens" for the device for a minute or so with a string of dots marching across the screen.

But it never "hears" any keystrokes from the keyboard.

I have re-programmed and rebooted the Teensy a couple of times, and also rebooted the computer.

And, hid_listen gives the same response without the keyboard plugged into the Teensy as with it.

Got any more ideas?

OK, power is good.

Does hid_listen ever actually say 'Listening:', which comes after the dots have stopped?

Without a keyboard connected, we'd be hoping to see something like this (although without any config loaded it would be slightly different)...

Code: [Select]
Waiting for device:..........................
Listening:
wEE

remaining: 0041
41@0008 remaps !set
layerdefs: 00
max_layer: 00
total_macros: 00
alloc ok.


Keyboard ID: 0000
Code Set: 1

I can't think what would prevent that, if the Teensy was programmed with the converter code correctly (and only that one converter was connected).

Getting it programmed shouldn't need lots of reconnecting, or reboots of the computer. You can run hid_listen, run the Teensy loader, and connect the Teensy (without keyboard attached) - in no particular order. Then just use the reset button and the Teensy loader controls to get it programmed and talking to hid_listen. If it doesn't work, pressing the reset button is usually enough to be able to try again.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 18 February 2013, 20:39:26
Thank you for your patience.

I gave up on that problem, maybe I will revisit it in another month (as I have, multiple times, already). But, to answer that question, after waiting for device, and listening, nothing further happens. If I unplug it, and hot plug it, it waits, and listens, again, to no avail.

Here is my new problem with my F-122 and Teensy. For no reason, (well, the only thing I did was to):

hot plug a iMate ADB-to-USB converter and working AEK2 to the USB port on the front of the computer, for testing, with the F-122/Teensy  running as usual. The Apple tested good and that was that. I unplugged it.

Now, I have lost my numpad, just as if I had pressed the "Numlock" button, which has not even existed for a year. I rebooted and went into BIOS, in expectation of setting "Numlock on at Boot" but apparently there is no such option on recent Gigabyte motherboards. The other keys I remapped around the perimeter of the Numpad still operate properly (obviously, since there is no Numlock any more!) but numpad 7 is "Home" no matter what I try to do.

For the time being, I suppose that I will try to re-map an unused key to Numlock so that I can press it if I need to. What is going on?

Finally, is there any advantage to remapping the Numpad, for instance, there seems to be a subtle difference between "3" and "numpad 3" ?

Thank you.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Mon, 18 February 2013, 20:46:39
Are you running Windows 7?  The on screen keyboard (Control Panel -> Ease of Access) has an options button that toggles num lock.

The 3 and the numpad 3 are 2 distinctly different keycodes.  You can only do extended Alt-codes with the numpad.  You can only get symbols via the number line.  Num Lock doesn't interact with the number line in any way.  Any advantage would be for you to determine based on your usage.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 18 February 2013, 22:25:26
I have no further ideas on standalone converter problem; there's just not enough clues :(

Apparently num-lock on Win7 ends up 'off' at boot if various registry settings get non-matching (or wrong) values set in them, see the answer here... http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/want-to-set-num-lock-to-be-on-and-active-at/7b48ae6f-fa9c-4bc2-8359-81e0c5e5d6a2 (http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/want-to-set-num-lock-to-be-on-and-active-at/7b48ae6f-fa9c-4bc2-8359-81e0c5e5d6a2).

I don't know why that would get shot by plugging in an iMate! I must admit my first thought was that you'd simply pressed 'clear' on the AEK when testing it, which (I think) gets mapped to num-lock by the iMate... but I don't think that would still affect anything after a reboot.

On-screen keyboard sounds like a good solution if it's only rare cases when you need to toggle num-lock.

Although I don't tend to use num-lock much, I do keep it mapped somewhere. You could put it in a macro if you don't have any single keys left you could use.

If you really only ever use the numpad for numbers, and never with any modifiers pressed, then I suppose it shouldn't really make any difference which codes are produced by it.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 19 February 2013, 09:30:01
Good answers, both.

After sleeping on it, I realized that I am an idiot.

I use keyboardtest.exe for testing, (I like it better than any of the others and it finds all the keys on the 122) and clearly I had tested Numlock on the AEK2.

BIOS was simply remembering that, so I rebooted with a standard PS2 keyboard and pressed the Numlock a couple of times and now I am back in business.

Still, Gigabyte should allow a "Numlock on at Bootup" selection in BIOS, I know a lot of people don't use it, but a lot of us do.

Thank you.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 19 February 2013, 11:39:48
Interesting... it must be Windows 7 remembering the num-lock state. I don't know if Vista did that as well, but XP certainly doesn't. So we learnt that from this :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Tue, 05 March 2013, 18:15:20
I finally got off my butt and got the layouts on this F122 and my AT the way I want.  Thanks to the documentation, it was fairly straight-forward.  LANG_4 was the only tricky bit on the F122.  Perhaps an alias or at least a hint in the doc would be helpful.  :)  The AT is from wcass, so that one is mainly some tweaks to his.

FWIW, they are attached.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: metalliqaz on Tue, 05 March 2013, 18:25:53
Where do you get that keyboardtest.exe?  I googled it but there seem to be many different "shareware" tools that go by the same name.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 March 2013, 18:30:27
rknize - Thanks for posting configs :) Is it OK if I include them in the next release zip?

Re. LANG_4, I won't add a specific hint, but I will try to make clearer the method for finding out what the codes are... it has been mentioned before (http://geekhack.org/index.php?topic=17458.msg601130;topicseen#msg601130), but since hid_listen output is detailed on the Trouble page, it's not obvious that it has 'regular' uses as well!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 05 March 2013, 18:31:21
keyboardtest.exe

is a horrible thing to Google, you would think that it would turn up exactly as you typed it, but no .....

I did not know that anything except photos could be posted here directly.

This is the one I like to use:

PS -

I forgot to mention, the program has a few odd quirks (who doesn't?)

It ignores "Tab", it locks up after "F10", and it respects "CapLock"

If it goes funny during or after "F10", "Alt" or "Spacebar" you should use your mouse to highlight whatever is in the dialog box, then when you press a key it will go back to normal.

These are not bugs, they are "idiosyncrasies" - HAHA
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Tue, 05 March 2013, 18:53:42
rknize - Thanks for posting configs :) Is it OK if I include them in the next release zip?

Re. LANG_4, I won't add a specific hint, but I will try to make clearer the method for finding out what the codes are... it has been mentioned before (http://geekhack.org/index.php?topic=17458.msg601130;topicseen#msg601130), but since hid_listen output is detailed on the Trouble page, it's not obvious that it has 'regular' uses as well!

That would be great.  Even dropping a hint in the comment column of the codes page would help.  It's a common enough scenario, I think.  Perhaps some "cook books" for common projects would be helpful as well.  It would have saved me multiple look ups in multiple keycode tables on the Internet if I just knew which switch translated to which soarerese HID code for the mapping table.  :)

Feel free to include them.  I left some comments in the remapblocks.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Wed, 06 March 2013, 03:50:58
I posted my M-122 configuration in this earlier post, and it's also in the newest distribution from Soarer in a file named halvar.sc

http://geekhack.org/index.php?topic=17458.msg658161#msg658161

I put a lot of comments in it, also about LANG_4, numpad and the other keys on terminal keyboards, so I'm sorry that you had to find it all out for yourself again.   :'(

Halvar

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Wed, 06 March 2013, 07:21:38
I finally got off my butt and got the layouts on this F122 and my AT the way I want.  Thanks to the documentation, it was fairly straight-forward.  LANG_4 was the only tricky bit on the F122.  Perhaps an alias or at least a hint in the doc would be helpful.  :)  The AT is from wcass, so that one is mainly some tweaks to his.

FWIW, they are attached.

Rknize, how would you describe typing on a F-122 (makes it sound like a fighter jet, LOL) -- awesome?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 06 March 2013, 07:34:06
The large Model Fs are perhaps not quite as loud as the small ones, just because of greater mass of the entire assembly.

The 122s and XTs have the metal back plate, while the ATs are plastic all around. The sound is as different as the feel, in comparison to the M.

Sound is not my big thing, it is feel. I have flossed almost all of my buckling springs, and it is a big help in the "annoyance" department.

While the Model Ms are already less resonant than Fs, with the one-piece plastic barrel (aka chimney) assembly vs the heavy F front plate, the metallic resonance of the Fs is smoothed out very nicely by the floss, without being unnecessarily deadened.

The 122 and XT have 3 different steel plates (front barrel plate, the back plate of the switch board, and the case back) so there is a lot of mass and deep resonance working for you already.

The single metal back plate of the M is isolated from the rest of the assembly by the rubber mat, and buried in the interior of the case.

For me, the deep underlying resonance remaining, with the upper register attenuated by the floss, is the perfect combination for sound.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 March 2013, 08:04:04
rknize - Thanks for posting configs :) Is it OK if I include them in the next release zip?

Re. LANG_4, I won't add a specific hint, but I will try to make clearer the method for finding out what the codes are... it has been mentioned before (http://geekhack.org/index.php?topic=17458.msg601130;topicseen#msg601130), but since hid_listen output is detailed on the Trouble page, it's not obvious that it has 'regular' uses as well!

That would be great.  Even dropping a hint in the comment column of the codes page would help.  It's a common enough scenario, I think.

For single oddities like that key, I'm not sure that's the best way to do it - perplexed user would still have to scour the list. I'm thinking of replacing the single line "See the HID code list for HID and META values." at the end of the Config page into a section (perhaps called 'Finding Codes') which would mostly be a rewrite of this post (http://geekhack.org/index.php?topic=17458.msg708672;topicseen#msg708672).

Perhaps some "cook books" for common projects would be helpful as well.  It would have saved me multiple look ups in multiple keycode tables on the Internet if I just knew which switch translated to which soarerese HID code for the mapping table.  :)

An index to the example configs would be useful, even if it says little more than which are examples for 122-key etc. I'd love to have time to produce some keymap diagrams like John Elliot's (http://www.seasip.info/VintagePC/ibm_1390876.html), but when I have any time to work on this there always seems to be something more important/interesting to do!

Feel free to include them.  I left some comments in the remapblocks.

Thanks :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 March 2013, 09:20:46
Here's a draft of the new section, which will go just after the Overview section on the Config page.

Quote
Initial Translation

For most keys it's fairly obvious which codes are produced after the fixed initial translation. However, for some keys on a 122-key keyboard, and the normally unused extra keys on various keyboards, the codes don't follow an obvious pattern.

To find out which code a key is producing after the fixed initial translation, you can use hid_listen (http://) to examine the Diagnostic Output (http://).

When you press a key, a set of codes is sent by the converter to hid_listen. For example, pressing the centre key in the 122-key's cursor block results in:

Code: [Select]
r62 +93 d93 rE2 -93 u93
Note the code prefixed by '+', then look it up in the HID code list (http://). For the example, looking up 93 reveals that the identifier to use for remapping or triggering a macro would be LANG_4.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Wed, 06 March 2013, 10:47:06
Rknize, how would you describe typing on a F-122 (makes it sound like a fighter jet, LOL) -- awesome?

As a long-time Model M user (bought my first one new in 1994), the Model F is the ultimate typing feel of you like tactile switches.  Nothing I have experienced so far compares.  I have tried a few...see my sig.

Stock, they are extremely annoying to listen to.  The spring ring combined with the steel plates makes the whole keyboard sing.  It starts bugging me almost immediately, to say nothing about those around me.  Model M's ring too, but you mainly only hear the spring because the steel plate is damped.

The first thing I did to my AT when I got it was a floss mod.  I don't care for the floss mod on Model Ms...I feel it swamps the feel of the switch too much and adds more weight to a switch that borders on being a bit too heavy for me.  However, on the F it works wonderfully.  The F already has a lighter feel and extremely sharp snap on actuation (no plastic membranes or rubber mats).  The floss mod, when done just right, stops the ring without affecting the feel enough to matter.  It's still plenty loud.  I can't use it at work.  But it's quiet enough that my wife doesn't complain too much.  At work I use a grease-modded Model M (the one I bought in '94 in fact) and an SSK on occasion.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Wed, 06 March 2013, 10:51:25
Here's a draft of the new section, which will go just after the Overview section on the Config page.

Quote
Initial Translation

For most keys it's fairly obvious which codes are produced after the fixed initial translation. However, for some keys on a 122-key keyboard, and the normally unused extra keys on various keyboards, the codes don't follow an obvious pattern.

To find out which code a key is producing after the fixed initial translation, you can use hid_listen (http://) to examine the Diagnostic Output (http://).

When you press a key, a set of codes is sent by the converter to hid_listen. For example, pressing the centre key in the 122-key's cursor block results in:

Code: [Select]
r62 +93 d93 rE2 -93 u93
Note the code prefixed by '+', then look it up in the HID code list (http://). For the example, looking up 93 reveals that the identifier to use for remapping or triggering a macro would be LANG_4.


Awesome.  What really threw me was that the codes at the HID level for set 3 were actually the translated "PC" values and not the original key codes.  I suppose this is just a legacy thing.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Wed, 06 March 2013, 10:54:56
I posted my M-122 configuration in this earlier post, and it's also in the newest distribution from Soarer in a file named halvar.sc

http://geekhack.org/index.php?topic=17458.msg658161#msg658161

I put a lot of comments in it, also about LANG_4, numpad and the other keys on terminal keyboards, so I'm sorry that you had to find it all out for yourself again.   :'(

Halvar

Ah yes, I see it now.  I guess I didn't look because the file name didn't give any hints about what keyboard it was for.  Oh well...it was a learning experience, at any rate.  Sorry, I haven't followed this thread as closely as I probably should have.

Perhaps a naming convention or a README index to all the configs would be helpful in that regard.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 March 2013, 11:27:44
Awesome.  What really threw me was that the codes at the HID level for set 3 were actually the translated "PC" values and not the original key codes.  I suppose this is just a legacy thing.

The initial translation to HID tries to make a common ground ready for configs. That means a lot of configs can be written without caring what kind of keyboard is plugged in and therefore without caring what kind of scan codes the keyboard is actually producing (e..g. Colemak remappings).

Ah yes, I see it now.  I guess I didn't look because the file name didn't give any hints about what keyboard it was for.  Oh well...it was a learning experience, at any rate.  Sorry, I haven't followed this thread as closely as I probably should have.

Heh, no-one is saying you should have known, just (annoyingly) that you could! But in this case, what would you search for? Even I'm having trouble finding the posts where I've covered looking with hid_listen to find codes, and I'm cheating by using words from the answer, not the question!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Wed, 06 March 2013, 11:52:14
rkinize, fohat, thanks for your feedback on the Model F -- I've got a Model F in the mail and I'm looking forward to trying it out. As far as sound goes, I usually don't care about the sound on a Model M, so I'm hoping flossing won't be necessary, I actually like them loud -- but maybe the *pInG* sound will annoy me. Thanks also to Halvar and rkinize for the Soarer codes for 122-Model M's and F's.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Wed, 06 March 2013, 12:34:11
F122's have a sharper, more shrill ping sound when compared to AT F and XT boards.  For me, I can't stand the sound of a F122 without floss mod.  The stock sound of an AT F is just right imo.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Wed, 06 March 2013, 12:41:33
It's a very personal choice.  If you like loud keyboards, the F won't disappoint.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Wed, 06 March 2013, 12:51:26
Heh, no-one is saying you should have known, just (annoyingly) that you could! But in this case, what would you search for? Even I'm having trouble finding the posts where I've covered looking with hid_listen to find codes, and I'm cheating by using words from the answer, not the question!

Yeah, I know what you mean.  The docs are a great reference once you know what questions to ask.  People learn things differently.  I learn the most quickly by working backwards from an example.  Unfortunately, I missed Halver's.  Most folks are going to have a specific project in mind when using this.  I imagine that IBM XT and terminal keyboard owners are probably some of your biggest users.  It may be worthwhile to provide walk-throughs for those and provide boilerplate configs for those projects' FAQs?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 March 2013, 15:23:56
Yeah, I know what you mean.  The docs are a great reference once you know what questions to ask.  People learn things differently.  I learn the most quickly by working backwards from an example.  Unfortunately, I missed Halver's.  Most folks are going to have a specific project in mind when using this.  I imagine that IBM XT and terminal keyboard owners are probably some of your biggest users.  It may be worthwhile to provide walk-throughs for those and provide boilerplate configs for those projects' FAQs?

Hmm, I dunno, each person's project has different goals! I think it's a better approach for me to fill in the gaps in the documentation, since there's really very little that's unique to any keyboard type. Or at least to do that first, otherwise the answer to someone's AT-related question might be hiding in the 122-key tutorial, for example, and they could easily not find it.

Also, I think making an index of the example configs will help, since I'll try to highlight the notable features of each rather than just say "Halvar's config for 122-key".
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Wed, 06 March 2013, 16:12:08
...
I forgot to mention, the program has a few odd quirks (who doesn't?)

It ignores "Tab", it locks up after "F10", and it respects "CapLock"

If it goes funny during or after "F10", "Alt" or "Spacebar" you should use your mouse to highlight whatever is in the dialog box, then when you press a key it will go back to normal.

These are not bugs, they are "idiosyncrasies" - HAHA


ROTFL
i recomend "Aqua Key Test" - much easier to search for. download from OTD or GH links to make sure you get the right one.
http://geekhack.org/index.php?topic=34670.0 (http://geekhack.org/index.php?topic=34670.0)
 
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 06 March 2013, 16:56:06
...
I forgot to mention, the program has a few odd quirks (who doesn't?)

It ignores "Tab", it locks up after "F10", and it respects "CapLock"

If it goes funny during or after "F10", "Alt" or "Spacebar" you should use your mouse to highlight whatever is in the dialog box, then when you press a key it will go back to normal.

These are not bugs, they are "idiosyncrasies" - HAHA


ROTFL
i recomend "Aqua Key Test" - much easier to search for. download from OTD or GH links to make sure you get the right one.
http://geekhack.org/index.php?topic=34670.0 (http://geekhack.org/index.php?topic=34670.0)
 

I don't get it.

Aqua Key Test would seem to be OK if you are testing an ANSI keyboard to see whether the keys are working, but since I am accustomed to keyboardtest.exe, all the others are just annoying. I don't remember what I used before, since I am happy now.

I really want the ability to identify keys not standard to an ANSI board. How do I use it to find out which key is F22? What about "Media Pause" or "Numpad *"? Aqua does show the keycode in tiny print at the bottom, but without identifying the key for a simpleton like me.

keyboardtest.exe works great for all this, too, and seems more user-friendly. I can easily live with a few known glitches if it solves my problems.


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 March 2013, 17:04:38
Aqua's is great if you want bypass autohotkey etc., but I also (most of the time, actually) like to use a tester that doesn't hook so deeply and just listens to Windows messages. OTOH, one that doesn't go funny after F10, Alt or Space is good!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: metalliqaz on Wed, 06 March 2013, 17:25:00
So which do you use, Soarer?  ;D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Wed, 06 March 2013, 17:46:45
Also, I think making an index of the example configs will help, since I'll try to highlight the notable features of each rather than just say "Halvar's config for 122-key".

If you're going to be updating the documentation anyway, I think it would be a great idea to give a list of some places to find the materials necessary -- it was a big help to me when I made my converter having someone point out what the right connector was, and where it could be found. You couldn't post a link itself, but listing some electronics companies might help others.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 March 2013, 17:50:49
So which do you use, Soarer?  ;D

Well my own, of course! :D

I started writing it before I knew of Aqua's (perhaps before Aqua's was available, I dunno). I might release it at some point, but it's only ever as good as I need at any given time, as a tool for programming.

(http://geekhack.org/index.php?action=dlattach;topic=39833.0;attach=13573;image)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: wcass on Wed, 06 March 2013, 22:02:09
at one time, i dreamt of writing a GUI for Soarer's that would be as easy to use as the Aikon UI. the app use hid_listen to identify what key you just hit and you use the mouse to select what to assign that key to from 4 tables (non-printed characters, common printed characters, uncommon printed characters, predefined macros). alas, i have not the time or skill.

someone might find this useful. it is a big table of HID id's and PS2 make/break codes. iirc i got if from Microsoft.
[attachurl=1]


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: sleepy916 on Sat, 09 March 2013, 18:01:33
I haven't posted in here yet but I certainly have read this thread more than a few times. I would have been lost without it, thank you Soarer.

AKIMbO mentioned to put this here so I will.

I made this little picture looking at my post it notes. Not sure if it is useful for anybody but I'll post it here anyways. My paint skills leave a lot of room for improvement. This is specifically for my AT Model F.

(╯°□°)╯︵ ┻━┻)

(http://i.imgur.com/zr9vlT6.png)

Fixed...
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 09 March 2013, 19:07:21
Oh, that's cool  :cool:

But something's wrong somewhere because it should have clock -> pd1 and data -> pd0 in both cases  :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: sleepy916 on Sat, 09 March 2013, 19:49:04
Oh, that's cool  :cool:

But something's wrong somewhere because it should have clock -> pd1 and data -> pd0 in both cases  :)

Ahh...my copy and paste skills..  :(
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Mon, 11 March 2013, 13:28:34
I juuuuust unpacked a Model F 122-key (my first Model F) and I notice it has the same 240-degree DIN plug as my Model M 122-keyboard. Is it safe for me to plug this thing into my existing Soarer converter? Any thoughts? My first reactions are:

1. Frickin' HEAVY. This is the keyboard that will survive the apocalypse, for sure. It's just so solidly built. You could use it to work your upper body, like that guy who used his typewriter in Misery.
2. Yeah... it's damnably *pingy* -- "This is the machine that goes *PiNg!*" <--- Monty Python reference. It may grow on me. The sound somehow makes it sound ... cheaper? Though I know that's not the case. I'll consider floss modding eventually.
3. The feet. How do the feet engage? Just pushing on them with fingers doesn't work. The circles on the edges of the keyboard don't have any kind of fingerhold that would allow me to rotate them into position. See potato pics below.

[attach=1]
[attach=2]
[attach=3]
[attach=4]

Yes! Press the buttons on the edge, and the flippers (they're pinball-sized flipper feet) slide down. The angle at which the keyboard is set when the feet are engaged is... feels steep! Anyway, thought I'd share the unwrapping.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Mon, 11 March 2013, 13:36:48
There are two sets of feet.  The inner ones are a bit tricky to coax out of the outer ones, but it gives a more typical angle.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 11 March 2013, 13:38:37
Those double feet area trick if you want to take the case apart - pay VERY close attention to how they are assembled. I never use them.

The sound is really too much without the floss mod. Somebody said that the board "sings" and I think that is a good description.

As to the weight, people keep talking about "6 pounds" I don't know where that comes from. All mine weight 8 and a quarter.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Mon, 11 March 2013, 13:49:34
There are two sets of feet.  The inner ones are a bit tricky to coax out of the outer ones, but it gives a more typical angle.

Really? Gotta give those a try. Do you guys think my Soarer converter will work with this Model F? The one I made for my Model M 122-key has the exact same connector... is it safe to just plug this guy into it same as the Model M?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Mon, 11 March 2013, 13:54:15
As to the weight, people keep talking about "6 pounds" I don't know where that comes from. All mine weight 8 and a quarter.

Yeah, this is way more than 6 pounds.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Mon, 11 March 2013, 13:57:01
There are two sets of feet.  The inner ones are a bit tricky to coax out of the outer ones, but it gives a more typical angle.

Really? Gotta give those a try. Do you guys think my Soarer converter will work with this Model F? The one I made for my Model M 122-key has the exact same connector... is it safe to just plug this guy into it same as the Model M?

If it's the same connector and the converter is setup for the terminal key map, it should "just work".
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 11 March 2013, 15:06:03
Model M 122-key (square label and hat key vintage): 6lbs 3.5oz / 2.8kg  :)

Model F 122-key: 8lbs 12.75oz / 4kg :D

Filco TKL: ~0.9kg (from memory)  :))
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Mon, 11 March 2013, 17:25:38
Well, it "just works" -- except one key won't work. Just ONE, lol. So far I've tried removing both parts of the keycap, and when the spring itself is brushed even slightly it will register on AquaKeytest as having been pressed, but once the two pieces are replaced over the spring, nothing. Any idea what could cause that behavior? Here's hoping I don't have to take it apart.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Mon, 11 March 2013, 17:48:57
Sounds like the spring is bent or not seating in the key cap correctly. If its the latter, leaning the board back while inserting the cap sometimes helps
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Mon, 11 March 2013, 20:06:45
rknize is right, it happens during shipping, some hammers move and the spring doesn't sit properly in the key cap.
The key cap has, sometimes, a small nib, which should sit inside the spring; if not, then the spring doesn't bent and doesn't move the hammer, so there is no change in capacitance and no signal sent. The sound is different, with no 'ping'.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: sleepy916 on Mon, 11 March 2013, 21:34:34
I noticed that the Model Fs were harder to get the keycap on correctly than the Model Ms.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Tue, 12 March 2013, 06:51:14
rknize is right, it happens during shipping, some hammers move and the spring doesn't sit properly in the key cap.
The key cap has, sometimes, a small nib, which should sit inside the spring; if not, then the spring doesn't bent and doesn't move the hammer, so there is no change in capacitance and no signal sent. The sound is different, with no 'ping'.

I'm going to give that a try tonight. Pregnant Mrs. Krogenar was very needy last night, so I didn't have a chance to test this. The fact that the spring registered any kind of keypress at all made me feel that there's got to be a way to fix it. The keyboard itself arrived very well-packed by the sender. The spring did not appear or feel as though it was bent. It had the same 'springiness' as a neighboring, working spring.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: simkev on Tue, 12 March 2013, 07:20:00
If you have a USB keboard that has NKRO over a usb to PS2 adapter could you make that board NKRO via the teensy without the PS2 adapter?Solder the ubs cables to the teensy?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Tue, 12 March 2013, 07:27:39
If the teensy is configured with a firmware that interfaces to a PS/2 board and supports NKRO then yes, it should work.  You'd need to attach the keyboard via PS/2 protocol pinout.  If for you that means cutting the cable and soldering it direct instead of using an adapter or some other method, then yes it will work if you get the pinout correct.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 12 March 2013, 18:57:45
If it's a keyboard with a captive cable (i.e. no USB socket on the keyboard) it might be easier to remove the cable and wire the Teensy inside the keyboard, since the cable is quite likely to have a connector where it joins the PCB. Of course, you'd still have to work out the pinout.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Tue, 12 March 2013, 19:08:32
rkinize, fohat, I recognize your expertise with the Model F. I leaned the 'board backwards, and inserted the keycap sections, and all is well. It took a few tries, but now it's working! Thanks so much for your help guys, it is greatly appreciated. (tips hat)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 12 March 2013, 19:11:20
It can take several attempts to get it to seat properly. Sometimes they are just stubborn. Making the spring flop forward is usually helpful.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Tue, 12 March 2013, 22:01:19
rkinize, fohat, I recognize your expertise with the Model F. I leaned the 'board backwards, and inserted the keycap sections, and all is well. It took a few tries, but now it's working! Thanks so much for your help guys, it is greatly appreciated. (tips hat)

Great!  The same trick works on the M, too.  If you look under the key cap, there is a little nub where the spring is supposed to seat.  Gravity makes the springs lean towards you when you insert the cap, so it has to ride the ramp and then hopefully pop over that nub.  Sometimes it just won't, so you have to guide the spring yourself.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 06 April 2013, 13:15:33
I just added a v1.11 update to the first post:


The last change, to prevent debug output when in BIOS mode, is another attempt at fixing the long-standing incompatibility with certain Dell machines (M6300 (BIOS rev A14) and Inspiron 630m). If anyone has one of those, please test!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Mon, 08 April 2013, 16:56:26
Thanks Soarer for constantly pushing this forward!  :cool:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: jpeart on Thu, 11 April 2013, 23:02:10
Soarer, thank you for all your efforts in developing this firmware.  I spent the last few weeks buying different adapters/converters trying to get an older keyboard working to no avail.  I found your converter while googling and decided to give it a try.  I ordered a Teensy 2.0 last weekend and I was very excited to see it had arrived today.  Took me just a few minutes to hook it all up for a test run and it works perfectly!  With the other products I had purchased I was getting a lot of key repeats, but I have not seen a single problem using your firmware.

If anyone is interested I'm tracking the progress of my little project here http://geekhack.org/index.php?topic=42150.0 (http://geekhack.org/index.php?topic=42150.0)
Basically I'm trying to put a Raspberry Pi inside a Keycat keyboard and make my own kind of Commodore 64.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 12 April 2013, 09:14:43
Oh, no! It's that pesky fohat.digs again!

A couple of months ago I had a big problem after upgrading a motherboard from Asus to Gigabyte. I keep a powered USB hub at the back of the desk, and my keyboards and mice plug into it. I have done this for a long time, but the Gigabyte motherboard refused to boot (not even a peep or POST) with the powered USB 2.0 hub connected. When I went to a non-powered hub, the problem disappeared.

There are USB 2.0 and 3.0 sockets on the back, and since I have a 3.0 external hard drive, I wanted to upgrade the USB hub. I bought a nice SIIG 4-port powered USB 3.0 hub, and plugged it into the (previously vacant) 3.0 port.

Now, the computer boots fine and recognizes both of my mice, but will not recognize my F-122/Teensy (Teensy 2.0 with v1.10 Soarer's Converter) until I unplug it and hot-plug it. I have been through several power-up/power-down cycles and it is still happening.

I know that motherboards are funny about these things, sometimes, and the stock answer is: "plug the keyboard directly into the motherboard" but I would prefer to make the hub work if I could.

Are there any new answers since last time?

Thanks! Harry
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Fri, 12 April 2013, 09:31:40
Look for a BIOS upgrade?  This weird boot behavior with keyboards usually has to do with legacy keyboard emulation that the BIOS tries to do with USB keyboards.  Look in your BIOS options and try disabling legacy keyboard emulation if such an option exists.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vipjun on Mon, 15 April 2013, 20:04:53
Just wanted to show my appreciation for this project. thanks soarer!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Tue, 23 April 2013, 15:42:57
Successfully modded one of my AT F's to a traditional ANSI layout (using a function block where Fn + 1 is F1, Fn + 2 is F2, etc). 

Thanks again Soarer!

(http://i35.tinypic.com/2mhew48.jpg)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Tue, 23 April 2013, 15:54:52
That's beautiful.

I wish Unicomp's European resellers had those media keycaps to use it with my M-122.

And that there were any Model Fs to be found here in Europe...

What key do you use for the Fn key?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Tue, 23 April 2013, 17:33:13
That's beautiful.

I wish Unicomp's European resellers had those media keycaps to use it with my M-122.

And that there were any Model Fs to be found here in Europe...

What key do you use for the Fn key?

Capslock + 1= F1...all the way through Caplock + = which is F12
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: sleepy916 on Tue, 23 April 2013, 18:15:11
Successfully modded one of my AT F's to a traditional ANSI layout (using a function block where Fn + 1 is F1, Fn + 2 is F2, etc). 

Thanks again Soarer!

Show Image
(http://i35.tinypic.com/2mhew48.jpg)


That looks to be in pristine condition! Now just send it to my house, I'll pm you my address shortly. ;]
Title: Re: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Tue, 23 April 2013, 18:21:21
Successfully modded one of my AT F's to a traditional ANSI layout (using a function block where Fn + 1 is F1, Fn + 2 is F2, etc). 

Thanks again Soarer!

Show Image
(http://i35.tinypic.com/2mhew48.jpg)


That looks to be in pristine condition! Now just send it to my house, I'll pm you my address shortly. ;]

It is...I actually struggled with whether I wanted to mod it or keep it in stock condition for quite some months.  Today I said fugg it and modded it.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Tue, 23 April 2013, 18:36:43
After looking at other Model F pictures: wow, how much did you have to mod here?  :eek:

Did it look like this one with the big-ass return key, small backspace and all?
http://www.clickykeyboards.com/index.cfm/fa/items.main/parentcat/9934/subcatid/0/id/529210

That's no small feat then ... I feel dumb for even talking about keycaps first...






Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Krogenar on Wed, 24 April 2013, 06:55:56
Akimbo, I'd love to do what you did (more ANSI-like layout) with my Model F-122, but frankly I don't want to risk ruining my 'board. Looks awesome. Do those additional keys feel particularly different from the original keys? I mean the actuation, sound, etc.?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 24 April 2013, 07:02:22
The mod is totally easy, assuming that you can take the board apart and put it back together.

It is a great opportunity to tidy everything up, and swapping 2 spring locations is utterly trivial.

Of course, putting it back together is the hardest and most challenging part.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: AKIMbO on Thu, 25 April 2013, 00:51:26
After looking at other Model F pictures: wow, how much did you have to mod here?  :eek:

Did it look like this one with the big-ass return key, small backspace and all?
http://www.clickykeyboards.com/index.cfm/fa/items.main/parentcat/9934/subcatid/0/id/529210

That's no small feat then ... I feel dumb for even talking about keycaps first...
Yup, it sure did look like that (small backspace and all).  Like fohat said, it isn't a hard mod....open up the board and move a few springs around, add a couple white barrel inserts from an old Model M, and close her back up.  The hardest part is stripping and soldering the AT cable to the Teensy.


Akimbo, I'd love to do what you did (more ANSI-like layout) with my Model F-122, but frankly I don't want to risk ruining my 'board. Looks awesome. Do those additional keys feel particularly different from the original keys? I mean the actuation, sound, etc.?

Nope...the additional keys feel and sound exactly like the original keys.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 27 April 2013, 07:31:24
Nice post! I have a pseudoterminal  kevex ray 7000CM, and I want to adapt the keyboard in order to use it with a modern computer, the keyboard terminal use this port;
http://www.flickr.com/photos/95230480@N02/8683117351/in/set-72157633342730175

As I don't have a clue about this, I also took photos of the terminal w/o tape;
http://www.flickr.com/photos/95230480@N02/sets/72157633342730175/

The keyboard looks great  :p
(http://oi41.tinypic.com/2rmo55v.jpg)

Thanks in advance!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 27 April 2013, 08:05:43
Beautiful! A bit crazy in construction, with a PCB and wire-wrapping!

Not something this converter can convert though. Do you know what switches it uses? If they are simple contact switches, then the easiest way to get it working would be to remove the chips and wire in a new controller. I'm currently working on one aimed at non-programmers, or there's hasu's code (https://github.com/tmk/tmk_keyboard) which is pretty easy to configure and build.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 27 April 2013, 11:11:12
Beautiful! A bit crazy in construction, with a PCB and wire-wrapping!

Not something this converter can convert though. Do you know what switches it uses? If they are simple contact switches, then the easiest way to get it working would be to remove the chips and wire in a new controller. I'm currently working on one aimed at non-programmers, or there's hasu's code (https://github.com/tmk/tmk_keyboard) which is pretty easy to configure and build.

I don't know exactly what type of switches are, non clicky and the loudest I've seen ;
http://www.flickr.com/photos/95230480@N02/sets/72157633364166384/

Thanks again!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 27 April 2013, 14:20:31
They look rather like Cherry M7 (or M6?) with the 'T' mount stem... Catalogue 1982, pp22,23 (http://deskthority.net/wiki/File:Catalogue_1982.pdf). There's even a couple of keyboards in there with a similar layout to the main alpha block of yours.

So most likely to be simple contact switches. You could check with a multimeter easily, if you have one...?

The first task in replacing the controller would be to identify the rows and columns. I did that by tracing the PCB tracks on an Ortek MCK-84 (http://geekhack.org/index.php?topic=13826.msg270915#msg270915). It's quite tedious :( It's not really necessary to go to such detail; simply knowing which are rows and which are columns would suffice, and the rest can be worked out after the controller is wired up.

Some straight-on pictures of the PCB would help, if you get to taking it apart that far. It looks like those supports could be unscrewed from underneath, leaving them attached to the PCB. Not sure if they'll block the view of anything important though!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 27 April 2013, 17:04:31
I've already disassemble the keyboard cover and I took a couple of photos, It isn't linear ;
http://www.flickr.com/photos/95230480@N02/sets/72157633350772239/

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 27 April 2013, 18:51:45
Hah! I wasn't expecting it to be a double-sided PCB... at least it makes one side very easy to trace out! There's clearly 8 traces there for the rows, plus one trace for the shifts which seems to go to ground. On the other side there are probably 11 (or more) traces for the columns. All the lines presumably go to these sockets:

[attachimg=1]

I'd guess that the rows all go to the one on the left, which looks like it has a resistor pack in it (acting as pull-ups or pull-downs). Testing with a multimeter - or even a cheap continuity tester - would confirm the connections.

The 'controller', such as it is, consists of all the chips (12?). None of them look big enough to be a CPU, but 12 is more than would be needed for a completely 'dumb' keyboard. So that's kind of interesting, but probably not very useful! (There's what looks to be a voltage regulator near where that ribbon cable connects, so some of the chips will simply buffer voltages).

So as controller swaps go, it looks fairly straightforward - remove all the chips, wire a Teensy or Teensy++ to some of the connections on the the sockets I marked, customise and load some code, and it should work! Of course, I don't know how comfortable you'd be doing that kind of thing... :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 27 April 2013, 20:06:19
I will try to get a multimeter and verify that.
Quote
So as controller swaps go, it looks fairly straightforward - remove all the chips
I don't want to break everything xD,but If wiring a teensy would make it operative, I'll make you a statue hahahah.

Offtopic, do you know if theres any shop who sells your teensy in Europe? 86 dollars for shipping tracked  :eek:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 27 April 2013, 20:30:50
If the chips are removed carefully, nothing will break and it could all be put back how it was - if you remember where they all went ;)

The untracked shipping from PJRC has been reliable to me (in the UK), and if you're buying more than one that works out to be the cheapest option overall. Otherwise, there's Floris.CC (http://www.pieterfloris.nl/shop/category.php?id_category=45). Also, there are alternatives (http://deskthority.net/workshop-f7/teensy-2-0-alternatives-atmega32u4-t4253.html) that use the same CPU as the Teensy 2.0 (warning: that page needs a clean up, some have posted non-compatible boards there).

I think a Teensy 2.0 would be enough for this - it probably has enough pins available. But it might be easier with Teensy++ 2.0, just because of being able to make a more logical set of connections, and less cramped. It's not like you'll be short of space to put it in that casing!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sun, 28 April 2013, 04:45:31
Quote
Today I spotted a breakout titled "Leonardo Nano Pro Mini ATmega32U4 ..."
Still a good choice?On ebay for ~13€ with free shipping.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 28 April 2013, 06:14:37
Probably! However, two points...

The Teensy loader (as in, what gets code onto the chip) is by far the easiest to use.

You still need to check how many columns there are on that keyboard; it might be too many for the ATmega32U4 chip. There's 25 usable pins in all, but some may already be used by LEDs (one LED on Teensy). Plus, you might want to add the 3 lock LEDs. We've already spotted 8 rows, but then there's the shift keys which might need a pin each (since one side looks like it's joined to ground permanently). So 25 - 1 - 3 - 8 - 2 = 11 pins left for columns. It ought to be enough for 86 keys, but only just!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sun, 28 April 2013, 09:47:47
So teensy loader will only work with a teensy board correct?
Analyze the front part of the PCB is nearly impossible, I've made a really awful looking scheme,
(http://oi44.tinypic.com/30mbb13.jpg)

Sorry for my totally retarded questions  :-[
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 28 April 2013, 14:18:13
So teensy loader will only work with a teensy board correct?

Yes, essentially that's correct.

There's two other common ones... Atmel's FLIP works with the default Atmel bootloader on many dev boards, and dfu-programmer (or the Arduino environment) works with Arduino compatible dev boards.

Analyze the front part of the PCB is nearly impossible, I've made a really awful looking scheme,

Sorry for my totally retarded questions  :-[

No problem!

Scheme looks about right... the blue wires can stay, since removing the chips means the wires won't connect to anything. It loks like the chips are in sockets, so they should come out with a bit of careful prizing with a screwdriver (a little twist at one end of the chip, a little at the other, ...). Analyzing all of the front of the PCB shouldn't be necessary - it's clearly 8 lines going to the socket at the end, and a group of 11 lines going to that other one - as predicted :D It looks like the shift keys (and maybe one other?) conect to the last three pins of that socket too.

Of course, I'm making some guesses, so this should be checked with a multimeter (not every single key's connection, but enough to know that I've guessed correctly).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: neocalm on Sun, 28 April 2013, 20:57:05
Sorry - misposted.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: neocalm on Sun, 28 April 2013, 20:57:25
Well Soarer - it only took nine months but after experimenting with conductive paint, and later on copper conductive tape - both didn't appear to be long-term solutions as they might wear down too much.  One bolt-mod is enough.

I took your advice and Unicomp does indeed sell the membrane.

Bolt-modded back together using 78 of:

(Amazon amongst other carries these) and there was absolutely no issue.  Soarer's Converter is absolutely everything I could have dreamed, for 122-keys of mechanical switching goodness.

Thanks again!!

Rear defogger repair kit?
Yeah. Or from electronics suppliers (example (http://www.rapidonline.com/Tools-Equipment/Conductive-Silver-Leitsilber-L100-3g-87-0781)).

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.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 29 April 2013, 14:06:54
I managed to get a multimeter, I don't know If is not working correctly or I am def stupid  :p;
As you said a few posts back, So most likely to be simple contact switches. You could check with a multimeter easily,
I take the multimeter, both wires on it, test it with a 9v batterie and one of the resistances of the kb,the multimeter seems to work.
But, when I test the switches, voltage, resistance, amp all 0, I've tried it with all the precision positions available, which type of result I've to find?

Thanks again!


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 29 April 2013, 14:40:04
Right... on a resistance setting, you should find the meter reads "OL" or goes blank or something, then if you touch the probes together it should read 0 (or close to 0). You might find it has a continuity test setting, which will beep when you touch the probes together...

[attachimg=1]

So to check the switch, hold a probe each on the contacts marked red and black - we're expecting it to read 'OL' without the switch pressed, and close to 0 with it pressed. (Yes, you might run out of hands!)

[attachimg=2]

Then you could try to confirm the connections from that switch to the sockets... my guess is that the red one connects to one of the pins on the purple socket, and the black connects to a pin on the blue socket.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 29 April 2013, 15:37:00
Multimeter doesn't work well, in "AUDIBLE CONTINUITY TEST" never beeps, In the manual says that if the resistance is lower then 1k ohm buzzer will sound, so putting both probes together must return into a beep as the screen value goes near to 0 (default 1, not OL)
But it doesn't, and when I make the contact with those marked,return this;

Only a few switches return that value, the rest stay at the 1 deafult.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 29 April 2013, 16:07:24
Shame about the buzzer, that does make it easier :(

Some relatively high resistance instead of OL (I'll say OL instead of 1, so it's clear what I mean) is quite possible, and 1811 is high enough. (The resistance is elsewhere in the circuit, not in the switch itself).

Does it go close to 0 if you press the switch?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: metalliqaz on Mon, 29 April 2013, 16:18:03
Get a proper meter dude.  It is a worthwhile investment.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 29 April 2013, 16:33:15
Get a proper meter dude.  It is a worthwhile investment.
Yep, I don't learn the lesson, months ago I bought a (welder?) for 3€ in a chinese shop instead of paying 10€ for the local one. The welder exploded, comical scene(and also scary...)
Multimeters can explode?  :D
Tomorrow I will try to return it.

Shame about the buzzer, that does make it easier :(

Some relatively high resistance instead of OL (I'll say OL instead of 1, so it's clear what I mean) is quite possible, and 1811 is high enough. (The resistance is elsewhere in the circuit, not in the switch itself).

Does it go close to 0 if you press the switch?

Yes! It goes closer to 0 when pressed
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 29 April 2013, 16:43:02
Yes! It goes closer to 0 when pressed

Cool, the switches are simple contact switches then :cool:

How about finding a connection between red and a pin on the purple socket? The switch doesn't need to be pressed for that test, just hold one probe on red and try the other probe on each pin of the purple socket, to see if it goes close to 0 on any of them.

Then the same between black and the pins on the blue socket :D

And then return the meter!!  :))
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 29 April 2013, 16:54:32
Found! I will record a video , it's a little bit weird
The video;
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 29 April 2013, 19:04:32
Not weird at all, it's just how I'd expect it! Pressing the switch joins one connection on the purple socket to one connection of the blue socket. All the other switches will join a different combination, forming the matrix.

Here's a switch matrix from a pinball machine :D

(http://techniek.flipperwinkel.nl/wms11/sm1sys11.gif)

Anyway, I think that testing confirms that rows are on the purple socket, and columns are on the blue socket. The controller would scan the matrix by setting the columns active, one at a time, and each time reading the rows.

Apart from three keys - Left Shift, Right Shift and Reset - which look like they have separate connections...

[attachimg=1]

The trace from the Reset key (black) is mostly visible. But can you check that you get a low reading between the green circle and the end pin on the socket, and also from the cyan circle to the next pin?

Then we have almost all of the information we need. The last question is which of the pins on the purple socket are actually connections to rows. We already know pin 2 is. (well, the second pin on that side - I think it might actually be pin 10 going by the marking on the top of the resistor pack). The rest I can see in this picture, but not quite clearly enough to tell for sure...

[attachimg=2]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 29 April 2013, 19:20:16
Quote
can you check that you get a low reading between the green circle and the end pin on the socket, and also from the cyan circle to the next pin?
Both goes to ~0
Quote
The last question is which of the pins on the purple socket are actually connections to rows
Im now getting which pins makes nearly zero, I will post now the scheme, I also took a new photo of the board;
(http://oi43.tinypic.com/14blq9l.jpg)

The scheme;
http://www.flickr.com/photos/95230480@N02/8694766662
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 29 April 2013, 19:47:22
That pic's nice and clear :D

So these are all of the 22 places that a new controller would have to connect to on the keyboard...

[attachimg=1]

Then maybe the controller also needs a few pins for LEDs (onboard and locks).

edit:

Scheme is cool  :cool:

I think the line to the left shift should go to the key next to it though ;)

The line you've drawn to the right shift is just a ground... you would need to make a connection from it to the new controller, but it won't use up an IO pin.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 29 April 2013, 20:36:30
Trying to understand the left&right shift issues I've found this;
(http://oi40.tinypic.com/11j6dtg.jpg)

Tomorrow I'll make the Teensy order, the mini-usb cable used its a special one? Or I could use any other?
Teensy 2.0 or ++ 2.0? 6€ more, worth it?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 29 April 2013, 21:00:35
There will be lots of ground connections around... and one side of each of Left Shift, Right Shift and Reset is connected to ground also, by this trace on the right:

[attachimg=1]

The other sides of those switches we already know use three pins on the blue socket. In a sense, they are wired separately from the matrix. It would be possible to modify the PCB to make them part of the matrix, but there's no need.

I think Teensy 2.0 doesn't have quite enough pins - only 24 are available, and one of those is awkwardly in the middle of the board. But it depends if you want to connect LEDs for caps lock etc, and how many. I'd go for the Teensy++ 2.0, if it were me. The mini-usb cable is just a standard one.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 30 April 2013, 08:06:10
I didn't metioned yet,I also have a (space saver?) Teletype M43 keyboard, the clickiest I've ever heard.
I think that It's also teensy capable, but I am frightened with this;
(http://oi39.tinypic.com/33pbrid.jpg)

Little gallery (It looks like all this new space saver mini mechanical keyboards  :p)
http://www.flickr.com/photos/95230480@N02/sets/72157633371311121/

Im doing the scheme of the pcb, I will post it now.

So, 2 teensy's?  :D

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 30 April 2013, 09:17:32
Sure, why not! Maybe get one of each - since that has less keys a Teensy 2.0 might be enough. As long as the switches measure ~0 resistance when pressed, it should be possible.

You should be fine working on it if you touch something which is grounded (like an unpainted radiator pipe) before touching it, to get rid of any static charge you might have. It's usually only an issue when removing chips, and then you can try not to touch the pins.

Removing the chips looks like it would be difficult, so you would have to hope that the new controler can work OK without removing them (but fairly good chance of that).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: rknize on Tue, 30 April 2013, 10:25:21
If anyone is old enough to remember the 4000-series CMOS logic gates, they were/are very sensitive to ESD.  People accustomed to TTL circuitry got a nasty surprise when they handled early CMOS stuff without a static strap.  Wear appropriate protection if you dig into this device.

Modern gate logic is pretty much all CMOS, but they have many layers of protection diodes on each leg of the part to prevent most ESD problems.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 30 April 2013, 11:36:39
Sure, why not! Maybe get one of each - since that has less keys a Teensy 2.0 might be enough. As long as the switches measure ~0 resistance when pressed, it should be possible.

You should be fine working on it if you touch something which is grounded (like an unpainted radiator pipe) before touching it, to get rid of any static charge you might have. It's usually only an issue when removing chips, and then you can try not to touch the pins.

Removing the chips looks like it would be difficult, so you would have to hope that the new controler can work OK without removing them (but fairly good chance of that).

W/o pressed ~0 , and when pressed default 1 value, the scheme;
(http://oi40.tinypic.com/191g8j.jpg)

Edit: Teensy-with his cable and Teensy++ incoming  , 56$  :confused:
Hope it works  :p
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 30 April 2013, 14:02:57
I'm confident that the first one can be made to work.

The M43 though, after seeing that diagram, may take some effort... it doesn't look like a matrix, and I'm guessing that all the other pins of the switches (the left-hand pin of each switch, in that pic) connect together. The best approach might be to work out how to use it via the cable connector instead. The first step would be to try and find a Technical Reference or a Repair Manual for it.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 07 May 2013, 05:39:25
The package arrived today! Only 1 week  :eek:
It's extremely necessary to remove all the chips which do nothing? Or I could let them stay?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 08 May 2013, 17:38:07
1 week is good!

Technically you might get away with not removing the chips, but there is a risk that they could get damaged, or that they could obstruct the operation of the Teensy controller. They're really not all that difficult to remove (just do it carefully, and record what went where). What you might not have is something good to store them in - either anti-static foam or an IC tube is best...
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 09 May 2013, 10:36:56
Chips removed, but I don't know If I also need to remove the resistances or&and the " special chip";
(http://oi43.tinypic.com/5p55lk.jpg)

Now, how I should wire the teensy?
(http://oi39.tinypic.com/6gj48j.jpg)

Thanks a lot for your help,w/o your knowledge this would still taking dust in the lab  :confused:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 09 May 2013, 15:16:15
The other resistors etc can stay. Most will now be disconnected from the switch matrix, after removing the chips.

As for wiring, there is some flexibilty... let's start by labelling the pins on the keyboard:

[attachimg=1]

We still need to find a convenient point to connect GND to ground, as well.

On the Teensy++, it could go something like this:

[attachimg=2]

I wonder, would the Teensy mount on the pins 0 to 10? (tilted at an angle to avoid touching the pins behind them). That would save a lot of wiring! (It would be harder to remove though).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 09 May 2013, 16:26:42
Like this ? :p
(http://oi39.tinypic.com/2irag4m.jpg)
Now I'll try to see how the rest pins could be connected w/o soldering.

Any advice with the type of wire?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 09 May 2013, 17:13:42
Unfortunately (?), you will most likely need to do some soldering to get this done!

I was thinking of putting it this way round (and tilted so it doesn't touch the next row of pins along):

[attachimg=1]

Another option would be to flip it over - still connecting to the same pins. But then the reset button would be hard to get to, since it would be a) underneath, and b) under the metal plate.

The main problem with the way you've shown it is that there are the GND and AREF pins in the middle of that side, which we can't use for the matrix connections.

You might be able to use some breadboard wires to avoid some soldering, at least on the keyboard side. Something like these female to male (http://www.ebay.co.uk/itm/130807140502) or these female to female (http://www.ebay.co.uk/itm/130782463007) (which are probably available more locally to you). You could solder them at the Teensy end, or solder pins to the Teensy and then plug them on.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 09 May 2013, 19:02:46
With patience and bending slowly a little bit the front pins I finally managed to connect it with that position;
(http://oi43.tinypic.com/c5oas.jpg)
I bought a good amount of female-male arduino connectors, kb-female---------male-arduino, and I would probably solder these (theres always the possibility just with pression)
With that position the GND and AREF problems dissapear?

Thanks again!


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 09 May 2013, 19:58:15
That way round, but moved along 3 positions - so the X,Y,Z pins are not connected into the Teensy. The GND and AREF are not a problem along this side, but PD6 is, since it has the LED on the Teensy connected to it already. Pins PD7 along to PC7 gives the most pins together  in a row that can be used. Something to insulate the Teensy from the next row of pins would be wise - a few layers of electrical tape on the bottom of the Teensy should be enough.

A warning here: if you solder the Teensy directly to those pins on the keyboard, it will be quite hard to remove! I can't make the choice for you - you can either fit it there with less individual wires to do, or elsewhere with more wires but far easier to remove. Friction fit on those pins might be OK for testing, but I wouldn't trust it long-term.

My controller code is progressing, the main part of it has been tested and works fine. What I'm busy with now is allowing the connections and key mappings to be defined using a config file, and most parts of that are written but not yet tested. Maybe ready for a try-out in a few more days!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Fri, 10 May 2013, 02:31:15
I bought enough pin-adapter, so I'll probably connect all the pins to the teensy using them
Quote
not a problem along this side, but PD6 is, since it has the LED on the Teensy connected to it already.
I didn't get that , I won't put any leds, at least for now, don't want to complicate it even more  :confused:

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 10 May 2013, 05:09:44
Just that there is already an LED on the Teensy, which uses PD6 :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 14 May 2013, 05:09:12
Solderless cables arrived, I will edit now with some photos
If the position are the definitive I'll solder them now
--------
Soldered and plugged;
(http://oi40.tinypic.com/686908.jpg)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: mkawa on Tue, 14 May 2013, 17:55:50
this post is to for force alaric to post the bom and howto for this awesome soarer he made for me

(http://geekhack.org/index.php?action=dlattach;topic=17458.0;attach=22069;image)
(http://geekhack.org/index.php?action=dlattach;topic=17458.0;attach=22071;image)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 14 May 2013, 18:26:36
Solderless cables arrived, I will edit now with some photos
If the position are the definitive I'll solder them now
--------
Soldered and plugged;
Show Image
(http://oi40.tinypic.com/686908.jpg)


Dang... stuff happened!

My code basically seems to work now, at least on Teensy 2.0. It should work on Teensy++ with a recompile, I'll build it if you wanna try it out!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 14 May 2013, 18:42:37
Quote
My code basically seems to work now, at least on Teensy 2.0. It should work on Teensy++ with a recompile, I'll build it if you wanna try it out!

Of course! It will be a pleasure testing it  ;D
I'm also making a video-resume of the whole steps, im building your statue  :p
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 14 May 2013, 19:14:46
OK, I'll try and put it together tomorrow evening. Are you running Windows?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 14 May 2013, 19:17:39
yes, Windows 7.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 14 May 2013, 19:58:29
Cool, I won't need to build the Linux or Mac tools then :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 15 May 2013, 19:30:22
this post is to for force alaric to post the bom and howto for this awesome soarer he made for me

Show Image
(http://geekhack.org/index.php?action=dlattach;topic=17458.0;attach=22069;image)

Show Image
(http://geekhack.org/index.php?action=dlattach;topic=17458.0;attach=22071;image)


That is a really nice little case!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 15 May 2013, 19:50:51
Quote
My code basically seems to work now, at least on Teensy 2.0. It should work on Teensy++ with a recompile, I'll build it if you wanna try it out!

Of course! It will be a pleasure testing it  ;D
I'm also making a video-resume of the whole steps, im building your statue  :p

Right, here's a zip of controller stuff, which should be all you need for the moment. You'll also want to get the latest converter zip, for the docs, since the method of loading a config is the same. Then you'll need to load Soarer_Controller_1.2_at90usb1286.hex onto the Teensy++, and then compile (scas) and load (scwr) the kevex.sc config file.

That will set it up to scan the matrix, but it won't be outputting any keys (it would get messy if it happened to spew out random keys!). It will be printing stuff out that can be viewed using hid_listen - if it's basically working you'll see nothing much until you press a key, and a hex code prefixed by either \ (key down) or / (key up). The hex code corresponds to the matrix position of the key - the strobe number first, and the sense number second.

If that all looks good, you can start editing a new config file, replacing all the UNASSIGNED entries with useful HID codes (such as A or SPACE, see the Codes page of the docs). So you press Q, see what the code is, plug Q into the config at the right place. Rinse and repeat!

Oh, the three lines near the end beginning with 'unstrobed' are left shift, right shift and that reset key... but I'm not sure what order. They will have matrix codes of B0, B1 and B2, in that order.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: alaricljs on Wed, 15 May 2013, 21:45:38
Show Image
(http://geekhack.org/index.php?action=dlattach;topic=17458.0;attach=22069;image)

Show Image
(http://geekhack.org/index.php?action=dlattach;topic=17458.0;attach=22071;image)


Case:  Mouser - 789-S3A-301210
Connector: Mouser - 568-NYS325  -PS/2 alt: 161-381/6-E
3 LED resistors: 1kohm Mouser - 603-CFR-25JR-521K
3 LEDs: 3mm flat top orange, 2.9v nominal from ebay
USB connector:  "Mini USB Female 5Pin Socket Connector 180Degree" http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=170588741155 (http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=170588741155)
spare mini USB cable to destroy
Teensy
loose wire, used old PC case mobo leads (power switch and the like) ~22ga?
JB weld epoxy to hold the USB connector in
2 spare PC screws for AT connector.

The 1k resistors make the orange LEDs a nice indicator brightness.  Yes, I made a sacrificial USB lead to connect to the teensy.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 16 May 2013, 04:16:00

Right, here's a zip of controller stuff, which should be all you need for the moment. You'll also want to get the latest converter zip, for the docs, since the method of loading a config is the same. Then you'll need to load Soarer_Controller_1.2_at90usb1286.hex onto the Teensy++, and then compile (scas) and load (scwr) the kevex.sc config file.

That will set it up to scan the matrix, but it won't be outputting any keys (it would get messy if it happened to spew out random keys!). It will be printing stuff out that can be viewed using hid_listen - if it's basically working you'll see nothing much until you press a key, and a hex code prefixed by either \ (key down) or / (key up). The hex code corresponds to the matrix position of the key - the strobe number first, and the sense number second.

If that all looks good, you can start editing a new config file, replacing all the UNASSIGNED entries with useful HID codes (such as A or SPACE, see the Codes page of the docs). So you press Q, see what the code is, plug Q into the config at the right place. Rinse and repeat!

Oh, the three lines near the end beginning with 'unstrobed' are left shift, right shift and that reset key... but I'm not sure what order. They will have matrix codes of B0, B1 and B2, in that order.

After loading the Hex onto the teensy, opening scar or scwr result in a pop up of less than 1/10 sec. I think that's normal without dropping the sc file, but,dropping it still the same pop up.
If I drop the sc file onto the scaswr I get this message;
(http://oi43.tinypic.com/3165ixw.jpg)
The program also automatically creates a new file, "kevex.sc.scb",is this normal?

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 16 May 2013, 05:54:14
Apart from the not found message, that's all as expected. The tools are command line programs. For now, dropping kevex.sc onto scaswr.bat is all you need. The file it creates is the output from scas, and that's good.

For my tools to find the Teensy it should be running my hex. Once the hex is loaded, click the Reboot button (if you're not using the Auto mode) but don't press the reset button again. Then scwr should be able to find it.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 16 May 2013, 15:03:59
No more error! It ends w/o problems;
(http://oi43.tinypic.com/34eaqmw.jpg)
BUT, hid_listen doesn't work, I have touched all the keys and no one respond;
(http://oi41.tinypic.com/3178dxc.jpg)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 16 May 2013, 16:27:51
Hmm, that'a puzzle. It seems that hid_listen has connected OK, just nothing is being printed... which probably means the matrix scanning isn't working. Just to check, have hid_listen open when you drop onto scaswr.bat - stuff should be printed about the config being loaded.

Did you make a ground connection? It probably won't help with most of the matrix scanning, but it's essential for the 3 unstrobed keys.

The only thought on the matrix scanning is that maybe the resistor pack on the sense lines is pulling down instead of up (I expected it to pull up). Could try again after removing it... I mean the whitish thing that looks rather like an IC.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 16 May 2013, 17:30:22
(http://oi44.tinypic.com/2z4yfps.jpg)
I didn't do any ground connection  :confused: , also I have no idea who to ground it, If I remember well you mentioned something about american tape, like this ? http://www.amesasuministros.com/productos/1533971379.jpg

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 16 May 2013, 17:43:28
I know it doesn't look like much, but I think that gives me something to go and investigate! It's an error that's preventing the config from being activated on the Teensy. (So maybe leave the resistor pack for now, but I think it will have to be removed eventually).

Making a ground connection can just be with another wire - from one of the GND pins on the Teensy to a ground pin on the keyboard. To find a suitable pin, you'll need to find a pin that is joined to the large area I marked on a previous picture - each of the chips will have at least one, on one of the corner pins of the chip. I think the one with a double circle, most likely...

[attachimg=1]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 16 May 2013, 18:26:10
OK, this .hex should fix that problem. Let's see what the next one is  :))

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 16 May 2013, 20:11:46
Now it seems to recognize the keys, but not all.
(http://oi41.tinypic.com/2w35q14.jpg)
(cross ones not working, maybe a soldering issue)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 16 May 2013, 20:24:21
The two shifts and the top-right one won't work until ground is connected.

I'd guess that the other 8 are all on the same strobe line, so yes, quite possibly a soldering/conenction issue there, or maybe a config issue (but I think there's something in the config for every pin you've connected). The first question is, which strobe is it? Looking at the first digit of the codes being printed, which one of 0,1,2,...,8,9,A is missing?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 16 May 2013, 20:40:38
This weekend I will resold the whole teensy, It doesn't deserve his actual look  :p
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 16 May 2013, 20:57:23
Be very careful if you do that! It's easy to lift a pad from the Teensy PCB when desoldering :(

The missing code will tell us exactly which wire it is, so really only one needs a little attention. It could be the solder, or maybe the socket at the other end.

But anyway, it's a promising start :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 18 May 2013, 05:46:57
It was the socket at the end, now all the keys except shifts are working.
I solder the ground pin and tried with the 4 pins marked, no one works. But not only those 3 keys doesn't work, all the rest also fail  :confused:

How I must edit the rawhid.dll?

Thanks!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 06:14:06
Fail only when the wire is connected, or still failed with it removed?

Sorry, I meant that you should test with a multimeter to see where is ground! Or if you can see that there is a connection from that ground area to any pin (perhaps not one of the ones I marked).

rawhid.dll?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 18 May 2013, 06:43:38
Fail only with the wire connected. I'll test it with the multimeter.
Quote
If that all looks good, you can start editing a new config file, replacing all the UNASSIGNED entries with useful HID codes (such as A or SPACE, see the Codes page of the docs). So you press Q, see what the code is, plug Q into the config at the right place. Rinse and repeat!
Thats the reason why I mentioned the rawhid.dll, I don't know which file is  :))

One thing I dont understand, this what the hid_listen capture;
(http://oi39.tinypic.com/308gld1.jpg)

Each key must have an individual code? 
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 06:51:50
Oh, the Soarer Config file... is kevex.sc. It's just a text file.

I think that resistor pack I mentioned needs to come out. It seems to be effectively shorting all the sense lines together, because you should only get one \ and one / per key.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 18 May 2013, 07:18:57
Resistor pack = (http://oi43.tinypic.com/2w6xle8.jpg) ?

Only remove the cilindric ones? Should I cut them?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 07:27:35
Nono... only the greeny-white one at the end. It looks like it's in a socket, so remove it like the chips.

[attachimg=1]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 18 May 2013, 10:28:06
Done, now it only show 2 digits  :cool: Now Im trying to find the ground pin
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 11:03:59
Done, now it only show 2 digits  :cool: Now Im trying to find the ground pin

Cool! The ground might still turn out to be where I thought, since that resistor pack was getting in the way.

Now that the matrix is working, you could add a line to the matrix section of the .sc file to activate the blocking function, because the matrix doesn't have diodes. It can go anywhere, but near the beginning is logical...

Code: [Select]
matrix
    scanrate 1
    debounce 5
    blocking

    sense           PB0         PB1     PB2         PB3     PB4     PB5         PB6         PB7
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 18 May 2013, 11:07:50
With the pin connected to the double circle on(top right), the hid listen detect the keys , but shifts and reset still unnoticeable.
I've tested it with the multimeter and the double circle pin with the shift goes to ~0.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 12:49:52
Hmm, 'unstrobed' isn't working for me either - I must've broken something in the code :(
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 13:22:52
And indeed I had - simply hadn't joined up two bits of code...

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 18 May 2013, 13:27:25
YES! Shifts and reset keys now working!!!  :p
Later I'll try to map the keys, hope it works

Thanks again! W/o you this wouldn't be possible
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 13:36:18
Excellent! I'm not sure if you're lucky or unlucky to be the first... anyone else can use all these posts as a guide :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 18 May 2013, 16:36:35
Hmm, I don't understand pretty well how to config the kevex.sc, for e.g I press the "a" key, hid_listen shows;
\01
/01

Now I go to the kevex.sc, open with the notepad, and see this;
Quote
# Matrix config for kevex ray 7000CM

matrix
   scanrate 1
   debounce 5

   sense         PB0         PB1      PB2         PB3      PB4      PB5         PB6         PB7
   strobe   PD7      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PE0      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PE1      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PC0      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PC1      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PC2      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PC3      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PC4      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PC5      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PC6      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED
   strobe   PC7      UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED   UNASSIGNED

   unstrobed -PD0   UNASSIGNED
   unstrobed -PD1   UNASSIGNED
   unstrobed -PD2   UNASSIGNED
end
[/spoiler]

Strobes and PB define the matrix(?) Where I have to put the 01? in which form? 01 A , 0x01 A, 0x04 = 0x01 ?
For e.g;

 
Quote
       unstrobed -PD0   0x058 Reset
   unstrobed -PD1   0x059 LShift
   unstrobed -PD2   0x05A Rshift
?

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 16:48:05
The thing to enter is a 'Name' from the Codes page of the docs, so for the shifts...

Code: [Select]
    unstrobed -PD1 LSHIFT
    unstrobed -PD2 RSHIFT

The matrix position is worked out from the code such that 00 is top-left, increasing along the first row until 07. Then the second row is from 08 to 0F. Then the 3rd and fourth rows are codes beginning with 1, and so on.

Again, just put a name in each position of the matrix. Many are obvious, so you won't even need to look them up in the Codes list, e.g. A, B, C,... 1, 2, 3, ... F1, F2, F3, ... :D

So if you found that 00=A, 01=B, 02=C, ..., 07=H, then you would enter them in like this:

Code: [Select]
   sense         PB0         PB1      PB2         PB3      PB4      PB5         PB6         PB7
   strobe   PD7  A           B        C           D        E        F           G           H

To give another example, this is the config I made for my mini keyboard:

Code: [Select]
led caps -PC6
led scroll -PC7

matrix
    scanrate 1
    debounce 5

    sense           PB0         PB1 PB2         PB3 PD0 PD1         PD2         PD3
    strobe  PF0     ESC         2   4           5   7   9           MINUS       LCTRL
    strobe  PF1     1           3   UNASSIGNED  6   8   0           BACKSPACE   LGUI
    strobe  PF4     TAB         W   R           T   U   O           LEFT_BRACE  LALT
    strobe  PF5     Q           E   BACKSPACE   Y   I   P           RIGHT_BRACE UNASSIGNED
    strobe  PF6     CAPS_LOCK   S   F           G   J   L           ENTER       RALT
    strobe  PF7     A           D   SPACE       H   K   SEMICOLON   UNASSIGNED  MENU
    strobe  PB6     LSHIFT      Z   C           V   N   COMMA       FN2         RCTRL
    strobe  PB7     FN1         X   UNASSIGNED  B   M   PERIOD      RSHIFT      UNASSIGNED
end
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sat, 18 May 2013, 18:32:42
YESSSSSSS! I'll post the good video when finished  :cool: .
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 18 May 2013, 19:17:56
Haha, that's fantastic! You're welcome!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Sat, 18 May 2013, 21:35:08
That's great. I watched it from the beginning, and looks very nice. We can try those Chinese/Japanese IBM keyboards now. Thanks to Soarer & Retrete.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Wed, 22 May 2013, 15:23:41
GOOD video  :p
feature=youtu.be
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 23 May 2013, 16:00:28
I didn't realise you were going to do that with a screen, and keeping the whole casing... it's very cool indeed!  :cool:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 23 May 2013, 16:18:30
We can try those Chinese/Japanese IBM keyboards now.

Indeed, I should be taking mine apart to see what's what soon.

I'm currently mulling over what options to make available for the first proper controller release - a tricky balance between putting in as much as possible, but nothing that I might want to change later (legacy support is painful)!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 28 May 2013, 06:43:34
Soarer, If I press some keys together(general more than 3) some unpressed keys activate, is this normal ?

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 May 2013, 07:33:55
Soarer, If I press some keys together(general more than 3) some unpressed keys activate, is this normal ?

Did you forget to add this line to the config file?  ;)

Now that the matrix is working, you could add a line to the matrix section of the .sc file to activate the blocking function, because the matrix doesn't have diodes. It can go anywhere, but near the beginning is logical...

Code: [Select]
matrix
    scanrate 1
    debounce 5
    blocking

    sense           PB0         PB1     PB2         PB3     PB4     PB5         PB6         PB7

Or did I break it? :-[  I did test it once, but probably before the beta3 version.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 28 May 2013, 09:55:45
If I put the "blocking" ;
error at line 6, invalid arguments

Do the "blocking"need to be together something? Or it just go like you wrote it?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 May 2013, 10:59:34
Oops, sorry, it needs a 1 after it... blocking 1 :-[
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 28 May 2013, 11:08:59
Now compiles w/o problems, but still the same "issue"
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: tufty on Tue, 28 May 2013, 13:52:57
Soarer - I've not been watching this closely, but if I gather correctly, this is "hardwiring a keyboard matrix to soarer's code", right?

If that's the case, how many keys do you reckon I could handle on a Teensy 2.0 (not a teensy++)?  I'm thinking the ADB circuitry in the M0116 might just go the way of the dodo
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 May 2013, 14:46:00
Now compiles w/o problems, but still the same "issue"

Found the problem, it was in scas...
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 May 2013, 14:56:20
Soarer - I've not been watching this closely, but if I gather correctly, this is "hardwiring a keyboard matrix to soarer's code", right?

If that's the case, how many keys do you reckon I could handle on a Teensy 2.0 (not a teensy++)?  I'm thinking the ADB circuitry in the M0116 might just go the way of the dodo

That's right, this will be 'SoarTroller' or whatever  ;D

Number of keys depends on the size of the matrix - especially for a non-NKRO matrix it's quite common to have a few gaps, e.g. so that modifiers don't ghost with anything else. Teensy 2.0 might be enough for the M0116, but perhaps only just - a quick count of lines here (http://deskthority.net/w/images/b/b1/Apple_M0116_circuit_board.jpg) gives maybe 24 (8x16?), which is pushing it and leaves no room for LEDs.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Fawksie on Tue, 28 May 2013, 17:43:06
Another satisfied customer, thanks Soarer :)

This is a 1986 Model M 122-Key Typewriter Keyboard. A few months older than me.

[attach=2]

Wiring isn't particularly well thought out. I could have made it much neater looking with some more effort and willpower. No-one can see it in a box anyway! Spare pins on the 10 pin connector are for lock LEDs.

[attach=1]

More photos (http://imgur.com/a/n65rf)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 28 May 2013, 20:03:53
Now compiles w/o problems, but still the same "issue"

Found the problem, it was in scas...

Now it detect even less keys  :( , muuuuuch slower when I press more than 2, but I think Im making some part of the process wrong, steps I did;

- Open teensy.exe , load hex and reboot
- Drop kex.sc (already mapped config) to new scas.exe
- kex.sc.scb created , load into scwr.exe
- Open keyboard tester

The problem now is the first part, I need to press the reset button and opening again the case its like a nightmare, is there a way to avoid pressing the key?
Dropping kex.sc now result in the 1/10 sec screen and no kex.sc.scb created.

Does the scaswr.bat depends of the actual scas.exe and scwr.exe on the folder?
Also observed,  If I remove the blocking 1, while having the same issue Im able to press much more keys.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 May 2013, 20:54:02
Now compiles w/o problems, but still the same "issue"

Found the problem, it was in scas...

Now it detect even less keys  :( , muuuuuch slower when I press more than 2, but I think Im making some part of the process wrong, steps I did;

- Open teensy.exe , load hex and reboot
- Drop kex.sc (already mapped config) to new scas.exe
- kex.sc.scb created , load into scwr.exe
- Open keyboard tester

The problem now is the first part, I need to press the reset button and opening again the case its like a nightmare, is there a way to avoid pressing the key?
Dropping kex.sc now result in the 1/10 sec screen and no kex.sc.scb created.

Does the scaswr.bat depends of the actual scas.exe and scwr.exe on the folder?
Also observed,  If I remove the blocking 1, while having the same issue Im able to press much more keys.

This will annoy you... you didn't need to reset the Teensy :(
It only needs to be reset to load a new firmware (.hex).
And double-clicking scboot.exe will reset it, if my firmware is running. (It can sometimes take a while for the Teensy loader to find the Teensy after that, but only some seconds).

scaswr.bat simply runs scas.exe and then scwr.exe - those exes need to be in the same folder as it.

Droppping a .sc file onto scas.exe will just print an error message and disappear in a split second.

Dropping a .scb onto scwr.exe should work, but again it will disappear in a split second so you won't see if it has worked.

Both of those are command line utilities, so use scaswr.bat if you want to just drop the .sc file.

I admit that the blocking function is a bit severe - perhaps it could pass a few more keys in certain circumstances. I'll probably work on that once I've hooked up a non-NKRO matrix myself.

The slowness sounds like a problem - what sort of slow are we talking about?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 28 May 2013, 20:58:50
Another satisfied customer, thanks Soarer :)

Very nice build! The wiring looks pretty neat to me :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Wed, 29 May 2013, 05:22:53
Blocking 1 doesn't activate non pressed keys,but If I try pressing near keys of the already pressed it doesn't work.
Blocking 1: no pression error and works well with non near keys
No blocking: pression error but all keys working.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 29 May 2013, 06:54:43
Unfortunately, those are the options when the matrix doesn't use diodes to prevent the erroneous key presses :(

I might be able to improve it, but only slightly - are there combinations that you want to use that are prevented with blocking 1, but work fine without it and with no erroneous key presses?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Wed, 29 May 2013, 07:12:05
No no, It doesn't matter, it works fine now. I don't press more than 2 or 3 keys at the same time, and the normal 3 or 4 keys combos on shooters works fine.
No more fail clicks  :p
Thanks a lot for your help!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 29 May 2013, 07:40:11
OK, cool! Any combination of two keys should work, but there will be cases where a third key gets blocked. The shift keys are never blocked because they have their own connections, but whatever you've mapped for controls and alts count towards blocking, since they are part of the matrix. Worst case, something like ctrl-alt-del might not work!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: tufty on Wed, 29 May 2013, 11:06:09
Soarer - I've not been watching this closely, but if I gather correctly, this is "hardwiring a keyboard matrix to soarer's code", right?

If that's the case, how many keys do you reckon I could handle on a Teensy 2.0 (not a teensy++)?  I'm thinking the ADB circuitry in the M0116 might just go the way of the dodo

That's right, this will be 'SoarTroller' or whatever  ;D

Number of keys depends on the size of the matrix - especially for a non-NKRO matrix it's quite common to have a few gaps, e.g. so that modifiers don't ghost with anything else. Teensy 2.0 might be enough for the M0116, but perhaps only just - a quick count of lines here (http://deskthority.net/w/images/b/b1/Apple_M0116_circuit_board.jpg) gives maybe 24 (8x16?), which is pushing it and leaves no room for LEDs.
Well, LEDs I can live without.  There's no LEDs on the board right now, after all :)

And if I were to bin the circuit board and hardwire my own NKRO matrix with diodes and all the works? Yes, that would really make it a custom keyboard in a retro case.  I think I could probably get away with doing so; the switches are plate-mounted, so the PCB isn't doing much structurally, right?

Alternatively, I suppose I could get back to hacking on Hasu's code to improve the ADB side of things.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 29 May 2013, 12:02:15
Some plates are pretty flimsy, and/or don't hold the switches firmly, so you'd need to check. You could still use the PCB as structure, just cut lots of tracks - you might be able to leave all the column (or row) tracks as they are, and just isolate the other side of each switch so you can add in a diode and rewire just the rows (or columns).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Sun, 02 June 2013, 19:35:53
I have accidentaly broke one of the pin sockets of the teensy, this one;
(http://oi40.tinypic.com/e5iuch.jpg)
Is it possible to reconect it to another free-socket of the teensy? maybe D6?

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 02 June 2013, 19:52:49
:(

Yep, just rewire it to another pin. But not PD6, since it has the onboard LED attached to it already. PD5 would be fine, for example.

Then reconnect the USB, change the config file to match the new pin, drop it on scaswr... and it should work!

The only reason I picked out the current set of pins was to keep the wiring simple :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 03 June 2013, 03:28:28
PD5,PD4 or PD3 also doesn't work, but PD7 (already asigned to a column) works, could it be the hex loaded onto the teensy?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 03 June 2013, 03:40:20
Did you edit your .sc to change the relevant strobe line, and load it back on?

I used those 3 pins for LEDs on the converter, so maybe there is a bug and they're not fully disabled. Any of the PF pins wouldn't be affected by such a bug, so you could try one of those. Otherwise I'm pretty sure the .hex is OK.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 03 June 2013, 03:53:21
Im testing it with original kevex.sc (nothing mapped) and the HID listen, and it reports nothing  :confused:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 03 June 2013, 06:38:48
You'll need to change the line that starts 'strobe PC7' to start 'strobe PF7', or whichever pin you use.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 03 June 2013, 12:14:16
Oh, I feel 100% retard  :D

Thanks!Working again
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 03 June 2013, 13:52:40
Good!

(Not the retard part, the working again part)!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 03 June 2013, 19:40:05
Soarer, do you know If the Model M 122 key which uses an (rj45?) connector could be  teensied?
Some pics;
(http://oi41.tinypic.com/2rf3afl.jpg)
(http://oi43.tinypic.com/majp12.jpg)

Also, If you want one, its yours  :cool: .

 BUT,you have to pay the shipment, or come to Madrid  :p
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 04 June 2013, 07:42:35
Thanks :D But actually I already have one! It works fine through my converter - the signals and codes are the same as for the 122-key with the 240 degree DIN connector. The pinout details are in the OP and the docs - you could make an adapter, replace the connector, or just wire it direct to the Teensy :cool:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Tue, 11 June 2013, 21:41:48
I will "waste" the teensy with a 1986 Ibm model F 122key.
The strange thing is that I don't find anything related to his code number,
(http://oi39.tinypic.com/m8lmc4.jpg)

And the other part that no one mention;
(http://oi40.tinypic.com/2cx832c.jpg)

It uses this type of connection;
(http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png)

Any ideas?
Thanks in adavance!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 12 June 2013, 15:40:27
Hmm... looks like an M to me, since it has a white underside. The last couple of digits of the model number are usually what varies depending on the key legends for different countries - try searching for 1390401 instead.

DIP switches, or jumpers on some, are only used to set the keyboard ID, and don't affect the function at all.

Everything I've seen with that connector speaks scan code set 3, and sends a unique code for each key :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: connection on Wed, 12 June 2013, 18:00:03
Hello,
Thanks for this great piece of software! I have 15 old terminal Model M:s, and I've now converted most of them into USB by gluing Teensies inside the keyboards, and placing the mini USB connector directly at the back of the keyboard.

However, I have encountered a problem using the full USB HID mode in Linux, where everything works great, except for the delete key, that doesn't repeat when being held down. In hid_listen everything looks as it should, but somewhere along the way the key repeat doesn't work. I'm not sure if it's a bug in the converter software, in the Teensy hardware, or in the Linux kernel. Everything works fine using the USB boot mode, but as the default is to use the HID mode when available, it would be nice to get some hint on where the fault lies.

When running
Code: [Select]
/lib64/udev/keymap -i /dev/input/event2 on a Gentoo machine with 3.9.4 vanilla Linux kernel, hidraw/hid-generic driver and udev-204, i get this message when pressing delete:
Code: [Select]
driver did not send SYN event in between key events; previous event:
scan code: 0x7004C   key code: delete

All other keys work fine, without any error output, and everything works fine in the USB boot mode in Linux, and also in Windows and OSX. For Windows and OSX, I'm however a bit unsure whether they use the boot mode, or the full HID mode. The other USB keyboards that I tried in Linux seemed to use the boot mode.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 12 June 2013, 18:43:49
Oh yeah... I'm seeing that on Linux Mint 14 MATE 32-bit as well. Maybe it is another Linux bug! :p

Generally BIOSs use boot mode and OSs use full mode, which holds true for Windows, Linux and OS-X.
PS3 just pretends to have a HID stack :'(

The last Linux bug I had to workaround (http://geekhack.org/index.php?topic=17458.msg339706#msg339706) was its handling of the backslash and europe_1 codes. This seems somewhat similiar, since whenever I press some key while delete is held, I also get a delete!

But which other code is it confused with this time? There's no obvious candidate, is there?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Wed, 12 June 2013, 20:07:43
Hmm... looks like an M to me, since it has a white underside. The last couple of digits of the model number are usually what varies depending on the key legends for different countries - try searching for 1390401 instead.

DIP switches, or jumpers on some, are only used to set the keyboard ID, and don't affect the function at all.

Everything I've seen with that connector speaks scan code set 3, and sends a unique code for each key :D

Today I opened it and this is what I've found, no model F?  :eek:
http://imgur.com/a/jtYz1

The rarest model M is mine  :p
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 12 June 2013, 20:47:42
Definitely an M - you can see the membrane! IBM made two versions of the early 122-keys (with square label and 'hat' keys in alt and ctrl positions) -  some F, some M. The easiest way to tell them apart is the colour underneath - black metal for F, white plastic for M. They look identical from above :-\
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 12 June 2013, 22:09:20
But which other code is it confused with this time? There's no obvious candidate, is there?

Ah-ha! Someone (https://github.com/torvalds/linux/commit/437f3b199c437e2a9ac01b9ab733c78e5fc7c720) has made exactly the same mistake again :'(

The boot mode (http://lxr.free-electrons.com/source/drivers/hid/usbhid/usbkbd.c) handling is fine for Delete - there's only one entry in that table with the code 111, at position 0x4C (the HID code for Delete).

Since v3.0, the full mode (http://lxr.free-electrons.com/source/drivers/hid/hid-input.c?v=3.0) has two entries with code 111, the other is 'Clear' (HID code 0x9C). v2.6.39 (http://lxr.free-electrons.com/source/drivers/hid/hid-input.c?v=2.6.39) didn't have that entry.

Not sure how Linux should be fixed, but certainly the current method of combining two input codes to one event code is insufficient. It could either pass unique event codes to the next stage, or handle the combination with specific code at the driver level - it just needs to be an 'or' of the keys, I think, but in the driver doesn't seem to be the right place to do it!

I guess I'll just have to work round it again, by removing the 'Clear' entry from my NKRO report :mad:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: connection on Thu, 13 June 2013, 14:21:24
Yes, that actually seems to be a bug in the kernel. If a keyboard has a Clear key, it should give a separate keycode from Delete all the way to the userland. If a buggy keyboard sends Clear instead of Delete, it's that keyboard that should be fixed, and not replacing the standard code in the kernel to make it work. To me, this sounds like it might be worth sending in a kernel bug report, although those always take a long time to get fixed in cases like this.

I looked into the rest of the kernel translation table, and compared to Microsoft's Microsoft's HID code list (http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf), and I found out that the kernel even has three HID codes that translates to 111: 4C (Delete), 9C (Clear), and D8 (Reserved). There's also some other duplicates, that translate reserved keycodes to standard ones, like 7E/F4 -> 136, 7F/EF -> 113, 80/ED -> 115, and 81/EE -> 114. There's also the 31/32 -> 43 (\ / Europe 1), that you mentioned that you've fixed before, where the kernel behavior however might be correct, as they had the same keycodes in PS/2.

On the other hand; even though it seems wrong to do translations like this in the kernel for standard keyboards, a really large keyboard, with more than 255(?) keys, could in theory have two keys that would translate to the same keycode with the standard driver, and where the users then could add a custom kernel driver to get the full functionality. For these cases, this kind of behavior from the kernel driver might come up in more cases in the future. I don't know how you send your keypresses and then clear them, when they're not pushed down any longer, but it might be worth checking if you could change your code to assume that the host is "buggy" like this for all the keys.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 13 June 2013, 16:06:24
My converter's NKRO report just has a bit for each HID code, in numeric order. So as the driver scans through it, it first finds the pressed 'Delete' code and sends an event, then finds the unpressed 'Clear' code and sends another event. Clearly this is unexpected to some other bit of code, which complains about the lack of SYN! (Whatever that is...).

So the only way to work around it is to make my converter only send one of the codes that have duplicated event codes :(  It's no great loss, but key codes that are otherwise ignored by OSs can be handy if you want to trigger some macro software with them.

The reserved codes don't cause a problem, because my converter doesn't try to send them anyway. No idea what device those mappings were put in for... the change was so long ago that it predates a big code reorg in 2006 (https://github.com/torvalds/linux/commit/dde5845a529ff753364a6d1aea61180946270bfa)!

Fixing it within the driver level would at least keep the fix fairly self-contained, with less chance of unintended consequences. Browsing around the code, I can't figure out why it is sending an event for the Clear code, since it hasn't changed... surely an event should only be generated when the state of something changes?! hid_input_field (http://lxr.free-electrons.com/source/drivers/hid/hid-core.c#L1057) seems to be where state changes are turned into events, calling hid_process_event and then hid_input_event. I dunno though!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 13 June 2013, 18:29:16
v1.12 added to the first post, which should make Delete work correctly again on v3.x Linux kernels :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: connection on Fri, 14 June 2013, 08:53:52
I've upgraded to v1.12 now, and now the delete repeating works as supposed to, and I haven't noticed any weird side effects. Thanks!

What would happen with your code now if the kernel developers suddenly decides to create even more duplicated event codes of some other key (like adding an extra Enter key code as A0/Out)?

The missing SYN error might have come from the driver, and not from your the data that the converter transfers. The keymap tool is an extra feature in udev for parsing the kernel driver output. A comment about the SYN parsing from the code (http://cgit.freedesktop.org/systemd/systemd/plain/src/udev/keymap/keymap.c):
Code: [Select]
/* Drivers usually send the scan code first, then the key code,
 * then a SYN. Some drivers (like thinkpad_acpi) send the key
 * code first, and some drivers might not send SYN events, so
 * keep a robust state machine which can deal with any of those
 */
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 14 June 2013, 09:45:40
v1.12 added to the first post, which should make Delete work correctly again on v3.x Linux kernels :D

I think I am running v1.1 from several months ago, are there important changes recently?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 14 June 2013, 09:48:44
I've upgraded to v1.12 now, and now the delete repeating works as supposed to, and I haven't noticed any weird side effects. Thanks!
Great!

What would happen with your code now if the kernel developers suddenly decides to create even more duplicated event codes of some other key (like adding an extra Enter key code as A0/Out)?
I'd have to remove Out from the report as well :( It's a pain because each one of these grows the descriptor by 22 bytes, which might cause its own problem at some point. I'll just have to keep an eye on that table for now, until I can think of a good way to phrase a bug report such that it gets some action (if they see it as just one DIY project that's acting up, it won't get fixed!).

The missing SYN error might have come from the driver, and not from your the data that the converter transfers. The keymap tool is an extra feature in udev for parsing the kernel driver output. A comment about the SYN parsing from the code (http://cgit.freedesktop.org/systemd/systemd/plain/src/udev/keymap/keymap.c):
Code: [Select]
/* Drivers usually send the scan code first, then the key code,
 * then a SYN. Some drivers (like thinkpad_acpi) send the key
 * code first, and some drivers might not send SYN events, so
 * keep a robust state machine which can deal with any of those
 */
I see, so the SYN error is clearly secondary. It's still a useful flag that things have gone wrong though, since the HID keyboard driver normally sends it. Tracking down the 'if' that stops it being sent might give another clue!

Hmm. There might be multiple ways to fix the problem... I'm still not sure exactly what the problem is though, apart from being related to those duplicated codes. I think I might have been wrong about where state changes are converted to events - the bits of my report are flagged as 'variable', which appears to be handled differently (with no obvious comparison to previous state in hid_input_field). Maybe it's even after the lookup table is used, which would make sense given the observed behaviour.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 14 June 2013, 09:52:13
v1.12 added to the first post, which should make Delete work correctly again on v3.x Linux kernels :D

I think I am running v1.1 from several months ago, are there important changes recently?


Since you're not running Linux, not using an RT keyboard, and don't have any problems with your BIOS - I'd say stick with v1.1 :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: poxeclipse on Sun, 16 June 2013, 09:16:26
Question:
Is it possible to transplant the electronics part of a Model F which has a known protocol to a Model F with an old protocol ?
For instance, to transplant from an F-122, or XT, to a 3178 Model F.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 16 June 2013, 14:54:02
I really don't know!

The XT controller is built onto the main PCB, so you'd have to saw it off!

A 122-key F controller might be a better bet, BUT...

The replacement would have to have at least as many strobes (columns) AND at least as many senses (rows) as the original.

There's at least two kinds of capacitive sensing chip - one with 4 channels and one with 8. The 122 has the 8-channel version, I've no idea what the 3178 has. The ones that use the 4-channel sense have twice as many strobes.

The ROM on the replacement would need to output a code for each key. (The 122-key can output a code for all (or all but one?) of its key positions, so unlikely to be a problem with that one).

Most IBM controller ROMs have a table that adjusts the sensitivity of the sensing for each key - these wouldn't necessarily be the same for different keyboards, in fact most likely different. So it might be unreliable.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 05 July 2013, 09:51:56
I'm back. I have been worrying with this problem off and on for at least 6 months. I have a couple of XTs that I want to test and sell, but they won't perform for me.

I have an outboard Teensy with a variety of plugs and adapters XT-to-AT then AT-to-PS2, PS2 hard-wired to the Teensy.

The keyboards act dead and do not register anything, except when I plug everything up, start hid_listen, and hot-plug the USB I get this:

then nothing else.

What is the 05 error, and is it a wiring mix-up? Thanks!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 05 July 2013, 10:18:10
XT-to-AT? They're the same!

Normally I'd say clock and data swapped for R05, but then you'd get errors with each key press too.

Does the converter work OK with a PS/2 keyboard?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 05 July 2013, 14:26:38
Soarer, as always, you da man.

Even when you don't solve my problems directly, you set me on the path to finding and fixing them myself.

There was one problem in my wiring, as I had added pull-up resistors after the fact, and one of those legs was wrong.

But the real underlying problem was a bad PS2 socket! My female pigtail to the Teensy was the end of a male-female PS2 extension cord which I had chopped off and attached to the Teensy. Apparently, at least one of the contacts inside was bad and was hardly, if ever, making contact with the pin from the male plug on the keyboard cable. I have soldered a straight (sewing) pin onto one probe of my tester, so it was probably going in deep enough, while the proper pin was not.

I found a female AT socket and pigtail from an old AT-to-PS2 connector (you were right of course, I listed too many connections in my earlier post - looking at the snakepit on my desk is confusing) and took that to the Teensy.

That worked and so did both of the XTs. Since I will probably not need a female PS2 pigtail to the Teensy anyway, I will leave it with the female AT socket. I have enough adapters to get by, although I have not yet built a female-RJ45-to-male-AT yet.

Thank you, sincerely, as always! Harry
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 05 July 2013, 17:11:33
Ah, good! That's just bad luck with that connector... would've been tough for me to figure that one out remotely, so I'm glad you did!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: finaltheorem on Sat, 13 July 2013, 23:51:18
Hi Soarer, and everyone.  Just wanted to say thank you for putting this out for everyone to use :)  Very useful, and much easier than someone lacking experience with such things might assume.  I just finished putting together a "quick and dirty" implementation of Soarer's tool and I'm really a complete newb when it comes to wiring/soldering.  It worked first try  :D  I've got my inexpensive terminal keyboard hooked up to the Teensy 2.0 now and it's working great!
[attach=1]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 15 July 2013, 06:51:51
Excellent... heatshrink is a nice touch! :D

One thing: the blue wire you've got going to PB7 should go to ground instead, it's the shield for the cable. (Actually, it needn't be connected at all usually, the other ground is used to to ground the metal parts inside the case).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: finaltheorem on Mon, 15 July 2013, 08:09:45
Excellent... heatshrink is a nice touch! :D

One thing: the blue wire you've got going to PB7 should go to ground instead, it's the shield for the cable. (Actually, it needn't be connected at all usually, the other ground is used to to ground the metal parts inside the case).

Ahh, thanks for information!  I was confused about that one since the wire was about twice as thick as the rest.  At least I didn't burn up the teensy by incorrectly guessing where it should go. 

I've got a nicer copy of this board (with all the keycaps) and I don't want to lop the connector off that one.  I'm going to use a keystone jack to convert RJ-45 to PS/2 male, so I'll make sure I splice those two (the white ground and black ground) together to the ground. 

Thanks again  ;D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 15 July 2013, 08:38:59
Hi! A few questions before I teensy the 122 M;
(http://oi43.tinypic.com/70evlj.jpg)
Is the red circle a ground connection?

I'm planning to install the teensy inside the case (plastic) , could I just glue it?
Thanks in advance!

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 15 July 2013, 09:44:24
Yup, that's a ground connection. There's clearly a PCB trace between that and the ground on the connector though, so there's no need to connect both!

Hot glue might work OK and still be removable without damaging the Teensy. Or double-sided sticky foam tape. Or maybe there's somewhere you could cable-tie the Teensy to?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Mon, 15 July 2013, 12:15:37
Before trying to install it, where should I connect each? (http://oi44.tinypic.com/dc818w.jpg)

Thanks again soarer
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 15 July 2013, 14:53:47
From fohat's crib sheet...

[attachimg=1]

So like this...

[attachimg=2]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 15 July 2013, 16:20:30
From fohat's crib sheet...

What! I thought that I had gotten that from you!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 15 July 2013, 16:27:26
From fohat's crib sheet...

What! I thought that I had gotten that from you!


The pic of the label could well be mine, but not the other - easier to understand - diagram :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Glod on Mon, 15 July 2013, 19:25:36
another satisfied customer!, this is extremely easy to assemble, especially considering i am just doing ps/2


here is my sad attempt at making a minimalist converter for ps/2. used the female end of a ps/2 extension cable.
(http://farm6.staticflickr.com/5350/9294663103_2ca844fb36_n.jpg) (http://www.flickr.com/photos/panicfx/9294663103/)

(http://farm6.staticflickr.com/5458/9297438640_9f424024b0_n.jpg) (http://www.flickr.com/photos/panicfx/9297438640/)

(http://farm6.staticflickr.com/5537/9294665921_b8886d89f0_n.jpg) (http://www.flickr.com/photos/panicfx/9294665921/)


it is ugly but eh it works so i am not complaining

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: finaltheorem on Thu, 18 July 2013, 11:28:15
I’m afraid I may have done something a bit stupid while trying to restore a badly corroded IBM 5150 XT board.  I separated the front and rear plates that sandwich the PCB, cleaned the corrosion off with sandpaper, then spray painted both the front and back plates (including the side of the rear plate that contacts the PCB).  I used silver paint which presumably has metal flakes in it, in case that’s relevant. The piece of foam between the front plate and the switch barrels was badly degraded, and when I washed it (to get rid of a musty odor) I believe it may have lost some of its density/thickness. 

Now when I plug it into the converter I get no output from typing on AquaKeyTest.  HID_listen shows no output when pressing most keys, but does give error codes (r00 or r80) when pressing some keys on the bottom row.  When I pick up the PCB housing I get a continuous stream of error codes, with occasional (seemingly valid) key codes mixed in.  Despite these valid codes being mixed in with the error codes, no key presses register while this is happening.

I know the board worked before I attempted this “restoration” because I tested every key beforehand.  Also, I have a second identical board that I haven’t taken apart yet which still works fine with the converter.  Now, I’m stuck wondering what I’ve done to screw this up.  Does anyone know whether these symptoms could be caused by the foam layer being too thin, or is it more likely I shouldn’t have painted the back plate?  I know it’s not related to Soarer’s converter, but for some reason I thought this might be a good place to ask.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 18 July 2013, 12:28:51
I am sorry, I guess that I did not answer your previous question quickly enough.

The "foam mat" has a foam side and a rubber "skin" side I would call it. The foam deteriorates and falls off, leaving a very thin skin.

I have re-used partially deteriorated thin ones which worked OK, but, unlike the M, that foam mat is an actual "bedding" material that helps hold the barrels (aka chimneys) in place in both directions. However, I doubt that is enough to keep it from working at all. You may be right about the paint making some sort of electrical interference.

My recommendation is to cut a new foam pad, you will need that for sure. If that doesn't fix it, strip the paint from the inside of the plate.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Retrete on Thu, 18 July 2013, 16:13:52
122 M works nice! I'll post some pics in a few days, right now I'm using a standar mini usb cable and this keyboard deserves a better one  :p

Thanks again Soarer! Remember that If you want an extra 122 M I have one here with your name  :cool:


 
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: finaltheorem on Thu, 18 July 2013, 17:31:38
Thanks fohat, and no need to apologize, of course.  I always tend to venture off and make expensive mistakes – it’s how I learn  :))

In this case everything turned out well though. I figured I would try the simplest solution first and added a sheet of paper between the PCB and the rear plate that I painted and everything was working again.  I can’t say for sure whether this is a result of the paper or just some other little thing that was fixed by disassembly/reassembly, but in the future I’ll avoid painting the metal behind the PCB.  I'm saving the foam mat replacement for another day - I've had enough of disassembling and reassembling Model F's for a while.
Thanks for your help :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 18 July 2013, 19:58:27
Thanks fohat, and no need to apologize, of course.  I always tend to venture off and make expensive mistakes – it’s how I learn  :))

In this case everything turned out well though. I figured I would try the simplest solution first and added a sheet of paper between the PCB and the rear plate that I painted and everything was working again.  I can’t say for sure whether this is a result of the paper or just some other little thing that was fixed by disassembly/reassembly, but in the future I’ll avoid painting the metal behind the PCB.  I'm saving the foam mat replacement for another day - I've had enough of disassembling and reassembling Model F's for a while.
Thanks for your help :)


The small ones are much easier to get back together than the big boys, but those clamps that I show in my guide make it A LOT easier.

A sheet of mylar or sturdy plastic would probably be preferable to paper as a separator.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 21 July 2013, 19:11:43
I need a female connector for a terminal keyboard. I have built the outboard Teensy converter, and I have various adapters for different plugs, except for the terminal connection.

It seems to be the same configuration as an ethernet plug, I have an old Intel 10/100 socket on its pigtail that the plug from an M-122 seems to fit snugly. (I don't have an actual M-122 any more, but I have the cord, and I am just testing for continuity.) I can get a signal through for 5V and ground, but clock and data do not seem to be touching anything.

I know that the specific plug is 8P5C. Does that mean I need a specific female 8P5C? I was assuming that I could connect whichever of the 8 I needed and ignore the rest of them. Is that not true?

If not, what female connector do I need? I would prefer a beige or gray one on a pigtail, but, whatever.

Thanks!

edit   - the keyboard cord tested OK. I think that the 10/100 socket may be bad. some wires seem dead. more later
edit 2 - I had a similar socket (branded IBM) and the same thing happened - signal on 5V and ground but not data or clock

Are these connections prone to failure? Perhaps this is what I get for diving into the junk drawer.

edit 3 - this seems ludicrous, but I think I have a female-RJ45-to-USB-male connector. I could go from the back of the USB to a PS2 couldn't I? That would really be going around Robin Hood's barn, but might it work? Are 5V, ground, data, and clock always in the same place? Otherwise I could cut a USB cable and cross it over wherever I needed.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 21 July 2013, 19:48:46
Does it have 8 wires?

Quote
10BASE-T and 100BASE-TX only require two pairs to operate, located on pins 1 plus 2 and pins 3 plus 6.

Unfortunately, not the ones we want!

So, if it only has those four, you'd have to open it up and see if you can rewire it - it possibly has a fairly generic breakout PCB insde. If it can't be opened, buying an ethernet extension cable might be the easiest way to get a pigtail.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 21 July 2013, 19:58:44
Does it have 8 wires?

Quote
10BASE-T and 100BASE-TX only require two pairs to operate, located on pins 1 plus 2 and pins 3 plus 6.

Unfortunately, not the ones we want!

So, if it only has those four, you'd have to open it up and see if you can rewire it - it possibly has a fairly generic breakout PCB insde. If it can't be opened, buying an ethernet extension cable might be the easiest way to get a pigtail.

OK, that is borne out by my experiment. Even though it looks like I have 8 copper tracks in the socket, and 8 wires, not all seem "live" when tested.

The diagram makes it look like I need the innermost 4 connections, which must be numbered 3-4-5-6 regardless of which side you are counting from.

That probably means that those RJ45-to-USB connectors I have will not work, either, because they are tracking different connections.

So is there an 8P8C socket that I can buy where everything is actually connected?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 21 July 2013, 20:12:57
Any CAT5e extension cable will have all 8 pins wired, so that's the safest bet if buying something.

The RJ45-to-USB thingies, who knows! They might have wired all 8, even if they weren't going to use them.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 21 July 2013, 20:58:54
Any CAT5e extension cable will have all 8 pins wired, so that's the safest bet if buying something.

The RJ45-to-USB thingies, who knows! They might have wired all 8, even if they weren't going to use them.

I will look for a CAT5 extension cable.

How could the RJ45-to-USB adapter wire all 8? Doesn't USB have only 4 slots? You can't "double up" can you?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 21 July 2013, 21:11:54
Oh... are they just wiring adapters to use ethernet cable as USB? Or are they active devices to give you proper ethernet?

If the former, then yeah, I guess they'd use the same 4 pins as 10 and 100 Mbit.

I was thinking you meant the latter... which might wire all 8 pins, even if they only use 4, if it makes the assembly easier.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 22 July 2013, 09:46:40
Gee, thanks, guys, for putting a big gob of white something (incredibly tough) all over the area where I need to work!

It will really test the limits of my skill (clumsy at best) and equipment (cheap junk) to solder to those TINY spots around the back.

Not hard to identify what I need to do, but not easy to do it.

I will keep you posted.

edit - out of my skill range. I ordered an 8P8C ethernet cable and straight-through coupler from ebay. if it works, I can easily handle the wiring, but will have either 6 or 7 "pieces" between the keyboard and the computer!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 30 July 2013, 21:02:46
Minor doc update (v1.12) posted to the OP covering changes since v1.10, some polishing, updated thread contents pages, and search boxes for searching this thread and the DT thread.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 30 July 2013, 21:09:04
Gee, thanks, guys, for putting a big gob of white something (incredibly tough) all over the area where I need to work!

Almost as though they did it on purpose!  :p

How about hacking one of these (http://www.adafruit.com/products/909) apart?

(http://www.adafruit.com/images/large/ID909_LRG.jpg)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 31 July 2013, 08:12:47
Sorry, I forgot to report back.

I bought an ethernet connector on ebay for under $3 which included a double female coupling and a short double-ended cable.

I cut the cable and spliced it to an AT plug from an old keyboard.

Untested in "real life" since I do not currently own a terminal keyboard, but continuity checks out.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: YakMN on Wed, 28 August 2013, 00:15:30
Can I get some help with macros? I looked through all the examples in the download, and through the docs. I have a couple issues I can't seem to solve:

1: If I include these macros, the .sc compiles, and appears to load, but after unplugging and replugging the usb, the keyboard will just have some kind of default map. (This is an AT model F).
# Shift-SysReq = control-alt-delete
  macro EXTRA_SYSRQ SHIFT
    PUSH_META CLEAR_META all
    SET_META LCTRL
    SET_META ALT
    PRESS DELETE
    POP_ALL_META
  endmacro

# SysReq = force quit app on mac (Command-Option-esc)
  macro EXTRA_SYSRQ
    PUSH_META CLEAR_META all
    SET_META LGUI
    SET_META ALT
    PRESS ESC
    POP_ALL_META
  endmacro

---
I don't know if it matters, but I have mapped EXTRA_SYSRQ to PRINTSCREEN, and SCROLL_LOCK to EXTRA_SYSRQ in the default layer, prior to this point in the .sc.

Problem 2: These macros, if included, don't kill the load. They just don't work, as far as I can tell. Neither one works to replicate the mac key combo in question. In a text editor, if I hit them, I don't see any characters get inserted, but in the terminal, "5~" shows up if no shift is used (nothing shows if shift is down). This appears to happen regardless of whether the macros are pointd at PRINTSCREEN or not, so maybe this is some kind of "normal" behavior in a mac?

----
macroblock

# Shift-PrintScreen = screen capture of entire screen on mac (cmd-shift-3)
  macro PRINTSCREEN SHIFT
    PUSH_META CLEAR_META all
    SET_META LGUI LSHIFT
    PRESS 3
    POP_META
  endmacro

# PrintScreen = screen capture part of screen on mac (cmd-shift-4)
  macro PRINTSCREEN
    PUSH_META CLEAR_META all
    SET_META GUI SHIFT
    PRESS 4
    POP_META
  endmacro
 
endblock

----

I'm sure it's something dumb I'm doing, so any advice would be appreciated.

--


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 28 August 2013, 05:54:35
The only thing I can spot right now is that using the non-handed codes with set_meta will set both, for example 'set_meta shift' will set left and right shifts together. But, I'm not sure if that matters to the mac, and you've got only handed modifiers in the cmd-shift-3 macro already. (In the trigger, non-handed means 'either', so that part is fine as well).

Can you post your whole config, as an attachment or in a [code] block, please? I'll try and take a better look later :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: YakMN on Wed, 28 August 2013, 07:58:21
Yeah, I was trying all kinds of things to se if it worked one way or the other.

Thanks for taking a look!

I have a couple things commented out, because I haven't actually done the full ANSI mod yet.

[attachimg=3]

[attachimg=2]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 28 August 2013, 17:57:41
I just changed the set_meta commands to use handed modifiers and tried it out... the last three work on the mac, and ctrl-alt-del works on windows... so, I'm puzzled why it's not working for you :confused: (The screenshot functions work with multiple modifiers pressed, so I don't think the handed vs non-handed modifiers made any difference).

What else could it be... are you using a KVM? Or a low-speed hub? Some remapping software?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: YakMN on Wed, 28 August 2013, 20:55:07
Hmm. I am not using a KVM. I did have it going into a dell monitor as the USB hub, but I tried it just now going right into the mac mini, and it did the same behavior. I tried something new just now, and found out it's not so much the content of the 2 macros I said couldn't be there, but the fact there are 3 or more macros, period. Not that it actually does the force-quit command on the mac if it happens to be one of the macros left in. (oh wow, force quit dialog just opened. now. about 5 mins after I pressed the key. weird. )

Before that weird thing just now with the force-quit, I was thinking it is maybe a memory issue on the teensy? Here is the report when loading the config:
---
scwr v1.10
scwr: looking for Soarer's Converter: found
scwr: reading file: 160 bytes: ok
scwr: sending info request: ok
device: ok
protocol version check: converter=1.00, scwr=1.00: ok
settings version check: converter=1.01, file=1.01: ok
settings length check: max=506, file=158 bytes: ok
scwr: sending write request for 158 bytes: ok
device: ok
device: ready
scwr: sending 60 bytes: ok
device: ok
device: ready
scwr: sending 60 bytes: ok
device: ok
device: ready
scwr: sending 38 bytes: ok
device: ok
device: complete
----

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: YakMN on Wed, 28 August 2013, 21:22:30
So something is definitely wonky here. I think some key presses are going missing, and now, every once in a while, the force quit dialog is coming up, AND the cursor is turning into the take screenshot cursor. at same time. I thought it was maybe time related, so I timed it. But it's irregular. Now I'm thinking maybe it's related to the number of keypresses after pushing the macro-key.

There doesn't seem to be a certain number of strokes that cause the macro to fire either. ???

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 28 August 2013, 21:48:34
Ahhh. Yeah, that looks like a board with an AT90USB162 chip on it - 512 bytes EEPROM, and only 512 bytes RAM. I'm afraid that's not enough for either the layer or the macros :( Probably also explains the default map after reconnecting it, and the other odd behaviours. Most people are using the Teensy 2.0 with the ATMEGA32U4 chip (and 2.5KB RAM), and don't even come close to filling it up, so there are probably some bugs when the RAM is full.

Layers in particular take more space in RAM than in EEPROM - you can monitor it with the 'scinfo' command. Also, if you have hid_listen running while you 'scwr' a config, you'll see messages about whether allocation was OK or not.

The only real solution though, is to get a bigger chip.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: YakMN on Wed, 28 August 2013, 22:16:30
I'm having a hard time reading what's on the chip, but it does look like ATMEGA32x4. (I can't read what's in the x position).

I have had this for a while, and it was a testbed for some other projects. I'll order a new one and see if that works better. as long as it's not my precious AT F!

Thanks for help Soarer, and, if I forgot to mention it before, for the AWESOME mod. !!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: YakMN on Wed, 28 August 2013, 22:23:52
oh for the love of... I had picked the wrong .hex file when I started out: I loaded "Soarer_at2usb_v1.12_atmega16u4.hex", but should have loaded "Soarer_at2usb_v1.12_atmega32u4.hex". sheesh. can't fix stoopid...

works perfectly now. Just going to see if I can wipe off this shame. oh, the humanity... <looks at bright object> Ooh, pretty! now where was I...

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 29 August 2013, 06:41:15
It was late, but damit, I should've realised... a) I don't provide a hex for a '162, and, b) few people have the kit required to load the almost 16K hex onto the 16K chip (i.e. without the help of a bootloader). Glad you figured it out regardless of my poor advice!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 29 August 2013, 07:01:36
Just going to see if I can wipe off this shame. oh, the humanity...

I have made mistakes much more stupid than that.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: YakMN on Sun, 08 September 2013, 16:09:12
Is there anyway to wire up the 3 LEDs on my AT F so that I cause one to light up if one of my Fn keys is held down? As is it, I can't use numlock or scroll lock lights (neither does anything on a mac). I don't even like wasting a key on caps lock, I only keep it there because I like to see the light turn on. But it would actually be useful if I could make the other 3 light up when you had a Fn key held down.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 08 September 2013, 18:55:11
There isn't, sorry.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: YakMN on Sun, 08 September 2013, 20:44:45
np, thanks for quick reply. Maybe I just need to do a blinkenlights mod on top of this one ;)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: nightspirit on Tue, 17 September 2013, 14:47:54
I just made one of these converters for my 122-Key Terminal IBM Model M (8P8C Connector), and I seem to have run into a couple problems. The first is that I don't seem to have NKRO. I'm not sure if I did something wrong, but I try the "hold both shift keys and type quick brown fox" test and I get "THEQUIKROWFOJUPSOERTHELAYDOG". And there are some of my keys (11 of them) that don't register with xev, specifically all 10 keys on the left hand side of the keyboard and top-right button on the number pad. Have I done something wrong, or is this all normal? Sorry if this any of this has been discussed, this is an awful long thread to sift through.
EDIT: Noticed that there's another key that doesn't seem to work. It's the one labelled "{ }" that exists between Field Exit and quotation.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 17 September 2013, 15:25:05
Model Ms aren't NKRO, and the converter can't change that.

You'll need to load a config with some remaps  to get all the keys working - there's a couple in the configs folder that work with the 122-key 'boards (legacy.sc, halvar.sc). Check the docs for how to compile (scas) and load (scwr) configs, then tweak one of those to suit your needs. Finding out which codes you need to remap is described in Initial Translation on the Config page, but most are pretty obvious if you start with halvar.sc!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: nightspirit on Tue, 17 September 2013, 15:26:55
Okay, thanks for the clarification, I'll look into that.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JBert on Wed, 18 September 2013, 12:11:33
The first is that I don't seem to have NKRO. I'm not sure if I did something wrong, but I try the "hold both shift keys and type quick brown fox" test and I get "THEQUIKROWFOJUPSOERTHELAYDOG".

That's not an NKRO test, it's just some random test for your controller. How often do you press both shift keys? It's only good as a "newbie test".

You have to press 3 key combinations, then see which ones don't work. If literally any 3-key combination works, try with 4 keys, and so on.

Not that it will help you much as the model M is 2KRO if I recall correctly.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: xwhatsit on Mon, 23 September 2013, 00:24:26
I'd have to remove Out from the report as well :( It's a pain because each one of these grows the descriptor by 22 bytes, which might cause its own problem at some point. I'll just have to keep an eye on that table for now, until I can think of a good way to phrase a bug report such that it gets some action (if they see it as just one DIY project that's acting up, it won't get fixed!).

This has, predictably, bitten my USB beam-spring converter, now that I've implemented NKRO.

I'm surprised it took me a few days to notice too, being a Linux guy who uses the backslash/pipe key frequently!

I have solved it in the same manner you have, by putting padding bits into the descriptor where the problematic keycodes would normally be.

I'd suggest reporting it; looking around the internet (I had no idea what was causing it at first! I even stripped down my beamspring to see if there was any dust on the backslash sense pad :P), I see many others with weird backslash issues under Linux, some from keyboards that seem to be gaming keyboards or otherwise a bit `special' and thus probably implement a bitmapped keyboard report for NKRO. If you don't report it I'll have to get motivated to do so but it appears you have a bit more of a handle on the underpinnings within usb-core and usb-input (well that's my excuse anyway :P).

Here's an example: http://forum.corsair.com/v3/showthread.php?t=119654
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: killmaster on Tue, 24 September 2013, 15:43:14
Any idea if this works with a Teensy 3.0?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 24 September 2013, 16:29:19
It won't. Teensy 3.0 has a totally different CPU architecture for a start. But the real killer is that it runs at 3.3 volts, and can't interface directly to our 5 volt keyboards.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: killmaster on Tue, 24 September 2013, 16:32:57
Okay, thank you!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 24 September 2013, 16:41:56
I'd have to remove Out from the report as well :( It's a pain because each one of these grows the descriptor by 22 bytes, which might cause its own problem at some point. I'll just have to keep an eye on that table for now, until I can think of a good way to phrase a bug report such that it gets some action (if they see it as just one DIY project that's acting up, it won't get fixed!).

This has, predictably, bitten my USB beam-spring converter, now that I've implemented NKRO.

I'm surprised it took me a few days to notice too, being a Linux guy who uses the backslash/pipe key frequently!

I have solved it in the same manner you have, by putting padding bits into the descriptor where the problematic keycodes would normally be.

I'd suggest reporting it; looking around the internet (I had no idea what was causing it at first! I even stripped down my beamspring to see if there was any dust on the backslash sense pad :P), I see many others with weird backslash issues under Linux, some from keyboards that seem to be gaming keyboards or otherwise a bit `special' and thus probably implement a bitmapped keyboard report for NKRO. If you don't report it I'll have to get motivated to do so but it appears you have a bit more of a handle on the underpinnings within usb-core and usb-input (well that's my excuse anyway :P).

Here's an example: http://forum.corsair.com/v3/showthread.php?t=119654

Yeah, one of us really ought to get round to reporting it :p

I think It helps a lot that other keyboards are falling prey to it - even if they don't claim to support Linux (which in most cases is probably just laziness / lack of testing).

I got horribly lost looking at that code :( I kept thinking I had a handle on it, but then I'd see something that proved my notions wrong. It must be tracking scan code state somewhere, after that table is used, but I don't think I found it.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 07 October 2013, 17:16:46
I have gotten a question that I cannot answer.

Are any or all of these contacts available to reassign and use?

It seems that I have heard that some are not, such as the left side of numpad "0" and the bottom of numpad "Enter"

Can anybody say for sure which of these 5 could be activated, and where to find them in the table?

Thanks!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Mon, 07 October 2013, 17:30:31
Have you tried hid_listen? If something shows up there when you short-circuit the contact, then you know for sure that the contact works, and you also get the code it sends, which you can look up in the table.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 07 October 2013, 20:11:11
Thank you for the reply, but I was hoping to get a definitive answer from someone who knows, rather than learning for myself by trial and error.

For one thing, I do not currently have a keyboard disassembled, and would prefer to avoid the time and pain of experimentation.

If I knew what I was facing in advance, it would make the process smoother.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 07 October 2013, 21:01:49
All of those should work fine, although I haven't tried them myself. Well, apart from 03 and 05 which are standard on 122s!

01 = EXTRA_INSERT
02 = EXTRA_PAD_PLUS
03 = PAD_MINUS
04 = INTERNATIONAL_1
05 = EUROPE_1

The other two normally hidden pads that are wired are:
top half of ISO enter = BACKSLASH
left half of backspace = INTERNATIONAL_3
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: winged mantis on Sat, 12 October 2013, 20:52:43
Im having trouble getting the firmware to work with my keyboard. I have a Dell AT101W connected to it. The hex file installs on the teensy just fine, but after the 3 led's blink and windows installs the drivers, no characters appear when I type.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 12 October 2013, 21:09:46
See the 'Trouble' page ;)

Probably a problem with your wiring, and maybe hid_listen can give you a clue whether something is not connecting well, or if you have data and clock swapped over.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: winged mantis on Sat, 12 October 2013, 22:04:47
Edit: Nevermind, wired the data and clock wires to the wrong places
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Tue, 15 October 2013, 15:34:05
Sooooooo........

I'm looking into making a converter, and I am somewhat unsure of what parts I need.  I need this for a 122-key Model F.   I read through the first 17 pages of this thread, downloaded the documents, and finally got tired of all the reading.  Here is what I think I need:

1.  breadboard
2.  Teensy w/ pins
3.  5-pin socket
4.  Mini USB cord to connect to computer

Will I need anything else to make this work?  With the breadboard, is necessary for me to solder anything?

I probably will have more questions as I go along, because I am neither a programmer nor electronics fiend.  I also need step-by-step instructions and lots of diagrams and pictures to help me learn, along with the deep, reassuring voice of a guru behind my shoulder.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 15 October 2013, 16:59:06
I'm looking into making a converter, and I am somewhat unsure of what parts I need.  I need this for a 122-key Model F.   I read through the first 17 pages of this thread, downloaded the documents, and finally got tired of all the reading.  Here is what I think I need:

1.  breadboard
2.  Teensy w/ pins
3.  5-pin socket
4.  Mini USB cord to connect to computer

Will I need anything else to make this work?  With the breadboard, is necessary for me to solder anything?

I probably will have more questions as I go along, because I am neither a programmer nor electronics fiend.  I also need step-by-step instructions and lots of diagrams and pictures to help me learn, along with the deep, reassuring voice of a guru behind my shoulder.

You won't need a socket unless you don't want to do individual wires or cut the original cord. If you cut the original cord, you will need to solder the cut ends at the Teensy.

These will take care of you since you will have pins on both ends that you need to connect. Color-coded, too.

http://www.ebay.com/itm/181165458233

Otherwise, you should be good except that you will want to fasten the Teensy somehow, but even a cable tie would do that.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 15 October 2013, 19:48:20
Yes, I would suggest those wires as well; breadboards aren't ideal for the long-term. With them, fitting the Teensy inside the case, and getting a suitable length USB cable for your needs, you can have a reasonably permanent (but reversible) conversion up and running pretty quickly, and without soldering. An external converter is obviously more flexible if you have multiple keyboards you want to use with it, but usually requires at least some soldering and making mechanically sound (i.e. a box etc).

This thread is best read backwards these days, or via the index and search in the docs!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Tue, 15 October 2013, 20:23:01
Ooooffff.   I'll see what I can do.  So many of the terms thrown around for this converter are so foreign to me that I spend half the time looking up the meaning of the term.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 15 October 2013, 20:43:32
This thread is best read backwards these days, or via the index and search in the docs!

Soarer's documents are really very thorough.

Wcass's programming is post #560 (I have memorized that one).

You know the saying "RFM" you will save some grief if it is part of planning rather than troubleshooting.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Wed, 16 October 2013, 17:44:44
This thread is best read backwards these days, or via the index and search in the docs!

Soarer's documents are really very thorough.

Wcass's programming is post #560 (I have memorized that one).

You know the saying "RFM" you will save some grief if it is part of planning rather than troubleshooting.

RFM?  Recency, frequency, monetary value?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 17 October 2013, 06:44:09
RFM?  Recency, frequency, monetary value?

"Read the frakking manual."
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: IonutZ on Sun, 20 October 2013, 18:42:07
Could I upload the binary to a Teensy 3.0?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 20 October 2013, 19:11:42
Could I upload the binary to a Teensy 3.0?

Post # 922
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 23 October 2013, 18:33:58
here is the problem:

After completely disassembling and putting an F-122 back together, I get a screen full of random garbage. I get dozens of "Calculator" (which is F14 remapped) and those are mostly full of "5s" with a few other numbers mixed in.

When I could get it all to hold still for a few seconds, Aqua key test reported a few hits and a lot of misses.

I will take it apart again, of course, but this is clearly an electrical problem.

[SOLVED] - NOT

After completely disassembling it, there appeared to be a  VERY  few  TINY  specks of dust on the mylar sheet that goes between the metal back plate and the capacitive PCB. I wiped all 3 pieces with alcohol and put it back together. Everything worked properly - for a while.

[UNSOLVED]

After hooking it back up to the original cable and outboard Teensy, it happened again. After some experimentation, I realized that the problem might be the cable. I can't tell whether it is not making good contact at the PCB, or the male end of the 240 DIN plug, or in the wiring, but when I did a direct connection to a loose Teensy with loose wires, it worked.

So I use it for an hour or 2 with no problem, then it starts spitting out spurious keystrokes. Sometimes there is a pattern, for example pressing "W" produces "2W" or "W22" and I am getting a lot of "5s" and sometimes I suddenly get a dialog box or something that would normally indicate that I had pressed something special.

Once it starts, it gets rapidly worse, as if it were heating up or something. A reboot usually fixes it temporarily.

I like this board and it seems nice and clean otherwise. I would like to make this a daily driver.

Is there an electrical component that may be failing? Would a bad connection produce extra keystrokes?

Thanks for your help.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 25 October 2013, 17:21:07
How very strange! Was it working OK before you took it apart? Or didn't you use it for long enough before to reveal the problem?

The prime suspect from an aging perspective is the power smoothing capacitors - if they aren't effective (particularly the one near the capsense chip) then the capacitive sensing could well become unreliable.

To get keypresses requires a decent clock signal; I don't think a bad connection could cause extra keypresses.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 26 October 2013, 16:37:25
How very strange! Was it working OK before you took it apart? Or didn't you use it for long enough before to reveal the problem?

The prime suspect from an aging perspective is the power smoothing capacitors - if they aren't effective (particularly the one near the capsense chip) then the capacitive sensing could well become unreliable.

To get keypresses requires a decent clock signal; I don't think a bad connection could cause extra keypresses.

I had tested it in the beginning with Aqua Key Test and it turned out good. I probably did not use it for an extended period. Also, I tend to ignore occasional isolated spurious keystrokes because my typing is sometimes sloppy when I am going fast.

Now I hooked it up with different wires and different Teensy applications (external box with cable and adapter, and loose Teensy wired direct) and got the same result, so clearly (heartbreakingly) the problem is in the keyboard somewhere. I get a variety of different characters, so that indicates that there is not an isolated problem "out in the field" somewhere.

Both Teensies are set up with pull-up resistors (1K ohm, 1/4 watt), could I be "pulling up" too much juice into the clock or data circuit?

How would I find and check the capacitors? Should I be looking for a short circuit somewhere else?

I actually have another controller board, but that long line of connections off the flat gray cable is very intimidating.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 26 October 2013, 19:58:49
It would definitely be easier to replace the capacitors than swap the controller! I haven't got an open F 122 handy to point them out, but they'll be the same as in the XT I guess, silver, lead at each end (axial), little under an inch long... ahh, here, scroll right down... http://www.seasip.info/VintagePC/ibm_6110344_cswap.html. There's two of them worth replacing - one near the square silver capsense chip, and one near the cable connector. (I'm pretty sure the third one next to the two yellow capacitors is just for providing the reset signal to the CPU, and that seems fine).

Gotta admit I'm just guessing! But, I'm also thinking of what's the easiest thing to try first, when you haven't got lots of test equipment to hand.

Unfortunately they're not easy to test, so replacing them is the best bet. TBH, anyone into Model Fs should have a stock of them... they're 47uF, 16V, axial, electrolytics, e.g. http://www.ebay.com/itm/300351410410 (actually, I think the originals are tantalum, but electrolytics work fine).

They need to go in the right way round: the -ve side is marked, and goes to ground, which is on the end away from the cable connector for both of those caps (if your controller board looks like the one in those pics).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 27 October 2013, 10:08:09
Thanks!

We are talking about these 2, right? What about the 2 black upright ones, are they questionable?

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 27 October 2013, 11:57:16
The black ones will be fine. It's only the ones that smooth power that have even a remotely hard life.

Nope... these two...
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 27 October 2013, 13:29:10
Nope... these two...

Great, thanks!

I ordered those capacitors that you linked. Hopefully, from Canada, they won't take too long.

Maybe I will get lucky. Maybe I already am - I have worked and used several Model Fs without capacitor issues. It will be nice to have some spares on hand, just in case.

Are my symptoms, spurious key strokes, typical for a failing capacitor? What should I look for in one starting to go bad, and/or a completely dead one?

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 27 October 2013, 14:42:08
I don't know if it would be 'typical', or have any statistics for failures of capacitors of this type (don't even know exactly what type they are!), but it's certainly a reasonable assumption that if either of the capacitors fails to an open circuit then the Model F's capacitive sensing could have trouble, and cause those symptoms.

It might be worth measuring resistance between +5V and GND to see if it seems off, or if it takes a different time to settle to a steady reading... you have a few to compare with :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 28 October 2013, 16:21:32
All hail King Harry, perpetrator of the most bizarre and improbable problems imaginable (or not).

I think that I have found and fixed the most recent problem, and you are not going to believe this:

After painting several plates in different colors, including flat black and glossy black, I was not happy enough with the results to let them show as a bare "stealth" board. Looking at my options at the paint store, I decided on "hammered" black in a spray can. I was extremely pleased with the results - a nice light subtle textured finish that was "just right"

After reassembling the keyboard, I gave the front plate a couple of light taps with a hammer to seat the tabs fully. Since this left a couple of small marks on the end of the plate, I masked the keys and gave the end a light touch-up spray of paint. Since ordinary paint is not a conductor, I did not think about a bit of overspray on the PCB behind. But wait - the "hammered" paint must have some metallic dust or flakes in it to produce the desired effect, and, of course, that makes the paint conductive!

There are a few small parallel traces running down the side of the board, and there was a cloud of black about 5mm x 2cm that must have been partially shorting them together. I very gently rubbed the area with alcohol on a paper towel to remove the overspray. It seems to be working properly, it has been about 20 minutes now and I am typing this on it with no spurious key strokes.

Not one of the top 5 most obvious possibilities to troubleshoot, eh?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 28 October 2013, 17:06:46
Good theory, but I'm not convinced! There's a solder resist layer, so it shouldn't have directly shorted anything, and lines in parallel have some capacitance between them anyway.

But we shall see in about an hour I guess!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 29 October 2013, 07:38:29
There's a solder resist layer, so it shouldn't have directly shorted anything, and lines in parallel have some capacitance between them anyway.

Several hours on, and 2 reboots with no problem.

The solder resist layer looks to be intact, and clearly the problem could have been something else altogether.

As always, I appreciate your help and advice.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 29 October 2013, 19:25:42
Well that's good news! I wouldn't have thought it was that sensitive... next time I have one apart I'll try putting a hammer or two on some of those traces to see if it affects it.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Mon, 04 November 2013, 03:43:39
Trying to rig up an external one, this is the most I get. Nothing happens if I hit a key, and only get R05 if I unplug or plug into the adapter.

Trollbogey:configs hellmark$ ~/Downloads/hid_listen.mac
Waiting for device:...
Listening:
wEE

remaining: 0051
2C@0008 remaps
05@0034 layers
20@0039 remaps
layerdefs: 01
max_layer: 01
total_macros: 00
alloc ok.


Keyboard ID: 0000
Code Set: 1
Mode: PC/XT

R05
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 04 November 2013, 06:33:08
I think that's what you'd get if the clock line was permanently low, and always being read as 0. A few things could cause that (roughly in order of likelihood): either +5V isn't connected to the keyboard, or clock is shorted to ground, or there's an internal fault in the keyboard, or possibly the Teensy pin has been damaged by shorting it with +5V at some point (actually, I'm not sure exactly how a failure affects it in that case; it might always read as '1'). A multimeter would help a lot in checking the first two!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Mon, 04 November 2013, 11:03:56
I soldered ground to the VCC and Ground near the reset switch. I do notice that most people tend to connect to the one up near the USB jack. Is there a difference that would be causing this?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 04 November 2013, 14:51:26
No, no difference between the two GND pads (or between the two VCC pads).

So, any chance that one of the possibilities above might be the problem? Could you post a pic in case there's some problem we might spot?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Mon, 04 November 2013, 14:58:19
I am at work right now. Last night after I made the post, I unsoldered everything and soldered on pins before going to bed. When I get home, I'll attempt again, and double checking everything with my multimeter.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Tue, 05 November 2013, 07:12:25
Taking a look at it now. 4.94V reading at the pins. Not seeing any sign of a short for the clock. Tried with another keyboard I know works, and still get the same thing for ID 0000, and R05.

Just to double check, the pinout that you have on the first post is for the female connector, right? That's how I read it as.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 November 2013, 07:49:39
The front of the female connector, yup. The docs have a diagram from the IBM techref that makes it clearer.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Tue, 05 November 2013, 07:53:21
Damn, I was hoping that I misread it and wired it up backwards.

Would you say that it seems likely then that the teensy is damaged? What would I need to do to get it going with other pins for clock and data? I know your source isn't available, and often that sorta thing is hard coded.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 November 2013, 08:05:12
With no keyboard attached, does it still do the single R05 thing, but the PD1 pin is at roughly 5V?

edit: I just tried shorting clock to ground, and it does give this behaviour as I thought. There could be other ways, of course!

edit2a: Last time this problem came up (http://geekhack.org/index.php?topic=17458.msg951788#msg951788) was when Harry incorrectly wired a pull-up resistor (so it was pulling down, presumably).

edit2b: In case the Teensy is damaged, there is an alternate hex for atmega32u4 (http://deskthority.net/post120098.html#p120098) which uses different pins.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Tue, 05 November 2013, 08:31:51
no keyboard attached, no R05. I am running without pull up resistors, could lack of pull ups cause this?

Using the alternate pins and firmware, same result.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 November 2013, 09:09:10
Pull-ups are usually not required, and if they were it wouldn't give this kind of error.

So it doesn't seem like a damaged Teensy then,  the keyboard must be pulling it down. Still might be possible that wiring is wrong on your socket, but the next thing to test is resistance between pins on the keyboard (with it unplugged)...

ground to 5V - should a few kohm
data to 5v - should be 1 or 2 kohm (for a PC/XT, maybe higher for others)
clock to 5v - should be 1 or 2 kohm (for a PC/XT, maybe higher for others)
ground to clock - should be higher than ground to 5V, by 1 or 2 kohm
ground to data - should be higher than ground to 5V, by 1 or 2 kohm
might as well test data to clock as well!

What keyboard is it?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Tue, 05 November 2013, 12:18:48
I have a XT model F (what I primarily want it for), and also tried with a AT NMB keyboard. Same results on both. I'll try do some more probing tonight.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 November 2013, 14:52:49
Actually, same on both would indicate something wrong with the wiring of the socket. Please quadruple check that it's not mirrored! If the 5V to the keyboard is actually GND, it will pull both clock and data low, and give that single R05 symptom. If, at the same time, the GND to the keyboard is actually 5V, that can easily damage the power smoothing capacitors (on the XT at least. Easy enough to replace though).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Tue, 05 November 2013, 16:29:40
I'll check again tonight. I cut the female end of an AT adapter off, and out of that was 5 wires. Brown, Red, Black, and Orange, with the final one being bare. The bare one is what I've been treating as ground, because when I tested things initially it is what thought was ground, plus usually when ever I see bare in a bundle like that, it is the ground. When I tested things, I had been up for about 24 hours straight, so possible I poked the wrong spot with something.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 05 November 2013, 16:38:00
Ah, the bare one will be the case ground. One of the others needs to be connected to ground for it to operate (as well as the case ground if you like, but the case ground is optional). BUT I'm not sure whether that error alone would produce the same symptom, so check 'em all!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Tue, 05 November 2013, 20:16:33
Great news!  After weeks of reading up on this thread, Soarer's documentation and such, I finally decided to take the dive and see if I could get my F122 to work with the converter using the materials that I have on hand.

So I stripped one end of the female-to-female breadboard wires and attached those to a socket.
Then I attached the intact female end of the breadboard wire to the Teensy.
I loaded the files onto the Teensy.
I then plugged the keyboard into the socket, restarted the computer, and everything seems to work alright. 

Typing on the F122 right now!  Was not nearly as difficult as I built it up in my head.

It looks pretty ugly and is an admittedly awful, temporary build, but I just wanted to see if I could get this thing to work.  And it does.

However, I still have some issues with getting the computer to consistently read the keyboard on restart or re-insertion of the converter.  I will describe those in more detail if they persist with a more solid build.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 06 November 2013, 00:35:28
Ok, I went through and double checked things. One wire I did have off. I before thought it was reset, but apparently there isnt' a wire to the reset, and instead is ground. I have both the bare wire ground ground and the pin ground now connected to the teensy's ground. The other ones seem to be correct though. Female plug facing me. from left to right, I have clock, ground, data, VCC, and what should be 3 but is no wire. That should match up with what the diagram shows.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Wed, 06 November 2013, 05:53:49
Ok, I connected the breadboard female-to-female wires to the controller and I plan to directly contact those to the Teensy.  I am wondering if there is a way to determine the connection of each wire without using a multimeter, which seems to be the preferred method in this thread.  I know that others have documented this before, but I also know we cannot rely on the color of connection wires being consistent between models.

FYI, I have an F122, model #6110347.

EDIT:  Nevermind folks.  I searched the thread and found fohat's earlier fumbles with an F122 from two years ago, and I have this thing working fine with a direct connection to the controller without any soldering.

My only question is how permanent of a solution is the solderless converter?  I plan to keep the teensy in the case, but I have some concerns about the pins on the pre-soldered Teensy getting bent.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 06 November 2013, 06:28:34
Without a multimeter, may be a bit tricky. Luckily multimeters are cheap. Harbor Freight is in most areas and has them for $5. Quite a few different tool stores should have cheap no frills ones. Amazon also has a number of cheap ones in the $5 range.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Wed, 06 November 2013, 06:37:02
Without a multimeter, may be a bit tricky. Luckily multimeters are cheap. Harbor Freight is in most areas and has them for $5. Quite a few different tool stores should have cheap no frills ones. Amazon also has a number of cheap ones in the $5 range.

Thanks.  I was able to figure things out looking at some older posts.  Now my only concern is the permanency of my current solution without soldering.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 06 November 2013, 06:52:15
Without soldering, it won't be permanent. Pick up a cheap iron go to town. Making stuff is fun, and a skillset so many people are missing any more.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 November 2013, 07:02:09
Good. Yes, if you've found the pinout of the connector on the controller, you can rely on that.

The key thing to the connections staying put is to stop the cable pulling on it - solve that and you're most of the way there. Then wrap the Teensy in something (foam?) or stick it down, and it should be fine for a good time. It's also improtant that the Teensy pins don't short to ground (e.g. the case!), especially pin PD6 since that's +5V when the LED is lit (also, since that's on the end, it's more likely to touch).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 November 2013, 07:09:18
Ok, I went through and double checked things. One wire I did have off. I before thought it was reset, but apparently there isnt' a wire to the reset, and instead is ground. I have both the bare wire ground ground and the pin ground now connected to the teensy's ground. The other ones seem to be correct though. Female plug facing me. from left to right, I have clock, ground, data, VCC, and what should be 3 but is no wire. That should match up with what the diagram shows.

Right, that sounds good. I still can't think how the missing ground gave the symptom, so it's worth checking at least the 5V to GND resistance on the XT keyboard in case it's damaged somehow. Otherwise, time to see what happens when it's plugged in...
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 06 November 2013, 09:23:43
Same results, no change on either the AT or XT.

1.3kOhm on the XT for ground to 5v. Data and clock to 5v are both 2kOhm. Data and clock to ground are both around 3.25kOhm. Data to clock is 4kOhm.

AT keyboard is 9.6 ground to 5v. 11.8kOhm data and clock to ground. Data to 5v is 2kOhm, clock is 2kOhm. 4.38kOhm data to clock.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 November 2013, 11:02:14
Those readings are all good. I'm stumped for the moment! Can't see how the clock line gets grounded, but only when a keyboard is plugged in, yet the keyboards seem fine.

In case I'm making an incorrect assumption, can you measure the voltage on the clock line when a keyboard is attached?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 06 November 2013, 11:15:33
The AT keyboard I know is good, because I was using it before I unplugged it to test it with the teensy. I am wondering if I did something to dork up the plug, and didn't realize it, because I know it was all good to start with, since I used it with the AT keyboard to work on a PS/2 system before I started.

Yeah, I can test voltage tonight, shouldn't be a problem.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Wed, 06 November 2013, 14:17:26
Without soldering, it won't be permanent. Pick up a cheap iron go to town. Making stuff is fun, and a skillset so many people are missing any more.

I do have a solder iron and I cannot wait to play with it!  But I'm a little cautious of screwing up the keyboard or Teensy with my novice soldering skills.  On the bright side, this converter has reawakened my dormant DIY and tinkering tendencies.

Good. Yes, if you've found the pinout of the connector on the controller, you can rely on that.

The key thing to the connections staying put is to stop the cable pulling on it - solve that and you're most of the way there. Then wrap the Teensy in something (foam?) or stick it down, and it should be fine for a good time. It's also improtant that the Teensy pins don't short to ground (e.g. the case!), especially pin PD6 since that's +5V when the LED is lit (also, since that's on the end, it's more likely to touch).

Luckily, these Model F's have a clamp of sorts that will keep that USB cable in place.  What is the purpose of wrapping the Teensy in foam?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 06 November 2013, 14:24:36
What is the purpose of wrapping the Teensy in foam?

If you put it internal there are lots of metal surfaces that could touch any number of points and short them.

There is an extra bracket that I attach to if I am using a breadboard.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 06 November 2013, 16:06:18
Yeah, and foam would stop it rattling around, which might also be enough to prevent cables falling out. I'm thinking enough foam so the foam is squashed by the case when closed ;)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Wed, 06 November 2013, 16:24:36
Thanks guys.  I'm a technological Luddite that forgot everything I learned from my Electronics merit badge.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Thu, 07 November 2013, 06:40:12
with AT keyboard attached, 2.28V on clock line. XT it is 2.84V.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 07 November 2013, 06:51:25
Interesting. I wonder if the 5V is connecting to the keyboard properly. I'd guess at similar voltages on the data line in that case.

Does the AT have LEDs, and do they flash on as they should when it's connected?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Thu, 07 November 2013, 07:27:05
AT has LEDs, and they do not flash. Not even a flicker.

On data line, reading .69V when keyboard is plugged in.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 07 November 2013, 14:04:33
Time to test continuity all the way through then. Easiest with the XT because I can show you where to probe, and there's handy test pads as well! You'll need to open it up and connect it to the converter (but not plug the USB side in), then check resistance between these points and the corresponding pins on the Teensy - they should all be 'low', as in ohms or tens of ohms.

[attachimg=1]
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Thu, 07 November 2013, 23:57:31
I used the test pad as marked out by you in that pic. For the following I go from the test pad to the pin on the teensy. Keyboard plugged in, but USB isn't plugged in.
XT Test Point to teensy pin:
Ground to VCC = 1.25kOhm
Ground to Clock = 3.25kOhm
Ground to Data = 3.25kOhm
Ground to ground = 1.1kOhm

VCC to Clock = 2.02kOhm
VCC to Data = 2.03kOhm
VCC to Ground = 1.238kOhm
VCC to VCC = 1.1kOhm

Data to Clock = 4.03kOhm
Data to Ground = 3.28kOhm
Data to VCC = 2.03kOhm
Data to Data = 1.2kOhm

Clock to Data = 4.05kOhm
Clock to Ground = 3.26kOhm
Clock to VCC = 2.015kOhm
Clock to clock = 1.1kOhm
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 08 November 2013, 07:05:34
They all seem as expected, except for these:

Ground to ground = 1.1kOhm
VCC to VCC = 1.1kOhm
Data to Data = 1.2kOhm
Clock to clock = 1.1kOhm

Which I think is just a mistake in writing them - they should be without the 'k' - since the other measurements wouldn't be as they are, otherwise.

Next test is to plug the USB in, and measure the Vcc, Data and Clock voltages on those test pads, using the GND test pad as reference ('reference' just means where you stick the black probe).

Surely we must find something wrong soon!  :'(
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Fri, 08 November 2013, 12:31:33
Oops, do believe that was a copy paste problem.

I'll double check voltages when I get home. I am hoping we can find something soon too, and thank you for being so patient.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 08 November 2013, 19:19:36
I forgot to report back on my mysterious problem with spurious key strokes. No problem any more after at least a week of constant use (although my USB port must be weird, every few days or weeks it stops working (and knocks out other USB ports, too) until I unplug it and hot plug it again).

Soarer was skeptical that the metallic paint was the problem, and I did completely disassemble and reassemble it, so various things could have been jiggled just a bit.

Another thing - I have 3 bolts added in the concave part of the plate: approximately between 5 and upper F5, between 0 and upper F10, and between Enter and Up Arrow. I feel that these tighten up the feel somewhat, since the F-122 has such a vast unsupported area down the center line (those tabs hardly touch).

In the earlier iteration, I had these torqued down fairly hard, perhaps too hard. Afterwards, I made them just a hair past "snug"

Perhaps I was simply pulling the plates too close together and getting near contact with the hammers.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 09 November 2013, 14:15:58
That sounds quite plausible :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 09 November 2013, 21:59:25
with AT keyboard attached, 2.28V on clock line. XT it is 2.84V.

AT has LEDs, and they do not flash. Not even a flicker.

On data line, reading .69V when keyboard is plugged in.

I tried a few tests, and the closest I got to these voltages was 0.5V on both clock and data, when the +5V line was disconnected from the keyboard. When the +5V from the keyboard was connected to GND on the Teensy, both were even lower, about 0.27V. I'm not prepared to try connecting the keyboard's power in reverse, but, assuming it didn't emit smoke, I'd expect a similar 0.27V or thereabouts.

I can't think how to get anything like 2.2 to 2.8V with the various resistances available  - the pull-up within the Teensy is very roughly 25kOhm, so it would require something similar to that pulling down. The other option would be that it is constantly flitting between 0V and 5v (and the multimeter averages it), but then the converter should be putting out more error messages.

Also, I don't know why there's the difference between data and clock voltages, on yours.

Hmm  :confused:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Sun, 10 November 2013, 00:37:14
Right now, I am kinda tempted to bypass the connector, and solder directly to the test pads, and see how it goes. I really wonder if i dorked up the plug.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 10 November 2013, 05:18:07
I dunno - measuring the resistances from the test pads to the Teensy seemed to show that the connector is fine.

What's the voltage at the Vcc test pad?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Mon, 11 November 2013, 07:39:02
VCC test pad to Ground test pad = 1.529V
Ground to data = 110mV
ground to clock (black on ground) = -1.257V
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 11 November 2013, 08:17:56
Well that's clearly not the voltages we want there! They would account for the single R05 symptom, so we're getting somewhere :)

It doesn't correlate at all with the resistances between the test pads and the Teensy though (reply 986) - if those were correct, there's no way we could see a -ve voltage on clock w.r.t. ground. In fact, the only way we'd see a -ve voltage anywhere w.r.t. ground is if ground wasn't wired to ground! (Which would probably also mean that at least one other wire isn't wired correctly).

Just to verify - when you measured the resistances, was it all the way from the test pads to the Teensy pins and not just between the test pads and the keyboard's controller or cable connector?

A photo of your Teensy wiring would be really helpful in case there's something visibly wrong!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Mon, 11 November 2013, 08:48:34
When I tested resistance, I tested black on test pad to red on pins on the teensy. Wanted to make sure things went between the adapter and the cable.

Attached are how things are looking right now.

The pink looking thing is a bit of shrink tubing to help make sure that nothing shorted out on the case ground.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 11 November 2013, 09:10:40
That look OK.

So with everything plugged in, what's the voltage on the Teensy Vcc w.r.t ground? (I've been assuming that it's still 5V as it should be, since the Teensy appears to be running, and the USB port would probably have shut down otherwise).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 13 November 2013, 07:33:39
Ground test pad to VCC pin on teensy, VCC test pad to ground pin on teensy, test pad to test pad, and pin to pin, doesn't matter, all register at 1.5V.

For ****s and grins, I tried going off the other ground and VCC pins on the teensy, and all works now!

Just to let you know that this works, I am typing this from the XT now, and will be taking it with me to work.

I really forgot about the different thwack sound of the F verses the M. Really been a long time since I had a chance to use one of these. I am really happy considering that I will be having some marathon sessions at work this week because of the final portion of the data center migration, so I am happy that I have this keyboard going. Right now on OSX, so no arrow keys since I cannot disable the numlock, but oh well. I have the keyboard working and that is what matters. That's a problem of the OS and not the keyboard or convertor, and could be overcome with changing the key mapping if I really want to, but probably won't monkey with since this is going to be used on Linux and Windows.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 13 November 2013, 07:39:06
Ok, after bringing it in to work with me, I realized that I definitely need to tweak the keymapping. The function keys are mapped to other things like media control, and for my work, I really need the function keys. Guess next step is to try and figure that out.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 13 November 2013, 21:14:08
Hah, great!

Must be something bad about that Vcc and/or GND pin then - maybe a broken track, or a bad joint on the header pin. If you feel like it sometime, measure some voltages and resistances between the Vcc and GND pins on the Teensy to see if you can find the answer! (resistances when powered off, naturally). But I totally understand if you're sick of it by now!

Some remappings for sure... a layer is what you need :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 13 November 2013, 23:47:26
Yeah, definitely curious as to what may be the deal. I know when I measure voltage between the two pins I had it on before, it is 5V, when no draw, but then drops after keyboard is connected.

Oh, I definitely want to do a layer. Figure have Capslock be function. Function Shift for Capslock. Function F1 for F11 and Function F2 for F12. Some other random keys for rest of the F keys.

Any idea why Control and Alt wouldn't work out of the box? Tried on 3 machines (Win7, a *nix box, and one running OS X), and they didn't seem do anything. Even key testing programs didn't register anything.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 14 November 2013, 04:35:21
No idea - they should just work even with no config at all. You said the F-keys were media keys... what config have you got loaded at the moment?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Thu, 14 November 2013, 07:05:20
I had tried fooling with configs, I think the last was wcass's, but I had uploaded the firmware several times after that so I figured the config had been overwritten. I just made the empty config into a binary and wrote that onto the teensy, and function keys act like normal, and control works.

Seems like I have to really mash on the key to get alt to work now, so I am thinking it is an issue with the XT keyboard. Same goes with capslock and numpad 0
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 14 November 2013, 10:16:49
The Teensy loader doesn't blank the EEPROM, so the config remains. (Other non-Teensy loaders can blank it). I try to keep compatibiliity so that a later firmware works with an earlier config :)

Often there's no damage to the springs, and reseating the keycaps (maybe a few times!) can sort them out.

If a hammer has been dislodged or some dirt has got in, it might need disassembling to clean it out - a bit fiddly, but not too hard. Just remember to take all the keycaps EXCEPT the spacebar off first, or the hammers will fly out! There's a trick to getting it back together - use a bit of fishing line or similar to hold the spacebar hammer in place.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Thu, 14 November 2013, 11:57:39
The spring looks like it should be ok. When I've seen dislodged hammers on my M's, the springs are off at a different angle. I'll try reseating those keys a few times, and see if that'll help.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Sun, 17 November 2013, 08:35:07
Sorry if this is a repetitive post, but I am attempting to run hid_listen so I can determine the key codes for my keyboard for remapping, but I cannot get the hid_listen program to even work.

I went to the Prjc website and followed their instructions for hid_listen, and read some posts in this thread, but nothing seems to happen.  Help please?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 17 November 2013, 08:59:48
If hid_listen just says "Waiting for device:......" (is that what you mean by nothing?) and keeps printing dots it means that either the converter .hex file hasn't been loaded, or that the device is in bootloader mode. (Pressing the reset button on the Teensy (are you using a Teensy?) takes it into bootloader mode; it doesn't run the loaded .hex).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Sun, 17 November 2013, 09:25:31
If hid_listen just says "Waiting for device:......" (is that what you mean by nothing?) and keeps printing dots it means that either the converter .hex file hasn't been loaded, or that the device is in bootloader mode. (Pressing the reset button on the Teensy (are you using a Teensy?) takes it into bootloader mode; it doesn't run the loaded .hex).

What I mean by nothing is I have Terminal open in Mac and I cannot get anything but this screen:

[attach=1]

I am way off.  I do not even know how to get hid_listen to say "waiting for device" or hid_listen to simply work as the prjc website instructs.

I am pretty sure that I am not in Bootloader mode because I have been using this Teensy converter for a couple weeks and everything works fine.

Is the Teensy loader application somehow involved in this hid_listen process?

Is there some step-by-step instructions on how to use hid_listen somewhere?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 17 November 2013, 10:19:02
OK, I just tried the process out from scratch...

1. Right click hid_listen.mac (http://www.pjrc.com/teensy/hid_listen.mac) and save to Downloads.
2. Open Terminal and enter the following commands:
3. mv Downloads/hid_listen.mac .
4. chmod 755 hid_listen.mac
5. ./hid_listen.mac

Note the '.' on the end of the command in step 3, with a space before it.

(If I didn't save to Downloads I got a file named hid_listen.pnt instead of hid_listen.mac (I used Safari), so the PJRC instructions might need updating).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Sun, 17 November 2013, 13:20:27
OK, I just tried the process out from scratch...

1. Right click hid_listen.mac (http://www.pjrc.com/teensy/hid_listen.mac) and save to Downloads.
2. Open Terminal and enter the following commands:
3. mv Downloads/hid_listen.mac .
4. chmod 755 hid_listen.mac
5. ./hid_listen.mac

Note the '.' on the end of the command in step 3, with a space before it.

(If I didn't save to Downloads I got a file named hid_listen.pnt instead of hid_listen.mac (I used Safari), so the PJRC instructions might need updating).

Ok, thanks.  That's what I needed to relieve my cluelessness.  I got things working and I think that I can figure out the remapping now that I will know what each key is doing. 
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 17 November 2013, 14:04:47
Excellent. Now, if you copy it to your desktop (using Finder or whatever) and remove the extension by renaming it to hid_listen, it will start by double-clicking on it :D
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Tue, 26 November 2013, 22:28:44
Ok, so I am trying to get into remapping and ifselect and layers and all that.  I am familiar with the instructions from wcass.  However, I am having trouble saving a document with a ".sc" extension.  I am using the basic text editor in Mac OS.    Any advice?

Also, I am assuming a dos prompt is the Terminal?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 27 November 2013, 08:01:23
Yes, Terminal is the equivalent to Windows dos prompt.

You'll need to change TextEdit Preferences to stop it appending '.txt', see here (http://support.apple.com/kb/ta20406). Also, the format must be changed to plain text - either just for the current file using the Format menu, or as a default for all new files in the Preferences.

In fact, my tools don't actually care what extension is used, as long as the config file is plain text, but it helps to use a distinct extension to distinguish them :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hellmark on Wed, 27 November 2013, 08:04:52
If you're on a Mac, then you want to use Terminal. It isn't a DOS prompt. May look similar, but very very different.

Edit the file with any text editor, then use the scas tool to convert it to a format that can be used directly on the Teensy (the converted file will need the extension .scb). After you convert it, use scwr to send the converted configuration to the teensy.

If you're starting from scratch (a new, blank file, that you're picking the name for), and using TextEdit, when hitting Save, select Plain Text as the file format, and have the filename include the .sc at the end.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 27 November 2013, 08:10:32
That sounds easier :D I hadn't opened TextEdit until a few moments ago - I normally just use 'vi' from the command line :-\
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: TacticalCoder on Wed, 11 December 2013, 11:25:17
Hey all,

I asked a question here and user 'damorgue' pointed me to Soarer's teensy thinggy:

http://geekhack.org/index.php?topic=52158.0 (http://geekhack.org/index.php?topic=52158.0)

and suggested that I'd post my question here after reading this whole thread (which I did but it's so big already that I may have missed quite a few things).

Could this thing be used to, in addition to "XT/AT/PS2/Terminal to USB", also do "USB to USB"? Basically I'd like the remapping (on my HHKB) to be done at a lower-level than the OSes (Linux, OpenBSD, Windows, OS X, whatever) so that the OS has clearly no say about which key I did physically press.

For example I'd like to have one modifier key (not the HHBK's 'fn' key, which I find poorly located), say the key physically at the left of the spacebar, act as a modifier and have that "modifier + ijkl" send arrow keys. But from the OS's point of view I want it to be exactly as if a real arrow key was pressed, with no way whatsoever for the OS to detect that I didn't really press an arrow key.

I know that "PS/2 to USB" adapters do exist (for example I've got several "blue cubes"), but I don't even know if "USB to PS/2" adapters exists. If they do, could I simply do "HHKB  -> USB-to-PS/2  ->  Soarer's teensy ->  USB" and plug that to my computers?



Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 11 December 2013, 15:30:45
This doesn't support USB in, and there are no active USB-to-PS/2 converters afaik.

There's a thread on DT about USB-to-USB (http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841.html) 'converters' for adding in custom functionality, and a couple of choices for firmware, but I'm not sure whether any have seen development in the last year or so.

A better solution is hasu's replacement HHKB controller (http://geekhack.org/index.php?topic=12047.0), either with custom PCB or with Teensy 2.0 or ++ (more pics (http://deskthority.net/workshop-f7/hardware-dvorak-hhkb-t3415.html)). The mod is fully reversible; it just plugs in. With this you'd be able to use the Fn key for something, which you couldn't with a USB-to-USB step.

You'd have to customize source code for any of these options.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: TacticalCoder on Wed, 11 December 2013, 16:07:49
The mod is fully reversible; it just plugs in. With this you'd be able to use the Fn key for something, which you couldn't with a USB-to-USB step.

thanks a lot Soarer, will look into that !

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Sun, 15 December 2013, 13:49:12
OK, I got my first model F yesterday, and even if I can't use for real yet, I am in love with the way it feels! Makes my filco feels cheap when comparing both side by side. Except for the F spacebar that is quite stiff, but I read that it can be mod.

So I am now in a desperate need for a soarer converter!. Since I want to leave my F pretty much untouched, I would like to build an external converter. My F is an XT 5150 (I am pretty sure, not opened yet, but the pictures correspond and it has the round din connector. But since I am new to this kind of things, even after reading most of this thread, I would appreciate some tips on the parts to get. From what I understand, I would need a teensy (or similar variant, someone posted a 5$ thing recently, just can't find it now), a female din plug, a box to put it in, and some wire with bread board to put it all together, with the usb cable (already have one). So it would be super nice if someone could give me some recommendations!

Also, well I would like to mod the spacebar to be lighter. I tried to search on the forum, but the search feature is not giving me what I want. And even if it's build like a thank, I am sure I would manage to break something. Finally, if someone has other tips to restore an F it would be appreciated!

Thx all  :thumb:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 15 December 2013, 15:46:27
There are several ways to accomplish this. I built a box and a variety of adapters for different connections. The most challenging was the one commonly called "RJ45" that I showed in post #901.

For some reason project boxes cost a lot more in black than in beige. This is really cheap, but shipping will be 2-3 weeks from China.

http://www.ebay.com/itm/301037216227?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649 (http://www.ebay.com/itm/301037216227?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649)


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 15 December 2013, 17:44:44
The XT spacebar mods in much the same way as the AT mod (http://geekhack.org/index.php?topic=48288.0).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Sun, 15 December 2013, 18:31:43
The XT spacebar mods in much the same way as the AT mod (http://geekhack.org/index.php?topic=48288.0).

Hum, so the mod is to change the F spacebar with one from a M? But I like this 10x spacebar! And I kind off think that the layout is not as bad as people think it is on my XT. Haven't used in real typing situations, but it seems ok to me and relatively compact too! The worse key seems to be then enter, but I could get used to it!

Well, I will see if I have the guts to take it apart, with no replacement parts. I will probably try to give a look at least and see if I could maybe lube the spacebar stabs or the likes. I think I will start with making the converter so I can use it for real and see from there. Thx for all the info!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 15 December 2013, 18:39:10
Oh, wait, not that one! There was one somewhere about making the spacebar less strong...
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: E TwentyNine on Sun, 15 December 2013, 18:47:28
There's one about changing the bend in the wire over at deskthority:

http://deskthority.net/workshop-f7/model-f-improvement-dis-assembly-tips-and-space-bar-mod-t6982.html
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 15 December 2013, 18:58:55
Yeah, that's the one I was thinking of. For some reason I thought it was about the AT. Anyway, they both have the same kind of spring in them.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Sun, 15 December 2013, 19:31:26
Yeah, that's the one I was thinking of. For some reason I thought it was about the AT. Anyway, they both have the same kind of spring in them.

Thx a lot. Looks much harder than I would have liked lol. Maybe I will grow some thumb muscles for now and see once I have my converter built!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 15 December 2013, 20:34:47
Looks much harder than I would have liked lol.

Cracking a Model F completely open and putting it back together is not for the faint of heart, but it does create an opportunity for a very thorough (and usually much needed) cleaning.

That complicated undercarriage stabilizer system on the small Fs is a real piece of work.

Think of using a weighted thread when you put it back together.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: lukabuz on Mon, 16 December 2013, 11:55:10
 Hello, I recently bough an IBM Model M that has an rj-45 connector. But, the cables on the connector do not match the picture you have given for the rj-45 connector. The colors of the cables are: blank, metal, white, yellow, red, black, blank, blank
(http://i.imgur.com/yDHde62.jpg)
Can you help me identify what cables are for what(vcc, data, clock, gnd, PE)?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 16 December 2013, 12:41:27
You should not trust colors. I made an adapter to go to a standard plug in post #901
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 16 December 2013, 12:42:06
It does match, but perhaps the colours aren't what you expected! Silly IBM. The metal one is PE, which is the shielding ground.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: lukabuz on Mon, 16 December 2013, 12:49:17
It does match, but perhaps the colours aren't what you expected! Silly IBM. The metal one is PE, which is the shielding ground.
Yes, but when you look at both my connector and your picture the same angle, in my picture, there are two blanks on the right and one blank on the left, while on your picture its the other way around
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 16 December 2013, 13:01:26
It does match, but perhaps the colours aren't what you expected! Silly IBM. The metal one is PE, which is the shielding ground.
Yes, but when you look at both my connector and your picture the same angle, in my picture, there are two blanks on the right and one blank on the left, while on your picture its the other way around

[attachimg=1]

Problem solved!  :cool:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: lukabuz on Mon, 16 December 2013, 13:04:53
It does match, but perhaps the colours aren't what you expected! Silly IBM. The metal one is PE, which is the shielding ground.
Yes, but when you look at both my connector and your picture the same angle, in my picture, there are two blanks on the right and one blank on the left, while on your picture its the other way around

(Attachment Link)

Problem solved!  :cool:
is that a joke or is it really how that should be?
Also, is there any way I could use an arduino leonardo instead of a teensy?(they have the same chip)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 16 December 2013, 13:28:29
No joke - the socket diagrams are looking IN to the socket, and that's how the plug lines up to it.

Leonardo should work fine. Use Arduino pin D3 for PD0, and pin D2 for PD1.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 16 December 2013, 13:29:22
thanks, Soarer

this is your arena

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: lukabuz on Mon, 16 December 2013, 13:32:38
yes but how do I load the program onto the arduino itself? Can you tell me which cables go to which pins?
Sorry to bother you with these questions, I don't really know much about this.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: lukabuz on Mon, 16 December 2013, 14:09:15
 Never mind, I have managed to make the converter work with arduino and it works very well. Thank you very much for your help! I am loving my model m so far :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 16 December 2013, 14:24:57
Ah, good! Because to be honest I can't remember how to get a .hex onto a Leonardo, it's been so long! :))

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: lukabuz on Mon, 16 December 2013, 14:51:33
 I used arduinobuilder. Which key is escape?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 16 December 2013, 15:30:17
Top-left key of the numpad by default. You can remap it, of course. You might find configs\Halvar.sc a good starting point for making your own config :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 16 December 2013, 16:11:30
how do I load the program onto the arduino itself?

I used arduinobuilder.

I have ordered one of these "Leonardo Pro Micro ATmega32U4 Arduino" too.

Can you explain your process for me? I am much better with drills and hammers than I am with software.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Halvar on Mon, 16 December 2013, 16:22:23
@fohat.digs: urbancamo described how to do it on DT lately:

http://deskthority.net/photos-videos-f8/ibm-model-m-1395764-with-curious-graphic-legends-1989-t6407.html#p135750

I haven't tried it yet (my Pro Micro clone is still in the mail).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 16 December 2013, 17:11:14
@fohat.digs: urbancamo described how to do it on DT lately:

I haven't tried it yet (my Pro Micro clone is still in the mail).


Thank you. I downloaded it, but Avast made it very difficult, convinced that it was bad, I suppose.

Mine is also in the mail, but I hope to get it soon.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Mon, 16 December 2013, 18:38:35
Ordered a "Leonardo Pro Micro ATmega32U4 Arduino" for my converter, and some stuff to build it!

Wait time now!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: sjbeck86 on Wed, 18 December 2013, 22:30:47
Hello all. I recently took an old keyboard that was going to be thrown away. I want to  use Soarer's teensy converter on it and gift it to a friend who I think would really enjoy it. My only problem is that I have no idea what the pinout is. I can find very little information about it on the internet. What I do know is it is a Cherry G80-1080 and appear to use a 4P4C. Because of the common connector and having no idea what it goes to I can't figure out how to correctly wire it. I'm fairly sure trial and error would not have good results  :p Any help would be greatly appreciated!

(http://i.imgur.com/vzdHKW6h.jpg)
(http://i.imgur.com/xYPSjzW.jpg)
(http://i.imgur.com/T8DLUiAh.jpg)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 18 December 2013, 23:51:51
Welcome! :D

That's a pretty unusual keyboard; I don't know whether I've seen that layout before on a Cherry.-branded 'board, or any with a 4P4C connector. It's somewhat similar to the WYSE 3161 keyboard in layout, in the connector, and some of the legends seem to match it as well. So I'm not sure if this converter will handle it... but I'm also working on a WYSE converter :cool:

Some pics of the insides, and/or the markings on the chips, might help identify it. Following the PCB tracks from where the cable connects should identify power and ground fairly easily. Do you have a multimeter?

Here's the WYSE 3161 keyboard for comparison:

[attachimg=1]

And then there's a more original IBM keyboard (http://deskthority.net/photos-videos-f8/ibm-model-m-1395764-with-curious-graphic-legends-1989-t6407.html?hilit=3161), which lacks F13 to F16, but has the same extra markings on the numpad as the WYSE 3161.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: sjbeck86 on Thu, 19 December 2013, 21:44:10
Here are some more shots of the board that might help in identifying it. While I had it apart yesterday I hadn't thought to take a picture of the back. I do have a multimeter, although I'm pretty new to working on electronics. I just wanted to thank you for your help!

(http://i.imgur.com/znjbunQ.jpg)
(http://i.imgur.com/ar2nMg3.jpg)
(http://i.imgur.com/ndINsYs.jpg)
(http://i.imgur.com/3Eif1JV.jpg)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 20 December 2013, 05:56:39
Ah good, it will be easier with a multimeter than tracing tracks by eye! Just by the components present, a PS/2 type of interface is looking like a possibility. If your multimeter has a continuity setting that beeps when the probes are shorted together that's all we need, if it doesn't then use a resistance range and the display.

First we're looking for which wires connect to power and ground, and the easiest place to find those is on the smaller logic chips, pins 14 and 7:

(http://makeyourownchip.tripod.com/7407diagram.GIF)

Then it's time to attach it to a Teensy (or Arduino Leonardo, or...) using pins PD0 and PD1 and run the logic analyzer (http://deskthority.net/workshop-f7/simple-logic-analyzer-for-teensy-t4567.html) hex to see if the other two wires are outputting data, and if so, what format it is in. If you're really lucky, it's PS/2 and the wiring will be correct to try the converter hex (50% chance that clock and data would need to be swapped, so perhaps make those connections temporary at one end since it's easy to damage the tracks on a Teensy when removing a wire).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: lukabuz on Fri, 20 December 2013, 09:44:24
 Which key is num lock?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 20 December 2013, 10:42:22
Which key is num lock?

Next one along!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: IvanIvanovich on Fri, 20 December 2013, 19:29:56
I have a similar model, an 1191, PCB 601-1701 rev.00. If yours is the same PCB...
[attach=1]
It's good chance that is what it will be, as it is on mine.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Fri, 20 December 2013, 19:59:55
Thanks Ivano! Does your 'board speak regular Extended Set 2 protocol?

Actually... did you mean the 1207? What do its 4 extra keys output as?

(http://i426.photobucket.com/albums/pp349/lysol8086/DSC01680_zps5dd5ff2c.jpg)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: IvanIvanovich on Sat, 21 December 2013, 11:41:04
I got rid of that one, well even it's the same as the 1191 internally. 1191 have the same exact pcb but dosen't have the 4 extra function soldered on. Windows didn't understand what the extra 4 function keys and ignored them. I couldn't tell you what it told me in aqua anymore for scancode. It's a normal PS/2 keyboard.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 21 December 2013, 12:04:55
Ah, I see, thanks! Possibly the extra keys were meant to work with some terminal emulation software, so it wouldn't matter if they weren't recognized otherwise. Anyway, that does improve the odds that the 4P4C version is also PS/2!

Still worth checking power and ground before wiring the 4P4C version up though, just to be sure!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: IvanIvanovich on Sat, 21 December 2013, 13:27:00
Good chance it's PS/2 or otherwise I would guess it was meant as aftermarket for Wyse/Reynolds/Link/etc terminal and would speak that. Sometimes it is hard to figure out what things are with Cherry, they did some really odd things at times like the weirdness that is my G80-2550 terminal AS400 layout... I am still not sure what the hell that speaks. I also have some G80 that seem to be serial over a DIN5 AT plug?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: gogi-goji on Sun, 22 December 2013, 23:16:01
When foraging in my dad's lab for a replacement power supply for my computer, I happened across this forgotten beauty hidden away in a cupboard:

http://imgur.com/P01MGrf

I've never felt any kind of keyboard other than rubber domes or scissor switches before, so I was somewhat entranced by the feel of the keys in this keyboard and took it home.  Nobody at the lab while I was there could remember where it came from.  It's part number is 1801449, but searching that didn't really get me anywhere.  From what my searching could gather, it's a Model F PC/XT keyboard, made between 1983-87.  It has a 5 pin DIN connector (which is the same as for AT keyboards, right?).  Does that all sound like accurate information, and am I using the terminology correctly?

Elsewhere in the lab, I did find a AT to PS2 adapter cable, but I don't have any computers with PS2 ports or PS2/USB converters to try it out with.  So I thought that I might build one of Soarer's converters and learn some basics about circuitry and microprocessors in the process!  (I also thought it'd be nice to be able to get some some notification LEDs and remap a couple of things on the keyboard to make the funky layout more usable.)

Of course, I don't know how to solder, so I thought I'd do it on a breadboard.  Is it possible to get any kind of DIN 5 pin connector to plug into a breadboard, or at least connect it without soldering?  Where should I look?  (Shipping to Canada, or physical Canadian stores to go to)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Mon, 23 December 2013, 07:40:44
I don't know how to solder, so I thought I'd do it on a breadboard.  Is it possible to get any kind of DIN 5 pin connector to plug into a breadboard, or at least connect it without soldering?  Where should I look?  (Shipping to Canada, or physical Canadian stores to go to)

You can't avoid connecting a few wires. At the minimum, you will have to strip 4 wires from the keyboard side to make the connection to the Teensy.

The connector is the same as the AT, that is good news. If you can find a female AT connector, cut it off for the wiring to the Teensy to preserve the original cable.

Figure out what gender of wiring you need, these guys sell variations.


http://www.ebay.com/itm/40pcs-20cm-Dupont-Male-to-Female-Breadboard-Jumper-Wire-For-Raspberry-Pi-Arduino-/171065859856?pt=LH_DefaultDomain_0&hash=item27d451df10
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 23 December 2013, 08:57:25
Yeah, breadboards really aren't ideal for a permanent setup. I think there are some PCB mount 5-pin DIN sockets that have pins spaced so they'll fit in a breadboard - but the pins are short and it wouldn't be very secure! OK for testing though.

A more permanent non-solder option is to fit a Teensy-with-pins inside the keyboard using female-to-female jumper wires (but then you can't fit LEDs).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: gogi-goji on Tue, 24 December 2013, 18:39:31
Thanks for chiming in!  Fair points about the delicacy of a breadboard-based solution, but at the very least I'd probably want to test things out on a breadboard first to make sure I can get everything actually working before messing around with getting a case and more-permanent wiring set up for the converter.

So I don't need to sacrifice the original cable at the alter of experimentation, is there any reason something like https://www.adafruit.com/products/1134 (https://www.adafruit.com/products/1134) or https://www.sparkfun.com/products/9536 (https://www.sparkfun.com/products/9536) wouldn't work?  If so, then I could use that for testing, and perhaps something in the vein of http://store.curiousinventor.com/5-pin-midi-din-panel-mount-connector.html (http://store.curiousinventor.com/5-pin-midi-din-panel-mount-connector.html) in a more permanent solution inside some sort of case for the converter.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 24 December 2013, 19:14:18
Yep, that plan would work fine and tide you over until you decide on a case etc. :D

Probably worth getting some 6" jumper wires at the same time: at least M-M (for breadboarding), and maybe F-F (useful for connecting to various plugs and Teensy pins etc).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Sat, 28 December 2013, 23:11:10
Noob here

Can I get a 122 key 1390876 with the 5 pin cord to work with the soarers convertor? I found a page with info about the plug at

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

edit: its a terminal and soarers will work with it
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 29 December 2013, 08:01:09
Get something like this if you want to preserve your original cable:

http://www.ebay.com/itm/5-PIN-DIN-SOCKET-270-DEGREES-FEMALE-INLINE-PACK-Of-5-/120543224004?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item1c10efa0c4 (http://www.ebay.com/itm/5-PIN-DIN-SOCKET-270-DEGREES-FEMALE-INLINE-PACK-Of-5-/120543224004?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item1c10efa0c4)


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: damorgue on Wed, 01 January 2014, 13:34:12
Lets say I make a converter which has 4 different types of sockets soldered to the teensy at the same time. I don't think they will interfere with one another assuming only one keyboard is plugged in. I am however wondering what would happen if one would accidentally connect two boards at the same time. I am certain it will cause havoc and not work, but will it short/break something?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 01 January 2014, 14:22:12
No, it won't break anything :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: damorgue on Wed, 01 January 2014, 14:37:38
I am just waiting for the last few parts. I have found panel-mountable sockets for most of the connectors that are relevant. I will put them inside a small aluminum box with the teensy and create a neat little universal adapter.

Edit: Could the two 1kOhm pull-up resistors be placed one between PD0 and Vcc and the second between PD1 and Vcc straight on the teensy 2.0?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 01 January 2014, 17:20:35
I will put them inside a small aluminum box with the teensy and create a neat little universal adapter.

I considered that, and it is very cool, but eventually I came to the conclusion that the most direct and straightforward configuration would be a box with a single female receptacle. I used the AT ("large DIN") style plug and built a set of short pigtail adapters to mate with it.

That included:

Female 240 degree DIN to male AT (for IBM terminals),

Female PS/2 to male AT (for most "quasi-modern" keyboards), and

Female "RJ45" (actually 8C8P ethernet coupler with the proper 4 wires connected) to male AT (for other terminal keyboards).


Regular "old-school" keyboards, which are the majority of what people will use here (including Model F AT and XT) will plug in directly.

Last, I just need to figure out how to pin an ancient serial keyboard and the ADB (so I can use it with those great Alps Apple Extended Keyboards) and I will be all done.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fauxsoul on Sat, 04 January 2014, 02:09:29
I am going to be using a long cable and I just wanted to clarify, where exactly do I put the pull up resistors?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 04 January 2014, 11:29:23
You might not need resistors at all, unless your cable is very long; most standard cables should be fine without them.

They should be somewhere near the Teensy end. Exactly where depends on how you're building your converter. If you're using stripboard to mount the Teensy onto, then on there is ideal. If you're using a panel mounted DIN socket, then attaching them onto its pins is probably easiest. Otherwise, you could fit them into the Teensy's holes, and then solder the wires from data and clock onto the legs of the resistors. Taking care to avoid shorting anything out, of course.  Lot's of choices!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Sun, 05 January 2014, 01:13:03
Get something like this if you want to preserve your original cable:

http://www.ebay.com/itm/5-PIN-DIN-SOCKET-270-DEGREES-FEMALE-INLINE-PACK-Of-5-/120543224004?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item1c10efa0c4 (http://www.ebay.com/itm/5-PIN-DIN-SOCKET-270-DEGREES-FEMALE-INLINE-PACK-Of-5-/120543224004?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item1c10efa0c4)

anything in the USA for this?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fauxsoul on Sun, 05 January 2014, 02:52:21
You might not need resistors at all, unless your cable is very long; most standard cables should be fine without them.

They should be somewhere near the Teensy end. Exactly where depends on how you're building your converter. If you're using stripboard to mount the Teensy onto, then on there is ideal. If you're using a panel mounted DIN socket, then attaching them onto its pins is probably easiest. Otherwise, you could fit them into the Teensy's holes, and then solder the wires from data and clock onto the legs of the resistors. Taking care to avoid shorting anything out, of course.  Lot's of choices!


Thank you for your response, and taking the time to do this work in general.
The cable that I will be using is 3 meters, so if I did add the pullup resistors I would place them between the Teensy and the din?
Sorry I'm kind of new to things like this.

http://imgur.com/KYT0FO2 (http://imgur.com/KYT0FO2)

Wired up just waiting for my keyboard in the mail.


Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 05 January 2014, 09:26:09
At 3 metres you should be fine without pullups.

They could be fitted across pins of the DIN, kinda like this (except they don't fit as neatly as drawn):

[attachimg=1]

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fauxsoul on Sun, 05 January 2014, 10:08:06
At 3 metres you should be fine without pullups.

They could be fitted across pins of the DIN, kinda like this (except they don't fit as neatly as drawn):

(Attachment Link)

Sounds good thank you, I will just leave them out for now.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: meeeeeep on Tue, 07 January 2014, 10:49:56
Hmm... My AltGr is reported as LAlt (VK=A4, SC=038) and my WinKey is not found (VK=EA, SC=05C) using Soarer Converter v1.12 with Teensy 2.0 on my Swedish Steelseries 7G keyboard.

Is the source code available so i can try to fix this myself?

Edit: Normally without the converter the AltGr key translates to LControl (VK=A2, SC=01D) + RAlt (VK=A5, SC=138) and the WinKey translates to RWin (VK=5C, SC=15C).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 07 January 2014, 15:21:27
It sounds like the 7G isn't sending the normal scan code sequences for those keys. My guess is that it's using something other than E0 to indicate an extended set 2 code, since dropping the E0 turns right alt into left alt, and left gui into keypad comma (which is only recognised on certain layouts, like Brazilian).

Can you try running running hid_listen (http://www.pjrc.com/teensy/hid_listen.html) to see what codes are actually coming from the keyboard?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Tue, 07 January 2014, 15:23:23
122 coming in two days, pro micro coming in 2 weeks

So I solder the pins to the pro micro, solder wire from the terminal cable to the pro micro, then load the software on the pro micro, and I'm set?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 07 January 2014, 15:38:55
Pretty much (assuming you've decided to cut the plug off the IBM cable).

You don't have to use the pins, but they do give a good solid place to solder to if you're a bit clumsy with the iron!  :))
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Tue, 07 January 2014, 15:47:42
Pretty much (assuming you've decided to cut the plug off the IBM cable).

You don't have to use the pins, but they do give a good solid place to solder to if you're a bit clumsy with the iron!  :))

Cool, thanks! Will cut the plug because its unlikely I'll ever find a terminal board
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 07 January 2014, 18:47:58
unlikely I'll ever find a terminal board

In reply #901 I showed my terminal adapter pigtail to work with my female DIN (aka AT) socket. You might want to be able to test another keyboard some day.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: meeeeeep on Wed, 08 January 2014, 15:40:10
It sounds like the 7G isn't sending the normal scan code sequences for those keys. My guess is that it's using something other than E0 to indicate an extended set 2 code, since dropping the E0 turns right alt into left alt, and left gui into keypad comma (which is only recognised on certain layouts, like Brazilian).

Can you try running running hid_listen (http://www.pjrc.com/teensy/hid_listen.html) to see what codes are actually coming from the keyboard?

Sure:

[example] A-key:
r1C +04 d04 (when first pressing)
r1C (while being pressed, this code repeats)
rF0 r1C -04 u04 (when releasing)

[example] Left Alt-key:
r11 +E2 dE2
r11
rF0 r11 -E2 uE2

[broken] Swedish Right Alt-key (labeled Alt Gr):
rE0 r11 +E2 dE2
rE0 r11
rE0 rF0 r11 -E2 uE2

[broken] Right Windows-key:
rE0 r27 +8C d8C
rE0 r27
rE0 r27 rE0 rF0 r27 -8C u8C
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 08 January 2014, 15:49:07
Hmm, that looks normal. Maybe it's not being detected as an extended set 2 keyboard... what does hid_listen say when you first connect the USB end of the converter? Should tell us the keyboard ID and which set etc.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: meeeeeep on Thu, 09 January 2014, 08:01:40
Hmm, that looks normal. Maybe it's not being detected as an extended set 2 keyboard... what does hid_listen say when you first connect the USB end of the converter? Should tell us the keyboard ID and which set etc.

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

Listening:
rAA wEE rEE wF2 rFA

remaining: FFFC


Keyboard ID: 0000
Code Set: 2
Mode: AT/PS2
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 09 January 2014, 08:11:50
Yep, that's the problem right there - it's not replying with any ID! That is technically a bug with the 7G's implementation of PS/2 protocol.

You'll need to use a config file, and add this line to it:

Code: [Select]
force set2ext

Then compile it with scas and write it to the converter with scwr (or just drag/drop it onto scaswr.bat if you're using Windows). The Teensy should be in normal running mode to do that, not bootloader mode.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Fri, 10 January 2014, 15:35:43
Hey all, I just ordered an IBM model F with the 122 style layout. The info I found on it (from deskauthority) is that it has some inactive keys. Will these keys be totally not working or will there be a way to make em work with the converter?

Thx for the answer!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 10 January 2014, 16:15:28
Will these keys be totally not working or will there be a way to make em work with the converter?

Lucky you. Welcome to the aircraft carrier club.

All my keys worked straight away with Soarer's Converter and a Teensy, after it was set up with the hex file.

Use the wcass method (reply # 560) to program the weird keys for whatever you want.

PS - if you are talking about the "secret keys" that is something different
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Fri, 10 January 2014, 21:26:49
Will these keys be totally not working or will there be a way to make em work with the converter?

Lucky you. Welcome to the aircraft carrier club.

All my keys worked straight away with Soarer's Converter and a Teensy, after it was set up with the hex file.

Use the wcass method (reply # 560) to program the weird keys for whatever you want.

PS - if you are talking about the "secret keys" that is something different

What secret keys are you talking about? The ones for the ansi mod?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fourzeropooh on Fri, 10 January 2014, 22:56:10
Hey all, I just ordered an IBM model F with the 122 style layout. The info I found on it (from deskauthority) is that it has some inactive keys. Will these keys be totally not working or will there be a way to make em work with the converter?

Thx for the answer!

The $55 one?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Fri, 10 January 2014, 22:57:30
Hey all, I just ordered an IBM model F with the 122 style layout. The info I found on it (from deskauthority) is that it has some inactive keys. Will these keys be totally not working or will there be a way to make em work with the converter?

Thx for the answer!

The $55 one?

Yea
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fourzeropooh on Fri, 10 January 2014, 23:03:07
Hey all, I just ordered an IBM model F with the 122 style layout. The info I found on it (from deskauthority) is that it has some inactive keys. Will these keys be totally not working or will there be a way to make em work with the converter?

Thx for the answer!

The $55 one?

Yea

Nice :thumb:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: minium on Sat, 11 January 2014, 00:14:35
Will these keys be totally not working or will there be a way to make em work with the converter?

Lucky you. Welcome to the aircraft carrier club.

All my keys worked straight away with Soarer's Converter and a Teensy, after it was set up with the hex file.

Use the wcass method (reply # 560) to program the weird keys for whatever you want.

PS - if you are talking about the "secret keys" that is something different

I bought one from the same BIN. I have the M version and was wondering, is an M122 also an aircraft carrier? 'Cause that was my first thought when I stripped it down and saw the plastic barrel board. Maybe the F is a Nimitz Class.

ps. your rant on BIN was what helped me jump on it. thx.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Thu, 16 January 2014, 06:19:51
Which version?

The original version of the Model M 122-key looks externally like a Model F 122-key, but has a plastic base instead of steel.

The later version has smaller bezels.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Thu, 16 January 2014, 07:24:39
Which version?

They are all about 22"x8"x2" but the F-122 weighs over 8 pounds and the M-122 is about 6.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: minium on Thu, 16 January 2014, 10:50:06
This is the M-122 that I bought: http://www.ebay.com/itm/181248084476 . To my eye it looks like an F, except that it doesn't have stepped keys or a black back. The "Model: M" on the back should be the clincher ;-) . My F-122 will be here next week. I'll have to get out the luggage scale and weigh both of them.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bhtooefr on Thu, 16 January 2014, 11:20:21
That's the early one.

The late one has a bezel that's only as thick as a 1391401.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Sun, 26 January 2014, 17:32:16
I have a terminal M, want to cut the wires where the grey cable starts and then solder them to a pro micro.

(http://i.imgur.com/6Tlpyg6.jpg)

Which color wire goes with which part? I'm pretty confused



pro micro pins:
(http://deskthority.net/resources/pins-on-leonardo-pro-micro-for-soarer-s-converter/9181)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sun, 26 January 2014, 18:21:06

Which color wire goes with which part? I'm pretty confused


You can trace them backwards from the diagram if you have a very thin probe.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Thu, 30 January 2014, 21:00:11
Hi Soarer,

I received my pro micro and tried to load the hex onto it but I get a strange error and would like your feedback on it. Here's what I did so far:

(I am on Windows 7 btw)
1. I installed the arduino software to get the driver and avrdude and winavr since I realised quite late that the arduino thing had it, but anyway.
2. I put the pro micro on a breadboard and plugged a usb cable in it and in my computer. It was detected as a Leonardo on COM3. I put a cable in the rst pin and then in the grd pin next to it.
3. I copied the Soarer_at2usb_v1.12_atmega32u4.hex on my c.
4. I opened a command window and typed the following: avrdude -patmega32u4 -cavr109 -PCOM3 -Uflash:w:Soarer_at2usb_v1.12_atmega32u4.hex
5. then avrdude starts and says : connecting to programmer. After a while, it gives me the following message: Found programmer: Id = "<- ("; Type = clover symbol (the symbol itself) Software version =  . ; Hardware version = . avrdude: error:  buffered memory access not supported. Maybe it isn't a butterfly/avr109 but a avr910 device?

So do you have any idea on what to do from there? What I could have done wrong? I rebooted my computer to make sure it was not a new driver issue, with no success. I am quite n00b at this so all help would be welcome!

edit: btw, after some googling, only info I found on this problem points to usb port/cable issue or reset issue. I tried 3 different usb ports and go the same error. Cable is cheap, got some new on the way, so maybe ... as for reset, is there a way of telling it happened?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Thu, 30 January 2014, 22:12:47
I think you're almost there... to reset it have the wire in rst and just tap the other end against the USB socket to ground it briefly. Then Windows might load the driver again, on a different COM port. You only get about 8 seconds after resetting, so get your command line ready first, then reset, then quickly hit enter to run the command.

Mine came with an LED blink hex loaded onto it, so when the flashing stopped it was running the bootloader.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Thu, 30 January 2014, 22:40:00
I think you're almost there... to reset it have the wire in rst and just tap the other end against the USB socket to ground it briefly. Then Windows might load the driver again, on a different COM port. You only get about 8 seconds after resetting, so get your command line ready first, then reset, then quickly hit enter to run the command.

Mine came with an LED blink hex loaded onto it, so when the flashing stopped it was running the bootloader.

Woot, it worked! For everyones knowledge, when you reset it you will see the Leonardo disappear from de devices in the ports and be replaced with a bootloader (in a different com port for me). So I had to try it 2-3 times before I had the good setup with the good port in the command line. Also, to reset, I had to poke the usb connector more than I expected, but it end up working anyway.

Let's hope I'll manage to hook it up correctly tomorrow and try my XT at least!

Thx a lot Soarer. There will probably be more questions to come, but one thing at a time  :thumb:
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Fri, 31 January 2014, 09:22:56
I appreciate you guys doing all the dirty work for me.

I have had one of these for a month but have not taken it out of the bag yet because I was not in the mood to waste a bunch of time.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Fri, 31 January 2014, 09:29:37
I appreciate you guys doing all the dirty work for me.

I have had one of these for a month but have not taken it out of the bag yet because I was not in the mood to waste a bunch of time.


If you encounter any problem just post it and I'll share my experience as best as I can! It's always a small detail that makes the difference between a succes and a failure and often the error you get tells you close to nothing!


By the way, something I did not mention is that you need to be in the folder where your .hex is when you are in the command line window. For example, by default I was in the c:\users\user directory and I had copied my .hex directly on my c drive. So a basic cd .. twice got me back on the c directly and it worked. As long as you are at the same place as the .hex it should work.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bcg on Sun, 02 February 2014, 13:12:29
Hi guys... I have my AT Model F connected via Soarer's converter, its working well except I don't like how the shift keys work with the number pad... for example if I have num lock off and I do Shift+Home it outputs a 7 ... I use Shift+Home, Shift+End, and Shift+Insert all the time so this is kind of a pain... is there any easy way to remap that ?  thanks
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Tue, 04 February 2014, 21:57:02
Hi Soarer,

I finally soldered a basic DIN5 female connector to my pro micro that I had loaded with the hex. I plugged my XT keyboard to it and plugged it with a usb cable to my computer.

It is being detected as a soarer keyboard but nothing happens when I press a key. I started hid_listen and here's what I get when I plug the keyboard:

Listening:
wEE

remaining: FFFC


Keyboard ID: 0000
Code Set: 1
Mode: PC/XT

I tested the continuity on my female connector and it seems fine but I am new to all of this (haven't played with a multimeter for 15 years).

Whatever I press nothing happens. The keyboard has not been tested since I got it since I didn't have a converter on hand, but it was supposed to be working.

What should I do from there?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 05 February 2014, 06:20:16
Double-check that the socket isn't wired backwards.

Then the best way to test is to open the XT and test continuity for all four lines all the way from the Pro Micro to the XT's PCB. See here (http://geekhack.org/index.php?topic=17458.msg1108249#msg1108249).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 05 February 2014, 15:15:17
Hi guys... I have my AT Model F connected via Soarer's converter, its working well except I don't like how the shift keys work with the number pad... for example if I have num lock off and I do Shift+Home it outputs a 7 ... I use Shift+Home, Shift+End, and Shift+Insert all the time so this is kind of a pain... is there any easy way to remap that ?  thanks

Which OS? (That stuff works OK for me on Windows).

I've got stuff like numpad modes and 'ways to react to lock state' on my to-do list... but also a lot else!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: bcg on Thu, 06 February 2014, 16:35:27
Hi guys... I have my AT Model F connected via Soarer's converter, its working well except I don't like how the shift keys work with the number pad... for example if I have num lock off and I do Shift+Home it outputs a 7 ... I use Shift+Home, Shift+End, and Shift+Insert all the time so this is kind of a pain... is there any easy way to remap that ?  thanks

Which OS? (That stuff works OK for me on Windows).

I've got stuff like numpad modes and 'ways to react to lock state' on my to-do list... but also a lot else!

Debian Linux w/ Menta desktop environment

Probably something in my X settings... I'll take a look, thanks Soarer
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Sat, 08 February 2014, 13:01:40
Double-check that the socket isn't wired backwards.

Then the best way to test is to open the XT and test continuity for all four lines all the way from the Pro Micro to the XT's PCB. See here (http://geekhack.org/index.php?topic=17458.msg1108249#msg1108249).

Hi Soarer,

I tested the continuity and they were all fine. After looking once more at where I plugged each cable and seeing all was fine as far as I understand it, I plugged it again, and got the same result. Then I unplugged each cable on the breadboard on which my pro micro is and I saw one had some kind of plastic on the metal part that is plugged (the clock one). So I removed this plastic thing and then I got a signal. Here's what I get when I plug it in now:

[attachimg=1]

I saw that these r something are bad, but don't know how to correct them... n00b needs help here!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Sat, 08 February 2014, 14:34:57
Does the converter support the Commodore Amiga A2000?

Can I just plug it in to my external Teensy box, or do I have to reset something?

Thanks!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 08 February 2014, 14:42:16
JPG - If you get one rFF for each key press and each release, that probably means that the data line isn't connected somewhere.

I'm not sure you did the continuity test quite how I meant, since you had a problem with clock still! I really meant to test from each pad on the XT's PCB, to the corresponding pin right on the Pro Micro, which would test every connection in between.

But now that clock is working, you could just pull the data wire out of the breadboard and see if you get the same behaviour :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sat, 08 February 2014, 15:05:48
Does the converter support the Commodore Amiga A2000?

Can I just plug it in to my external Teensy box, or do I have to reset something?

Thanks!


Nope. It looks (http://amigadev.elowar.com/read/ADCD_2.1/Hardware_Manual_guide/node0173.html) quite simple - simpler than XT, in fact, with no start bit - but there's a startup and re-sync sequence to cope with before it will talk.

Nothing will blow up if you connect it; the pinout and signalling seem to be the same as XT/AT (just the protocol is different). But you'll get a lot of R05 errors!

If I get one I'll code for it, but it looks too tricky to code without the keyboard at hand.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Sun, 09 February 2014, 10:42:24
JPG - If you get one rFF for each key press and each release, that probably means that the data line isn't connected somewhere.

I'm not sure you did the continuity test quite how I meant, since you had a problem with clock still! I really meant to test from each pad on the XT's PCB, to the corresponding pin right on the Pro Micro, which would test every connection in between.

But now that clock is working, you could just pull the data wire out of the breadboard and see if you get the same behaviour :)

Well, I get this result without pressing any key. And yea, I tested the continuity from the pcb pins to the pcb pads, will do it from pads to pro micro next time.

I will do some more testing then and see what I can get from it, but when I was pressing a key nothing happened after the initial flow of rFF. More debugging to go!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Mon, 10 February 2014, 22:23:23
So I tried installing Arduino. I tried (but could not succeed) in installing avrdude. Tried arduino builder: what was recommended here: http://deskthority.net/photos-videos-f8/ibm-model-m-1395764-with-curious-graphic-legends-1989-t6407.html#p135750

and nothing. The hex never got flashed over to the pro micro.

Does anyone else have other options? Apart from getting a teensy (of which two have been ordered in jdcarpes GB and are last ditch for this convertor)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: jdcarpe on Mon, 10 February 2014, 22:40:21

So I tried installing Arduino. I tried (but could not succeed) in installing avrdude. Tried arduino builder: what was recommended here: http://deskthority.net/photos-videos-f8/ibm-model-m-1395764-with-curious-graphic-legends-1989-t6407.html#p135750

and nothing. The hex never got flashed over to the pro micro.

Does anyone else have other options? Apart from getting a teensy (of which two have been ordered in jdcarpes GB and are last ditch for this convertor)

Keep trying over and over again with avrdude. Short RST to GND and wait about a second, then hit enter on your avrdude programming command at the command line. Try that over and over until it finally works. Took me over 20 tries, I'm certain, before it successfully flashed to my Pro Micro clone.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Mon, 10 February 2014, 22:49:57

So I tried installing Arduino. I tried (but could not succeed) in installing avrdude. Tried arduino builder: what was recommended here: http://deskthority.net/photos-videos-f8/ibm-model-m-1395764-with-curious-graphic-legends-1989-t6407.html#p135750

and nothing. The hex never got flashed over to the pro micro.

Does anyone else have other options? Apart from getting a teensy (of which two have been ordered in jdcarpes GB and are last ditch for this convertor)

Keep trying over and over again with avrdude. Short RST to GND and wait about a second, then hit enter on your avrdude programming command at the command line. Try that over and over until it finally works. Took me over 20 tries, I'm certain, before it successfully flashed to my Pro Micro clone.

I will do that. After 5ish tries, I started giving up. I guess I have to brute force it.

Thanks for the help!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Tue, 11 February 2014, 06:19:12
Double-tap reset to ground, then it should stay in bootloader mode for a few seconds.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Tue, 11 February 2014, 06:25:10
For everyone knowledge, here's a more complete list of steps I did to load my pro micro:





1. I installed the arduino software to get the driver and avrdude and winavr since I realised quite late that the arduino thing had it, but anyway.
2. I put the pro micro on a breadboard and plugged a usb cable in it and in my computer. It was detected as a Leonardo on COM3. I put a cable in the rst pin.
3. I copied the Soarer_at2usb_v1.12_atmega32u4.hex on my c.
4. I opened a command window and typed the following: avrdude -patmega32u4 -cavr109 -PCOM3 -Uflash:w:Soarer_at2usb_v1.12_atmega32u4.hex (Don't press enter yet and be sure you are located on the directory where the converter is, on the c drive for me, you can use cd .. to go back and other cd commands to move to the directory you use)
5. Then you need to open your device window where you see your ports and you connect a cable to the rst pin and tap the other side to the micro usb connector (I had to do it a few times to make it works).
6. When it works, you will see your Leonardo device being disconnected in your port list, and a bootloader will appear and will last for around 5 seconds. You need to first look at which port it will use.
7. Then you change the port in you command line to put the one you saw for the bootloader (PCOM6 for example).
8. Then you tap the cable again to get your bootloader and when it appears you press enter in the command line. It should start loading your hex at this point.


P.S.: Taping the cable to get the bootloader to show has not been so easy. Try different parts of the usb connector (sides worked better for me, and holes in it too, I don't know why).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hubbert on Sat, 15 February 2014, 11:38:28
Thanks again for all the great work.  Now that 1.0 is long released, is there any chance of releasing the source?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 16 February 2014, 08:36:56
I keep thinking about it, but never seem to find a good time to do it. Unless I can find a way to remove certain info from the git repo, I won't be able to simply make my repo public. In all likelihood, I'll have to start a new repo without any history, which is a pain.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Hubbert on Sun, 16 February 2014, 12:30:03
Yeah, I hate to make extra non-fun work for you.  You've done such a great job of promptly maintaining the software so far that opening the source might not really speed development much.  But maybe it would help occasionally.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Sun, 16 February 2014, 15:21:09
If you're on a Mac, then you want to use Terminal. It isn't a DOS prompt. May look similar, but very very different.

Edit the file with any text editor, then use the scas tool to convert it to a format that can be used directly on the Teensy (the converted file will need the extension .scb). After you convert it, use scwr to send the converted configuration to the teensy.

If you're starting from scratch (a new, blank file, that you're picking the name for), and using TextEdit, when hitting Save, select Plain Text as the file format, and have the filename include the .sc at the end.

So after a couple months of procrastination, I have got back to attempting a remap.  I am using wcass's instructions from way back on page 19, but I cannot seem to get past the first step of drag and dropping the scas.exe file.  I know of the tools in the Docs folder, but dragging and dropping scas into Terminal does not seem to do anything.  All it says is "no such file or directory" or if I just enter "scas" into terminal, it says "command not found".

So do I use this scas tool in Terminal?  And where do I find this tools folder that I need to drag and drop from?

If you're on a Mac, then you want to use Terminal. It isn't a DOS prompt. May look similar, but very very different.

Edit the file with any text editor, then use the scas tool to convert it to a format that can be used directly on the Teensy (the converted file will need the extension .scb). After you convert it, use scwr to send the converted configuration to the teensy.

If you're starting from scratch (a new, blank file, that you're picking the name for), and using TextEdit, when hitting Save, select Plain Text as the file format, and have the filename include the .sc at the end.

So after a couple months of procrastination, I have got back to attempting a remap.  I am using wcass's instructions from way back on page 19, but I cannot seem to get past the first step of drag and dropping the scas.exe file.  I know of the tools in the Docs folder, but dragging and dropping scas into Terminal does not seem to do anything.  All it says is "no such file or directory" or if I just enter "scas" into terminal, it says "command not found".

So do I use this scas tool in Terminal?  And where do I find this tools folder that I need to drag and drop from?

EDIT:  Nevermind, I found the tools in v. 1.10.  I mistakingly thought the latest version would have all the tools that I needed.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: vivalarevolución on Sun, 16 February 2014, 18:19:52
Alright, I figured it all out once I was able to locate that tools folder.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Sun, 16 February 2014, 19:45:48
Sorry, yeah, tacking 'update' on the end of the zip name has become a pattern, so I don't mention it every time these days! I should add 'full' to the complete ones perhaps.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Mon, 17 February 2014, 20:01:42
Well I finally managed to make it work. My setup was a n00b total mess, but at least I had to connexions right.

My setup is still temporary since I removed the cable, plugged some female DuPont connector directly in the pins for the cable, thx for the test pads! The female cables are going out where the original cable goes and they are plugged directly in the pro micro.

Just sad that my 8 key is dead, but for home it's not a major issue. The stiff spacebar and the weird layout will need time getting used to until I get the guts to fully open the layer sandwich and solve these issues!

Soon it will be time to test my F122, but I am still super happy that it's working for now!!!

Thx a lot Soarer, your converter is absolutely amazing! If not for some little difficulties loading the hex and having a proper connexion, it would have been quite plug and play!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Tue, 18 February 2014, 19:36:39
Does anybody know where to buy XT female sockets to use with this converter?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 18 February 2014, 19:49:11
Does anybody know where to buy XT female sockets to use with this converter?

Don't know what you are looking for. I used the first one of these for my outboard Teensy.

http://www.ebay.com/itm/5-pcs-Metal-shell-5-Pin-DIN-Plug-Female-socket-Connector-Cables-Soldering-DIY-/130974257924?pt=LH_DefaultDomain_0&hash=item1e7eac9304

http://www.ebay.com/itm/2-Studer-Revox-54-02-0310-5-Pin-Din-Socket-NOS-/121275704801?pt=Vintage_Electronics_R2&hash=item1c3c9865e1
http://www.ebay.com/itm/PS2-MALE-PLUG-TO-AT-FEMALE-SOCKET-KEYBOARD-ADAPTER-CABLE-/390683050301?pt=UK_VintageComputing_RL&hash=item5af686413d


http://www.ebay.com/itm/5-Tube-Socket-DIN-5-Pin-Connector-Audio-signal-Female-Fits-Sherline-AT-Keyboard-/201039342046?pt=Vintage_Electronics_R2&hash=item2ecee0e9de
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Tue, 18 February 2014, 20:40:38
Does anybody know where to buy XT female sockets to use with this converter?

I found some on ebay. The XT use the DIN5 180 degree, same for AT. But the F122 use the 270 degree DIN5. I bought a DIN6 female for it and since it has the same layout but with an additional pin in the middle, it still works.

Can't say it's the best quality, but it works.

If you go back a few pages, I am pretty sure someone posted a link for a better quality female connector from mouser or something the likes, but the cost was much more.

And in fact, for my XT, for now I am not using the female at all. Instead (it should be temporary), I just plugged some female cable (the DuPont ones) directly where the cable is usually plugged and they go out from the cable hole and I plug them in my pro micro. Very artisanal and temporary, but it works for now!

BTW, I am typing this with my F122. It's so amazing! Thx Soarer again!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Wed, 19 February 2014, 09:50:51
Does anybody know where to buy XT female sockets to use with this converter?


Look at this (both 1$ free shipping):


for XT/AT DIN5 180°: http://www.ebay.ca/itm/DIN-Female-Jack-Cable-Connector-adapter-5-Pin-plug-panel-mount-solder-type-/280758416755?pt=US_Audio_Cable_Plugs_Jacks&hash=item415e817573&_uhb=1


for 270° DIN5 (F122): http://www.ebay.ca/itm/140624223277?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2648


I ordered the 270° one and use it with my F122 and it's doing a very ok job.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Wed, 19 February 2014, 19:40:14
http://www.ebay.com/itm/Arduino-Pro-Mini-w-Free-Headers-ATMEGA328P-16MHz-5V-ATMEGA328-Fast-USA-Ship-/161094027756?pt=LH_DefaultDomain_0&hash=item2581f3c9ec

Anybody tried pro mini? Has a built in reset button and is atmega328

Does anybody know where to buy XT female sockets to use with this converter?


Look at this (both 1$ free shipping):


for XT/AT DIN5 180°: http://www.ebay.ca/itm/DIN-Female-Jack-Cable-Connector-adapter-5-Pin-plug-panel-mount-solder-type-/280758416755?pt=US_Audio_Cable_Plugs_Jacks&hash=item415e817573&_uhb=1


for 270° DIN5 (F122): http://www.ebay.ca/itm/140624223277?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2648


I ordered the 270° one and use it with my F122 and it's doing a very ok job.

I'll grab one of those 180 degree pins
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Wed, 19 February 2014, 20:08:39
http://www.ebay.com/itm/Arduino-Pro-Mini-w-Free-Headers-ATMEGA328P-16MHz-5V-ATMEGA328-Fast-USA-Ship-/161094027756?pt=LH_DefaultDomain_0&hash=item2581f3c9ec

Anybody tried pro mini? Has a built in reset button and is atmega328

'328 is not supported, it doesn't have hardware USB like the '32U4.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Sun, 23 February 2014, 20:04:24
My thoughts of the day:

1. Soarer's converter is amazing and so easy to use.
2. I LOVE my F122. The layout is just perfect except that if I could find one without a numpad ... let me dream for this space unsaver!!!
3. I must admit, the XT layout is really painful. Really... so sad they are the most available of all F's.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JBert on Mon, 24 February 2014, 10:16:18
I keep thinking about it, but never seem to find a good time to do it. Unless I can find a way to remove certain info from the git repo, I won't be able to simply make my repo public. In all likelihood, I'll have to start a new repo without any history, which is a pain.
Actually, git has some destructive commands to change your history: Github: Remove sensitive data (https://help.github.com/articles/remove-sensitive-data). Just make sure you have enough backups of the original repo.

It mentions git-filter-branch or BFG repo-cleaner, but there's also Eric S. Raymond's reposurgeon tool (http://www.catb.org/esr/reposurgeon/) which allows you to splice out commits.

Again, keep in mind that this new repo will be radically different. I don't know how well branches or tags are preserved, as the commit hashes will be changed for any retouched commit and its descendants in the chain. Did I mention making backups?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 24 February 2014, 20:45:53
Last time I looked I found git-filter-branch, but not reposurgeon, thanks! It has a couple of comands I'd need, that I couldn't quite figure out how to do properly with git-filter-branch. An effectively fresh repo, with fresh hashes, isn't a problem as long as history, branches and tags are present and dated correctly.

No matter what though, it's a big and tedious task, even just to check that the alterations/removals have been made 100% correctly, and don't remain lurking somewhere. It might be simpler to just manually create a fresh repo and push (possibly modified) snapshots of 1.0, 1.01, ... 1.11, 1.12 into it, plus branches that haven't merged back in yet. The dates would be wrong, but it would be *something*!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Mon, 24 February 2014, 23:57:59
Last time I looked I found git-filter-branch, but not reposurgeon, thanks! It has a couple of comands I'd need, that I couldn't quite figure out how to do properly with git-filter-branch. An effectively fresh repo, with fresh hashes, isn't a problem as long as history, branches and tags are present and dated correctly.

No matter what though, it's a big and tedious task, even just to check that the alterations/removals have been made 100% correctly, and don't remain lurking somewhere. It might be simpler to just manually create a fresh repo and push (possibly modified) snapshots of 1.0, 1.01, ... 1.11, 1.12 into it, plus branches that haven't merged back in yet. The dates would be wrong, but it would be *something*!

It would be very nice of you!

Also, as far as I experienced yet, I need to maintain a function key down for the corresponding layer to be active. But is there an alternative option to do the likes: Press function key once = go to function layer until the same key is pressed again or until you press another function layer? My purpose is to do something in the likes: press capslock to go to function layer, use this layer (for me it's a nav layer) and once I am done I just press capslock again to go back to my original layer (the main one). Not an absolute necessity, but it could be nice I think (I have yet to try it lol).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JBert on Tue, 25 February 2014, 02:58:37
I implement such layer locks using SELECT, if you can live with the fact that the "layer lock" button is different from your Fn key.

Here's a small example (note that I didn't test this one):
Code: [Select]
# Regular keyboard map
ifselect any
remapblock
layer 0
CAPS_LOCK SELECT_1
        APP FN1
endblock

# Link fn keys to layer number.
layerblock
FN1 1
endblock

remapblock
layer 1
I UP
J LEFT
K DOWN
L RIGHT
endblock

# Locked layer starts here, override default selected layer 0.
ifselect 1
remapblock
layer 0
I UP
J LEFT
K DOWN
L RIGHT
endblock

I don't know how fast the controller switches between SELECTs so I wouldn't recommend holding Caps lock.

It might also be possible to trigger the layer lock using Fn + some key, but I'll let you experiment with those yourself.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: nuclearsandwich on Thu, 27 February 2014, 23:28:01
I keep thinking about it, but never seem to find a good time to do it. Unless I can find a way to remove certain info from the git repo, I won't be able to simply make my repo public. In all likelihood, I'll have to start a new repo without any history, which is a pain.

I can help with scrubbing the Git repo: https://help.github.com/articles/remove-sensitive-data


Edit: read more of the thread. If repodoctor doesn't do whatcha need and you want help with git-filter-branch you can always PM me.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: ARAMP1 on Mon, 03 March 2014, 02:10:41
It won't. Teensy 3.0 has a totally different CPU architecture for a start. But the real killer is that it runs at 3.3 volts, and can't interface directly to our 5 volt keyboards.
I'm guessing this goes from the 3.1 also.  Just read on the 3.1 vs the 3.0: 

"All digital pins are 5 volt tolerant on Teensy 3.1. However, the analog-only pins (A10-A14), AREF, Program and Reset are 3.3V only."
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 03 March 2014, 05:46:50
The 5V tolerant digital pins on the 3.1 could be used to interface with PS/2 etc, since the pin is only ever required to output 0V. Pull-up resistors to the 5V USB supply would be required.

I still don't have any plans to make a port though. Other projects of mine still require a proper 5V output (the Wyse converter, and the controller firmware when used in certain modes e.g. for 5291 conversion).
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Soarer on Mon, 03 March 2014, 05:52:38
I keep thinking about it, but never seem to find a good time to do it. Unless I can find a way to remove certain info from the git repo, I won't be able to simply make my repo public. In all likelihood, I'll have to start a new repo without any history, which is a pain.

I can help with scrubbing the Git repo: https://help.github.com/articles/remove-sensitive-data


Edit: read more of the thread. If repodoctor doesn't do whatcha need and you want help with git-filter-branch you can always PM me.

Thanks for the offer! Thing is, no matter how much help I get, I'm still going to want to understand and verify it, whcih takes time :)
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Wed, 12 March 2014, 18:26:00
I want to be absolutely sure when soldering my XT board so I don't fry the controller

The backside where I will be soldering wires from socket to teensy

[attachimg=1]

Are the markings on this correct for XT layout?

Thanks! Can't wait to finally use the XT
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Wed, 12 March 2014, 19:32:03
I want to be absolutely sure when soldering my XT board so I don't fry the controller

The backside where I will be soldering wires from socket to teensy

(Attachment Link)

Are the markings on this correct for XT layout?

Thanks! Can't wait to finally use the XT

soldered wires in this setup, got nothing. Are my wirings wrong and did I fry the board or does something else not work?
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Wed, 12 March 2014, 19:41:19
I have used this and it has worked. It looks like you did the right thing. Look elsewhere.

Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Wed, 12 March 2014, 20:09:38
I have used this and it has worked. It looks like you did the right thing. Look elsewhere.

Phew

Thanks for the help! I'll do some troubleshooting and see exactly what;s the problem
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Wed, 12 March 2014, 20:43:44
I have used this and it has worked. It looks like you did the right thing. Look elsewhere.

Phew

Thanks for the help! I'll do some troubleshooting and see exactly what;s the problem

I don't know for you, but when I first did it, since I was a TOTAL n00b, I didn't solder the pin header to the controller so it didn't work. If you get no signal, it's probably some connexion problem. Just need to find it!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: abzman on Mon, 17 March 2014, 00:58:07
Just completed this mod, I'm really happy with it.  Blog post http://abzman2k.wordpress.com/2014/03/17/ibm-model-m-122key/ (http://abzman2k.wordpress.com/2014/03/17/ibm-model-m-122key/) contains links to pictures and my config file. 
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: blackbox on Mon, 17 March 2014, 15:25:45
Just completed this mod, I'm really happy with it.  Blog post http://abzman2k.wordpress.com/2014/03/17/ibm-model-m-122key/ (http://abzman2k.wordpress.com/2014/03/17/ibm-model-m-122key/) contains links to pictures and my config file.

Interessting build. Nice project box!
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: abzman on Mon, 17 March 2014, 16:23:26
Yeah, as it turns out the n64's power supply is perfect for this task. 
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: Pacifist on Mon, 17 March 2014, 17:21:29
realized why my pro micro wasn't flashing correctly.......

the mini to micro converter I bought was just for charging....so there was no data or clock wire, just vcc and gnd. Accidentally broke the thing and found out that there were only two wires.....wtf
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: JPG on Mon, 17 March 2014, 19:45:26
realized why my pro micro wasn't flashing correctly.......

the mini to micro converter I bought was just for charging....so there was no data or clock wire, just vcc and gnd. Accidentally broke the thing and found out that there were only two wires.....wtf

If you need a micro usb cable, I got some for my converter, 10$ for a pack of 3 and they seem good quality to meé1

http://www.ebay.com/itm/6-FT-USB-Cable-2-0-MALE-A-to-Micro-B-5-PIN-Gold-Plated-USB-6-FT-White-Lot-of-3-/360662082010?pt=US_USB_Cables_Hubs_Adapters&hash=item53f922a1da
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: blackbox on Tue, 18 March 2014, 01:38:05
Yeah, as it turns out the n64's power supply is perfect for this task.

Who would have thought? Certainly not nintendo.
Title: Re: XT/AT/PS2/Terminal to USB Converter with NKRO
Post by: fohat.digs on Tue, 18 March 2014, 06:54:41