XT to PS/2 Converter for Model F

User avatar
ibmapc

29 May 2018, 22:38

Here's my version of Engicoder's XT2PS2 Keyboard Converter built on a perfboard and attached to my IBM 5155 that's been upgraded with a 286 motherboard. Works GREAT!
Notice that the board needs to be tucked under the keyboard pc board due to the 5155's keyboard enclosure.
Thank you Engicoder for the design and firmware!

Bottom of xt2ps2/wires.
Bottom of xt2ps2/wires.
Bottom of xt2ps2/wires.
IMGA0054.jpg (1.06 MiB) Viewed 1012 times
Top of xt2ps2.
Top of xt2ps2.
Top of xt2ps2.
IMGA0055.jpg (877.04 KiB) Viewed 1012 times
Top side of keyboard with xt2ps2 connected.
(turned out to show off xt2ps2 and connectors.)
Top side of keyboard with xt2ps2 connected.<br />(turned out to show off xt2ps2 and connectors.)
Top side of keyboard with xt2ps2 connected.
(turned out to show off xt2ps2 and connectors.)
IMGA0056.jpg (1.02 MiB) Viewed 1012 times
Under side of keyboard with xt2ps2 attached.
Under side of keyboard with xt2ps2 attached.
Under side of keyboard with xt2ps2 attached.
IMGA0056a.jpg (927.08 KiB) Viewed 1012 times
Part way into the enclosure.
Part way into the enclosure.
Part way into the enclosure.
IMGA0057.jpg (844.79 KiB) Viewed 1012 times
The keyboard in place.
The keyboard in place.
The keyboard in place.
IMGA0058.jpg (922.32 KiB) Viewed 1012 times
All closed up.
All closed up.
All closed up.
IMGA0059.jpg (1.12 MiB) Viewed 1012 times
Last edited by ibmapc on 09 Apr 2020, 03:36, edited 2 times in total.

User avatar
ibmapc

02 Jun 2018, 19:55

Here's rev 2.0 of my version of Engicoder's XT2PS2 Keyboard Converter built on a breadboard. I must admit the first version was rushed a bit. I just looked at the schematic, placed some parts on the board and started connecting wires. It wasn't 'till near the end that I figured out that I had misread the schematic and the attiny was placed backwards so in the new version I laid it out on paper before proceeding and was able to make it much tidier. There are no crossed wires. Can you find the decoupling cap? Please ignore the flux left behind. I used rosin core solder so it shouldn't hurt anything. It can be a little tough to remove though and I don't want to knock any wires out of wack scrubbing with a toothbrush and isopropanol.
IMGA0068.jpg
IMGA0068.jpg (1.14 MiB) Viewed 924 times
IMGA0064.jpg
IMGA0064.jpg (1.05 MiB) Viewed 924 times

Octal

06 Jul 2019, 19:22

Sorry for necro posting. Has there been any updates to this project since this thread? I'm trying to build my own; does any one photos of this adapter on a bread board, I'm not that great at reading circuit diagrams.

Sonic08

03 Jul 2020, 09:46

Hi!
I have an old IBM PC 5150 computer and an old XT mechanical keyboard (not a Model F, but another mechanical one running in XT mode). Everything works perfectly together.
I built a Converter from this theme on a layout board and tried connecting the XT keyboard to a modern computer. But the Converter doesn't work properly. If clicking most of the buttons, nothing happens. When pressing some of the buttons, the symbols appear on the screen, but not those which are written on the buttons. For example, I press the "Q" button – the “F” is printed on the screen. That's why I'm asking for help here.
I downloaded the firmware for ATTiny85 from the message Engicoder.
viewtopic.php?p=413193#p413193
Next, I attach screenshots of the programmer.

Image
FLASH

Image
EEPROM

Image
FUSE.Bits

Next, screenshots of the oscilloscope when connecting to the Converter.
Yellow line - Clock, blue line - Data.

Image
XT Keyboard pressed “B”

Image
XT Keyboard pressed “K”

Image
At the output of the Converter AT Keyboard pressed “B”

Image
At the output of the Converter AT Keyboard pressed “K”

You can see that the correct signals come from the XT keyboard, but when exchanging with the Converter and AT the motherboard – I get complete nonsense.
I tried: two different ATTiny85-20PU chips, three different AT computers, install and remove "CKDIV8 fuse".
I don't have another XT keyboard, but I connected an AT-to-XT Converter to this Converter – it didn't have a positive result either.
Also, when connecting the Converter to the 286 and 386 motherboard, even without the XT keyboard connected, the keyboard error is shown on the screen.
I have an assumption that it's something with the firmware or I'm not programming ATTiny85 in the right way.
Any ideas? :?: :idea:

User avatar
hasu

03 Jul 2020, 12:05

Can you share model number of your "old XT mechanical keyboard"?

That XT waveforms seem to be ok and clock is a bit faster than genuine IBM XT keyboard, but it won't be problem.

I think the waveform of "At the output of the Converter" shows 'AA' from converter(emulating AT keyobard), 'ED' command from PC and 'FA' from converter(emulating AT keyboard). In those waveforms the converter didn't send any scan code.
And signal from the converter doesn't swing fully down to ground for some reason. You may need check connection between converter and motherboard?

User avatar
ibmapc

03 Jul 2020, 12:26

The file here is what I downloaded from my Attiny85
test.zip
(6.17 KiB) Downloaded 5 times

Sonic08

03 Jul 2020, 15:11

I thank all those who responded.
I checked the connection between the motherboard and the Converter and found that there was poor ground contact. I additionally soldered all the connections.
Now the output signal is as follows:

Image
At the output of the Converter AT Keyboard pressed “K”

Image
At the output of the Converter AT Keyboard pressed “B”
When the "B" key is pressed, there is no signal at all at the output, although there is one at the input.

I also tried the firmware version from ibmapc. The firmware completely repeats the Engicoder downloaded here earlier, only without the xt2ps2-0.1.eep file.
Now the signal is better, but still the Converter does not work completely. When you click on some of the buttons, nothing happens, and clicking on other the other buttons – the screen prints incorrect characters, as I wrote earlier.

The keyboard model is as follows:

Image

Image

At the back there is an AT/XT switch, the keyboard is enabled in XT mode

User avatar
ibmapc

03 Jul 2020, 17:48

Wait a minuet. Why do you need the converter? With that switch in AT mode, that keyboard should be compatible with AT or PS2 style motherboards. I'm just a little confused.

Sonic08

03 Jul 2020, 18:12

Why do you need the converter?
I temporarily use a keyboard with the AT/XT switch for tests, because I bought an original Model F XT keyboard on eBay. In the future, I will use Model F with this Converter, but for now the keyboard is in delivery.

User avatar
ibmapc

03 Jul 2020, 18:50

Sonic08 wrote:
03 Jul 2020, 18:12
Why do you need the converter?
I temporarily use a keyboard with the AT/XT switch for tests, because I bought an original Model F XT keyboard on eBay. In the future, I will use Model F with this Converter, but for now the keyboard is in delivery.
OK. Now I get it. I think there might be a timing issue with the non IBM keyboard causing your malfunction. I've seen issues with certain motherboards that throw an error during post when using the converter. It seems like 286 boards are the most problematic. I had to set the cmos options to ignore keyboard errors during post. With faster motherboards, such as my Super Socket 7 board with an AMD K6III+ 450, it boots and works flawlessly. I've attributed this behavior to timing issues with the converter, but this stuff is really above my pay grade. I'm just a tinkerer, not an engineer or even a technician. I'm just a hobbyist who likes to play with other peoples designs to enhance and/or hot rod my vintage gear!

I wonder if you'll see better results when your Model F comes in.

I have been trying to find my stash of spare ATTINY85's with no joy, so I ordered three of them from Digi-Key so that I can experiment without corrupting the working one I currently have.

User avatar
hasu

04 Jul 2020, 02:15

AT waveform itself looks ok now.
But the AT signal for 'K' is actually '6B'(Keypad 4), I think you got '4' or Left(depending on NumLock
state) on computer press 'K' on the XT keyboard.

This indicates the converter misread XT signal for 'K', to be exact, it fails to read data on the first clock falling edge. I believe the XT signal is legitimate for XT protocol but its clock timing is a bit fast for the converter.

XT 'K' 0x25 signal:
Image

This shoud be read as 01 1010 0100, but I think the converter reads as 11 1010 0100 and misinterprets as '4B'(Keypad 4 in XT). The first two bits means a kind of 'start bit' for XT and rest is scan code(LSB first). See this for the detail of it. https://github.com/tmk/tmk_keyboard/wik ... l#protocol


EDIT:
Thanks for posting pic of the keyboard. Interesting.
'Zhan' is Latvian computer manufacturer or something? I couldn't find anything with my quick googling.

Sonic08

08 Jul 2020, 17:27

And so, the news: the keyboard Model F XT arrived and I additionally bought a logic analyzer.
The assumption of ibmapc was confirmed – there are some problems with signals and synchronization for different types of keyboards.
The Converter is perfectly working with the keyboard Model F XT! And the Zhan keyboard does have slightly different signals when compared to the original Model F XT.
For the hasu - Zhan keyboard is made in Eastern Europe, but unfortunately, I do not know the exact information and a search on the Internet also did not give anything.
Below I will insert all the screenshots.

Image
XT Zhan keyboard when a "K" button is pressed.

Image
XT Zhan keyboard when a "B" button is pressed.

Image
Model F XT keyboard when a "K" button is pressed.

Image
Model F XT keyboard when a "B" button is pressed.

:idea:
It would be great if Engicoder placed the source code so that it could be upgraded and work with all keyboards.

daguil68367

08 Jul 2020, 22:00

Will this work with any XT board? I've got a Space Invaders board that could use something like this, if you're still making them.

User avatar
hasu

Yesterday, 02:36

Sonic08,
What's model number of your "Model F XT"?
Its waveforms seems to be different from other IBM XT keyboards. The data line is pulled down to low when idle on IBM XT keyboards. Just curious.

User avatar
ibmapc

Yesterday, 07:20

Sonic08 wrote:
08 Jul 2020, 17:27
...The Converter is perfectly working with the keyboard Model F XT! ...
That's great news.
Sonic08 wrote:
08 Jul 2020, 17:27
It would be great if Engicoder placed the source code so that it could be upgraded and work with all keyboards.
There is a github page mentioned earlier https://github.com/engicoder/XT2PS2. But the source code is not there. I'm sure others would like to have the source code as well. I for one would like to play around with alternate key mapping, but without the source, very difficult.

Post Reply

Return to “Keyboards”