XT to PS/2 Converter for Model F

User avatar
ramnes
ПБТ НАВСЕГДА

15 Sep 2015, 21:12

Are you planning to release the source code?

Is the keyboard cable enough to flash the little thing?

If the answer to those two questions is no, then I would be interested in filling the text file; otherwise I'll figure out myself. ;)
Last edited by ramnes on 15 Sep 2015, 23:46, edited 1 time in total.

Engicoder

15 Sep 2015, 23:42

1) Yes, I will be putting the source code on Github with a BSD license.
2) No, an AVR ISP programmer is required to flash it. These are pretty easy to come by and don't cost much.
Last edited by Engicoder on 16 Sep 2015, 03:11, edited 1 time in total.

User avatar
ramnes
ПБТ НАВСЕГДА

15 Sep 2015, 23:50

Oops, I edited my message before seeing your reply. My last sentence didn't make sense but now it's your answer that doesn't because of my edit. :?

Anyway, now I'd be interested in that text file so you can flash it for me. :mrgreen:

Engicoder

16 Sep 2015, 04:09

No problem, a quick edit and mine agrees with yours now.

The XT2PS2 converter supports two keymaps with two layers each . One is the "STOCK" keymap that emulates the default PC/XT keyboard behavior. The second is the "USER" keymap which is configured using the xth_keymap_user.h file. By default the STOCK and USER keymaps are identical. Switching between the STOCK and USER keymaps is triggered by the magic combo
RSHIFT + LSHIFT + K
Note: these are the default XT keys, not mapped values.
The last selected keymap is stored in EEPROM so that when you power up it will remember which keymap that was in use when the keyboard was powered off.

Keymapping
Digging into the xth_keymap_user.h file, layer 0 is the first column of keycodes in the _xtUserScanCodeMap array and the layer 1 is the second column. The allowable keycodes are listed in the keycode.h file. The keycode KC_TOGGLE_LAYER will toggle between layers on release. The keycode KC_MOMENTARY_LAYER will momentarily change to layer 1 as long as the key is pressed and return to layer 0 when released.

As an example, if we wanted to map the Caps Lock to Right Control on layer 1, find the line for XT_CAPSLOCK and change the entry in the second column to KC_RCTRL:

Code: Select all

/* XT_CAPSLOCK    Caps Lock  */ {KC_CAPSLOCK,          KC_RCTRL,       },
If the */PrtSc key is to be used to toggle the keymap layers: (Note: The same layer switching key must be used in both layers or your on your own)

Code: Select all

/* XT_KP_ASTERISK Keypad *   */ {KC_TOGGLE_LAYER,      KC_TOGGLE_LAYER,   },
Key Combinations
The converter also supports MODIFIER + KEY key combination mappings. These are used in the STOCK keymap to emulate the default XT combos like SHIFT+* for PRTSC and CTRL + SCROLL_LOCK for BREAK.

These are configured in the _xtUserKeyCombinations array and take the form { REQUIRED MODIFIERS, KEY, MAPPEDTO }. For example the stock PRTSC mapping is entered as:

Code: Select all

{MODS_LSHIFT, KC_KP_ASTERISK, KC_PRINT_SCREEN},
MODS can be combined for example to map H to Z when LCTRL and LALT are pressed:

Code: Select all

{(MODS_LCTRL | MODS_LALT), H, Z},
Note: The modifier keys are not supressed when the mapped to key is sent, for the above combo when LCTRL + LALT + H, is pressed the computer will see LCTRL + LALT + Z.

Have fun :twisted:

Just kidding! Feel free to ask any questions.
Attachments
xtsps2_keymap.zip
(3.34 KiB) Downloaded 245 times

User avatar
Cheesebaron

25 Sep 2015, 16:27

Cheesebaron wrote: Do you have any more of these? I just received a XT board that I could use this for.
Let me ask again, any more of these that you want to sell?

Engicoder

25 Sep 2015, 17:37

Cheesebaron wrote:
Cheesebaron wrote: Do you have any more of these? I just received a XT board that I could use this for.
Let me ask again, any more of these that you want to sell?
Sorry, I missed your first post. PM sent.

andrewjoy

25 Sep 2015, 20:48

would it add much to the price if you socketed the IC ? Its no big problem i can just suck it out and put a socket in.

Proper ones , none of that dual wiper rubbish.
http://www.digikey.com/product-detail/e ... -ND/821765

User avatar
ramnes
ПБТ НАВСЕГДА

25 Sep 2015, 22:48

Thanks for the tutorial Engicoder!

What is the constant for Super_L? I can't find it in keycode.h. :(

Also, if I press KC_MOMENTARY_LAYER while being on the layer 1, what's happening?

And would that be possible to have a third layer? I'd love to have layer 0 being the normal layer, layer 1 my custom layer and layer 2 my Fn layer. 8-)

Engicoder

26 Sep 2015, 00:01

andrewjoy wrote: would it add much to the price if you socketed the IC ? Its no big problem i can just suck it out and put a socket in.

Proper ones , none of that dual wiper rubbish.
http://www.digikey.com/product-detail/e ... -ND/821765

The cost of the part, of course ;-) I can get the part and install it, or you can and I'll send it with the chip unsoldered.

Engicoder

26 Sep 2015, 00:10

ramnes wrote: Thanks for the tutorial Engicoder!

What is the constant for Super_L? I can't find it in keycode.h. :(

Also, if I press KC_MOMENTARY_LAYER while being on the layer 1, what's happening?

And would that be possible to have a third layer? I'd love to have layer 0 being the normal layer, layer 1 my custom layer and layer 2 my Fn layer. 8-)
Super_L is LGUI. The codes are borrowed from the USB codes. They use LGUI for the Windows, Command, and Super keys.

If you press momentary while on layer 1, you go to layer 0. On release you will return to layer 1. I think my wording is misleading there.

3rd layer....yes, it can be done, but it would require some more advance layer switching.

For clarity, there are 2 complete keymaps, STOCK and USER. Each has 2 layers. So there are actually 4 layers, but only two are intended to be user configurable. In truth all four can be configured by changing the code.

andrewjoy

26 Sep 2015, 00:39

Engicoder wrote:
andrewjoy wrote: would it add much to the price if you socketed the IC ? Its no big problem i can just suck it out and put a socket in.

Proper ones , none of that dual wiper rubbish.
http://www.digikey.com/product-detail/e ... -ND/821765

The cost of the part, of course ;-) I can get the part and install it, or you can and I'll send it with the chip unsoldered.
Just send it default , I have a proper desolder station , I will when I get the time get a socket and solder it in.

User avatar
ramnes
ПБТ НАВСЕГДА

26 Sep 2015, 01:09

Engicoder wrote: Super_L is LGUI. The codes are borrowed from the USB codes. They use LGUI for the Windows, Command, and Super keys.
Ah yeah, forgot about Super not being the standard name. Professional deformation I guess. :mrgreen:
Engicoder wrote: If you press momentary while on layer 1, you go to layer 0. On release you will return to layer 1. I think my wording is misleading there. .
That's awesome, exactly what I wanted.

Bucake

29 Sep 2015, 11:18

hello hello,
do you have any more converters for sale..?

orihalcon (ebay seller) showed me this thread when i asked him about XT to PS/2 :)

soviet9922

19 Sep 2017, 20:04

I'm in the same wagon need one for my portable :D are the adapters still available ?.
Or a schematic and the source code could be nice i could build it myself also ?.
Thanks!

User avatar
JP!

19 Sep 2017, 21:00

Whoa, this is neat. I haven't seen this one before.

User avatar
Clavius
IBM aficionado

28 Sep 2017, 22:47

Wow! This is exactly what I've been looking for. Do you still have one, or could you share the diagram and code so I could build one?

Anakey

13 Feb 2018, 14:00

Sent an e-mail and PM to the OP but no reply yet. seems that there is still interest in the converter to AT but we would need at least a schematic and component codes to be able to make one ourselves which I am hoping the OP is able to provide.

soviet9922

13 Apr 2018, 20:43

PM the OP several times but he never replied :'(

cruster

21 Apr 2018, 17:36

Hi Engicoder, I have a couple of lovely old IBM XT keyboards. Would your encoder work with these and are you selling them still? (I realise the thread is from 2015 - but if you don't ask - you never know) All the best, Chris

User avatar
Mr.Nobody

07 May 2018, 07:30

Nice, why not add another chip and make it an XT to USB adapter? TBH, I'm expecting an At to Bluetooth adapter.

User avatar
ibmapc

12 May 2018, 00:23

I am also very interested in one of these for my 5155. Anyone know where the schematic can be found or gerber file or a board that I can copy? It seems the OP is no longer responding to this thread but there is still interest from at least a few of us.

@soviet9922; I recognize your username from VCFED Vintage Computer Forums. Have you received any info about this converter?

User avatar
ibmapc

16 May 2018, 04:51

Anyone Want to help me here? I'm going to attempt to wire this together on a small breadboard. At least tell me the value of the resistors. I think I can see 99 percent of the traces on those great pictures from the first post. So, I should be able to figure out the wiring from that, but I'm having trouble seeing the colors on the bands of the resistors on the left side. I think the one lone resistor near the top edge is 10K? What are the other 2?

Greg

User avatar
hasu

16 May 2018, 05:42

ibmapc wrote: Anyone Want to help me here? I'm going to attempt to wire this together on a small breadboard. At least tell me the value of the resistors. I think I can see 99 percent of the traces on those great pictures from the first post. So, I should be able to figure out the wiring from that, but I'm having trouble seeing the colors on the bands of the resistors on the left side. I think the one lone resistor near the top edge is 10K? What are the other 2?

Greg
It seems those resistors are connected to LEDs so it depends on what ones you are using and its value doesn't matter anyway.

Did you find firmware for this converter somewhere?

Engicoder

16 May 2018, 05:57

Here is the simplified schematic for the converter (no status leds)
xt2ps2_schematic.jpg
xt2ps2_schematic.jpg (81.56 KiB) Viewed 6924 times
I need to build the firmware and test it again to be sure the version I have is valid. I will do that tomorrow and then post it here.
Last edited by Engicoder on 16 May 2018, 06:08, edited 1 time in total.

User avatar
ibmapc

16 May 2018, 06:04

hasu wrote: Did you find firmware for this converter somewhere?
Yup, Firmware here https://github.com/engicoder/XT2PS2

EDIT;
It seems the firmware file is not there? Is this just an empty repository? I could have sworn it was there before. Anyhow, looks like Engicoder provided the file in a later post here. keyboards-f2/xt-to-ps-2-converter-for-m ... ml#p413193
Last edited by ibmapc on 19 May 2018, 18:43, edited 1 time in total.

User avatar
ibmapc

16 May 2018, 06:20

Thank You Engicoder for that Schematic. That should make it really easy to wire up on a breadboard. Will one of these work for programming the Attiny85? https://www.sparkfun.com/products/11801

Engicoder

16 May 2018, 06:21

Yes, that should be fine.

Engicoder

16 May 2018, 16:02

Here are the hex and eep files for the converter. These use the a basic mapping where all the keys map directly as the legend indicates. It does include 4 key combinations for extended keycodes:
  • LShift + PrtSc/Asterisk => PrtSc
  • LAlt + PrtSc/Asterisk => SysReq
  • LCtrl + NumLock => Pause
  • LCtrl + ScrollLock => Break
This firmware is for the ATTiny85. The firmware uses the internal 8Mhz RC clock source so any ATTiny85 variant can be used.
Note: You need to unprogram the CKDIV8 fuse which is programmed by default. AVR fuses can be a bit confusing. In this case a value of 0 means its programmed and 1 means its unprogrammed.
Attachments
xt2ps2-firmware-0.1.zip
(7.9 KiB) Downloaded 200 times
Last edited by Engicoder on 12 Mar 2020, 14:45, edited 2 times in total.

soviet9922

16 May 2018, 19:04

Great! thanks Engicoder :D

User avatar
ibmapc

17 May 2018, 09:00

@Engicoder, Are you using the 10 mhz or 20 mhz ATttiny85? Does it matter?

Post Reply

Return to “Keyboards”