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

User avatar
Trent

10 Aug 2012, 02:45

Do you know what the colors would be for the silver tag XT/AT style adapters? I have a few of these and the RJ-45 one was the one that I wanted to try first since it was the only one that didn't have a cut cord. I don't see colors listed on the keyboard babel site sadly.

User avatar
Soarer

10 Aug 2012, 04:04

I think they vary... at least, the PC/XT colours are different to the 122-key's.

Let me know exactly which keyboards and I'll check my 'boards to see. Pics of the cable inside the keyboard would help to verify that yours matches mine!

Here's a couple of pics I had handy :D

Inside a PC/XT keyboard...
XT_internal.jpg
XT_internal.jpg (237.53 KiB) Viewed 17212 times
Label inside a 122-key Model F...
IBM_122F_CableConnectionsLabel.jpg
IBM_122F_CableConnectionsLabel.jpg (155.16 KiB) Viewed 17212 times

JBert

10 Aug 2012, 09:03

Trent wrote:So the order would be:
1. Flash teensy
2. scas example.sc example.scb
2. scwr example.scb
3. scboot
4. hit button on teensy
5. see if QWERTY keys work?
Trent wrote:*Hit teensy button*

*Try a couple different standard letter keys, no response*
Noooooo!

1. Press button on Teensy
2. Flash Teensy
3. scas ...
4. scwr
5. Unplug / plug Teensy just to be sure
6. Test keyboard

The Teensy's button will only make the controller unusable because it's in "bootloader" aka "programming mode". scboot should do pretty much the same, according to the docs:

Code: Select all

Usage:
    scboot

After running this command, the converter should be ready to have new firmware loaded into it. Note that, at this point, the converter will not be working as a keyboard any more! To cancel the bootloader mode, simply disconnect the converter from the computer and reconnect it.
Now get that wiring sorted out and just don't press the Teensy's button, mkay?

User avatar
Trent

11 Aug 2012, 05:13

Hmm, seems that this board is indeed dead after following your instructions jBert. I'm gonna have to pull out some of the other terminal boards I have and try wiring them up instead. Will post updates when I have completed that task.

User avatar
AKIMbO

31 Aug 2012, 16:14

I need some serious help with programming this teensy. If someone could give me the explain it to me like I'm 5 years old I would be forever grateful. Below are the steps I'm taking:

Write the cfg file (in my example I just want to switch the esc key with the F1 key). So my cfg file looks like this:

Code: Select all

# F XT

remapblock
    F1        ESC
    ESC       F1
endblock

I save this cfg file in a folder called tools. The following are also in the tools folder: scas, scboot, scdis, scinfo, scrd, scwr, rawhid.dll.

Step 1: I run scboot to boot the Teensy into programming mode.
Step 2: I click on scas (I think I may be messing this step up...do I just click on scas and let it do its thing or do I have to rename the file, etc.?)
Step 3: I run scwr (I just click on scwr and let it do its thing or do I have to rename the file,etc? When I click scwr and scas respectively nothing happens except a black box pops up on the screen for a split second and then disappears.)
Step 4: I click the "program" button in the teensy application
Step 5: reboot the teensy

I would really like to be able to reprogram my F XT in order to switch some keys around and have been trying on and off unsuccessfully for the past few days. If there is some major step I am missing could someone please let me know. I really do need the explain it to me like I'm 5 treatment here. Thanks in advance.

On a side note, I should mention that the teensy does work and I am able to use the F XT to type...it's just that I cannot figure out how to reprogram key locations on the teensy.

User avatar
Soarer

31 Aug 2012, 17:24

Nothing but a couple of misunderstandings here :D

First, you don't want to be in programming mode to load configs; scboot's only use is to allow you load a new .hex file.

Second, the tools are meant to be run from a command line - especially scas, scwr and scrd, which take parameters. But all of them really, since otherwise the window closes before you can read the output!

Precise instructions vary depending on your OS... but in summary for any OS:
1. Open a command prompt.
2. Change directory to the tools folder (it's easiest to save your config files in the same folder as the tools).
3. Run tools by typing commands, adding appropriate parameters.

For Windows XP, assuming that the tools and your config are in 'C:\sctools', and that your config is called 'akimbo.sc':
1. Start - Programs - Accessories - Command Prompt

2. Type two commands at the command prompt to change directory...

Code: Select all

C:
cd \sctools
OR maybe your tools folder is "D:\downloads\soarer converter\tools", then:

Code: Select all

D:
cd "\downloads\soarer converter\tools"
(The quotes are required if the path has any spaces in it).

3. Type two more commands to compile and load your config...

Code: Select all

scas akimbo.sc akimbo.scb
scwr akimbo.scb
Of course, if scas reports any errors you will need to fix them, and re-run scas, before running scwr!

User avatar
AKIMbO

31 Aug 2012, 19:02

It worked! Thank you so much Soarer! Is there an easy way to completely go back to default (ie. rewrite the soarer converter so that all the changes I just programmed onto the converter are overwritten so F1 becomes F1 again and esc becomes esc again?)

User avatar
Soarer

31 Aug 2012, 22:25

Sure, just compile an empty text file! Or, in a Windows command prompt, you can simply type:

Code: Select all

scas nul empty.scb
scwr empty.scb
Alternatively, you could just use legacy.sc as the default, since it has correct macros for the XT's and AT's PrtSc etc.

User avatar
Soarer

07 Sep 2012, 21:38

I see some people have noticed the v1.03 release... it's far from an essential update, but it's good for it to be used in case I've broken anything :D

Also, I just added this to the OP...
Soarer wrote: 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.
This was on the converter's GH page at some point, but must've got lost in a rollback :(
And somehow, I forgot to highlight legacy.sc in the docs or here!!

User avatar
fruktstund

23 Sep 2012, 11:58

Soarer, I'm back with a new exciting question: is it possible to use other pins on the Teensy for the data and clock? I think that might help me solve my problem. Maybe.

The LEDs of the keyboards I'm trying all light up for about a quarter of a second when I plug the converter in, so everything seems kind of okay. Only kind of though. The keyboard also does get connected, but something seems a bit wrong. This is the output I'm getting from hid_listen:
wEE remaining: FFFC

Keyboard ID: 0000
Code Set: 1
And no keypresses get registered. Is this bad? :)

(Yes, this is the Teensy++ I said I may have broken, but I just can't give up. :roll: )

User avatar
Soarer

23 Sep 2012, 14:41

Hmm, well I don't really want to start producing and testing a modified version, but it would be possible :lol:

First though, I've come up with a basic test of the teensy pins.
Run hid_listen and plug the converter in with no keyboard connected. Then...
Test 1 - short the clock pin to ground briefly a few times. This should produce R05 and R04 error codes.
Test 2 - connect the data pin to ground, and then short the clock pin to ground briefly a few times (i.e. keep data grounded while doing that). This should produce R05 and R06 error codes.

Unfortunately I can't think of a simple test to tell if the Teensy pins can still output correctly. You could try loading a config that uses the 'force' command to see if that gets it working. (Apart from auto-detecting, output to the keyboard is only used for error recovery and setting LEDs, so it might still mostly work).

What keyboard are you using, is it still the old BTC? What type is it (XT, AT...)?

User avatar
fruktstund

23 Sep 2012, 16:26

Tried your shorting test, and both output the error codes as expected (except that one of them produced all R04, R05 and R06. I think it was ground to clock).

Tried with my old BTC and an old NTC keyboard I found lying around (both XT). Tried forcing all sets on all of them, but still no results. The only thing that happened was that I got some strange codes directly after plugging the keyboards in.
Actually, when I press the lock keys on the NTC board the corresponding LED lights up as it should, but this does not happen on the BTC board.

I checked my wiring two more times, and it's still correct. :) I also tried the shorting test directly in the DIN connector to check that this wasn't the problem, and all error codes were the same as earlier.

I feel this is a bit crazy. :D

User avatar
dirge

23 Sep 2012, 17:18

Soarer wrote:
XT_internal.jpg
Got mine working but trying to make a USB cable out the original cable.

Looking towards the end of the USB and Micro USB ends with the copper traces facing up. I've got the same colour cables and they are in the order Red, Black, White, Brown.

Using normal USB cable everythings fine. Using my botched one the teensy gets very hot very quick!

User avatar
Soarer

23 Sep 2012, 17:20

fruktstund wrote:I feel this is a bit crazy. :D
So they are both XTs, but they have LEDs?

Sorry, for some reason I thought you were trying a keyboard that wasn't an XT. For XTs, trying the force command doesn't make sense, since XT mode what the converter will default to anyway if it fails to communicate with the keyboard (XT protocol is one-way only, so it doesn't accept commands).

Dunno about crazy, but it's certainly strange! Since the tests seem to say that the inputs are OK, and the keyboards are XT, it's even more puzzling! Are you still getting the R04 and R05 errors when you press keys, that you were originally?

Another thought - did you change the firmware when you rebuilt it? Maybe I broke something!

User avatar
Soarer

23 Sep 2012, 17:26

dirge wrote:Using normal USB cable everythings fine. Using my botched one the teensy gets very hot very quick!
On your head be it!

Have a camera handy for when the magic smoke gets out :evilgeek:

User avatar
dirge

23 Sep 2012, 17:36

well typing on it now so no great damage ;)

But would love to know the correct usb pinning for a standard usb to micro cable. Want to reuse the original. Also my layouts not perfect, but as your files iso uk I'll ignore what's on the caps :)

User avatar
Soarer

23 Sep 2012, 20:14

My files are symbol agnostic, as are scan codes and HID codes ;) Any discrepancy between your keycaps and your OS's layout setting is not my problem! :lol:

Teensy has a mini USB socket... wiring. But I should say, even if you get that right I'm not sure how well it will work, because the data wires are intended to be a twisted pair, and they (presumably) won't be in the IBM cable.

User avatar
Grond

25 Sep 2012, 12:16

Anyone tested this with Teensy 3.0?

JBert

25 Sep 2012, 12:43

It's a totally different processor and thus the .hex file will not work.

User avatar
dirge

25 Sep 2012, 13:16

Soarer wrote: Teensy has a mini USB socket... wiring.
Well that would explain it, who's idea was it to have the end inverted on the mini socket?! So I've had the ground and 5v the swapped and the other two the wrong way around...

Image

User avatar
dirge

25 Sep 2012, 14:12

right
I`ve used the included tools and compiled the dvorak bin. I like the fact £ is above 3, but need another keyboard plugged in as i have no \ key! it shows up as #. could someone help please?

taken ten mins to write this! i feel pretty weird! but will stick with it!

User avatar
Soarer

25 Sep 2012, 16:19

Damn UK vs US layout problem! 'Backslash' is a # on a UK layout... think of the difference around Enter on a 102-key vs a 101-key... the backslash key above enter is replaced by a hash key left of enter, and they use the same scan code!

So, to fix you up, you could try adding...

Code: Select all

    BACKSLASH EUROPE_2
but then # needs to be put somewhere. Hmm. It might be easiest just to tell your OS that it has a US keyboard, for now, but it would certainly be possible to add a macro to put # on shift-3 to match the legend (while still having UK layout set in the OS), if that's how you wanted it.

User avatar
dirge

25 Sep 2012, 16:30

Changing to US would be bad, I`m logged into UK servers most the time. "`¬" is an option as that's normally where it is anyway. Sorry for being slow on this. My typing is much slower than even me at the moment.

edit! that worked your a star!

now the hash swap is confusing me

I tried using GRAVE HASH and it's erroring :(

# dvorak layout - contributed by Morning Song

remapblock
MINUS LEFT_BRACE
EQUAL RIGHT_BRACE
Q QUOTE
W COMMA
E PERIOD
R P
T Y
Y F
U G
I C
O R
P L
LEFT_BRACE SLASH
RIGHT_BRACE EQUAL
# A A
S O
D E
F U
G I
H D
J H
K T
L N
SEMICOLON S
QUOTE MINUS
GRAVE HASH
BACKSLASH EUROPE_2
Z SEMICOLON
X Q
C J
V K
B X
N B
# M M
COMMA W
PERIOD V
SLASH Z
endblock

User avatar
Soarer

25 Sep 2012, 16:48

That's because GRAVE and HASH aren't keys :lol: All the key names are US-centric, so we just have to live with them not saying the right thing sometimes. Check the 'codes' list in the docs, I've tried to add comments where needed.

Try...
BACK_QUOTE BACKSLASH

User avatar
dirge

25 Sep 2012, 16:55

Your awesome! I'm going to post some pics now! :)

Mikester

02 Oct 2012, 17:11

hi guys,

i just modified my IBM 3487 terminal keyboard with a teensy-board with soarers firmware 8-)

Works like a charm!!

I had to relocate the original board a bit inside the casing to make place for the mini-usb extension.

Big thanks to soarer!

Mike
Attachments
IMAG0370 (Medium).jpg
IMAG0370 (Medium).jpg (96.8 KiB) Viewed 16702 times
IMAG0369 (Medium).jpg
IMAG0369 (Medium).jpg (138.46 KiB) Viewed 16702 times
IMAG0090_BURST001 (Medium).jpg
IMAG0090_BURST001 (Medium).jpg (115.68 KiB) Viewed 16702 times
IMAG0371 (Medium).jpg
IMAG0371 (Medium).jpg (148.81 KiB) Viewed 16702 times
IMAG0089_BURST001 (Medium).jpg
IMAG0089_BURST001 (Medium).jpg (107.74 KiB) Viewed 16702 times

User avatar
Soarer

03 Oct 2012, 19:36

Very nice! That USB extension fits tidily between the existing posts, I see!

Strictly speaking, you should ground the metal plate, but it's not anything like as vital on an M as it is on an F :)

User avatar
Soarer

03 Oct 2012, 19:38

Anyone that thinks they might've applied power in reverse - see here for a test and fix of Paranoid's XT.

User avatar
sealclubber

04 Oct 2012, 17:48

Hey Soarer.

Just wanted to thank you for your awesome work. I finally got my baby to work on my new computers. :D

Just a few questions about key remapping. How would I match up the codes for scan set 3 (http://www.seasip.info/VintagePC/ibm_1390876.html) to your codes listed in the 'codes' section in the download?

I'm trying to find out what I must enter to program the keys that normally correspond to Insert, Delete, Home, etc... and the four keys above the keypad.

Additionally, in a config file that I'm writing up (ok...TRYING to write up...) I am curious as to if I can simply list two keys when remapping something to have it correspond to when I press the shift key. Below is the config file I'm going to use, hopefully it works... probably not... I don't even know if I mapped the extra keys on the left side correctly.

Code: Select all

# sealconf garbage
ifset set3
remapblock
	EXTRA_F1	ESC
	EXTRA_F2	MEDIA_MY_COMPUTER
	EXTRA_F3	MEDIA_WWW_HOME
	EXTRA_F4	MEDIA_CALCULATOR
	EXTRA_F5	MEDIA_MAIL
	EXTRA_F6	PRINTSCREEN
	EXTRA_F7	MEDIA_VOLUME_DOWN
	EXTRA_F8	MEDIA_VOLUME_UP
	EXTRA_F9	MEDIA_PLAY_PAUSE
	UP		UP PAGE_UP
	DOWN		DOWN PAGE_DOWN
	INSERT		COPY PASTE
	DELETE		DELETE UNDO
endblock
	

User avatar
Soarer

04 Oct 2012, 18:55

sealclubber wrote:Hey Soarer.

Just wanted to thank you for your awesome work. I finally got my baby to work on my new computers. :D

Just a few questions about key remapping. How would I match up the codes for scan set 3 (http://www.seasip.info/VintagePC/ibm_1390876.html) to your codes listed in the 'codes' section in the download?
Ha! You don't! There's an initial translation from each scan code set into HID codes, that you can't modify. What you're changing with remapping is from one HID code to another.
sealclubber wrote: I'm trying to find out what I must enter to program the keys that normally correspond to Insert, Delete, Home, etc... and the four keys above the keypad.
Run hid_listen, press the key you want to remap, see what code comes up - the one you want starts with '+' - then find it in the codes table.
sealclubber wrote: Additionally, in a config file that I'm writing up (ok...TRYING to write up...) I am curious as to if I can simply list two keys when remapping something to have it correspond to when I press the shift key. Below is the config file I'm going to use, hopefully it works... probably not... I don't even know if I mapped the extra keys on the left side correctly.

Code: Select all

# sealconf garbage
ifset set3
remapblock
	EXTRA_F1	ESC
	EXTRA_F2	MEDIA_MY_COMPUTER
	EXTRA_F3	MEDIA_WWW_HOME
	EXTRA_F4	MEDIA_CALCULATOR
	EXTRA_F5	MEDIA_MAIL
	EXTRA_F6	PRINTSCREEN
	EXTRA_F7	MEDIA_VOLUME_DOWN
	EXTRA_F8	MEDIA_VOLUME_UP
	EXTRA_F9	MEDIA_PLAY_PAUSE
	UP		UP PAGE_UP
	DOWN		DOWN PAGE_DOWN
	INSERT		COPY PASTE
	DELETE		DELETE UNDO
endblock
	
The extra F-keys part looks fine.

scas ought to give an error when there are too many items on a line, but it doesn't because of lazy coding :oops:

Changing the function of a shifted key isn't part of remapping. Ordinarily, mapping of that kind is defined by the keyboard layout in the OS, and the keyboard just tells the OS which keys are down.

But, we have macros! So you can set one to trigger on shift+up which would send a sequence that releases shift, presses pgup, then returns shift to its original state...

Code: Select all

macroblock
 macro UP SHIFT
  PUSH_META CLEAR_META SHIFT
  KEY_PRESS PGUP
  POP_META
 endmacro
endblock
That wouldn't suit me much, because I use shift+up etc. a lot for selecting text!

Another gotcha is that there are codes defined in HID that aren't generally understood by the OS... COPY, PASTE and UNDO being some of them. Again, macros can be used to provide these functions. These examples assume Windows style ctrl-C for Copy etc. (and are untested)...

Code: Select all

macroblock
 macro INSERT SHIFT
  PUSH_META ASSIGN_META LCTRL
  KEY_PRESS V
  POP_META
 endmacro

 macro INSERT
  PUSH_META ASSIGN_META LCTRL
  KEY_PRESS C
  POP_META
 endmacro

 macro DELETE SHIFT
  PUSH_META ASSIGN_META LCTRL
  KEY_PRESS Z
  POP_META
 endmacro
endblock
Note that the more specific INSERT macro (using shift) has to come first, otherwise the converter will find a match on the one without shift first and stop looking.
Last edited by Soarer on 05 Oct 2012, 18:52, edited 2 times in total.

Post Reply

Return to “Workshop”