• Please review our updated Terms and Rules here

PS/2 keyboard on an XT?

tom.storey

Experienced Member
Joined
Nov 18, 2022
Messages
107
Location
London, UK
Hi all, new member.

I picked up an XT recently, its dead in the water so Im doing a refurb/repair on it (holy heck is it dusty inside...!) If people are interested I will start a thread and document my journey bringing it back to life?

Anyhow, someone mentioned that a PS/2 keyboard should work with these, but Im not convinced. I cant find any particular references anywhere else, other than some keyboards which could be switched between AT and XT compatability modes.

I bought a PS/2 to "AT" style adapter cable, but I assume this is not going to "just work"...

It came with a generic keyboard which Ive given a good clean and will be happy using in the mean time, but it is a British layout keyboard and I am used to US layout, so that is something I'd like to "fix" longer term. Ive heard of products like XT2AT which is an option I suppose.

Thanks
 
Welcome to the forum @tom.storey !

You are core, an XT-to-AT adapter cable isn’t going to work unless the keyboard has XT protocol support, like this switch:


You can build one of the XT2AT boards, or you can get a good XT switchable keyboard, or get a dedicated XT keyboard that matches the layout you like. There are XT protocol IBM Model F and Model M keyboards around, for instance.

- Alex
 
I have a few IBM Model-M PS/2 keyboards that auto-switch to Enhanced XT mode when connected to XT through passive PS/2 to DIN-5 converter. All of those have detachable cord and are older (1990-1993).
 
Coincidentally I was handed a 10mhz XT motherboard yesterday, and I also have an old Kaypro PC compatible missing a keyboard that I haven't found time to mess with *because* of the missing keyboard, so I have renewed interest in this XT keyboard substitute topic. So in that vein, I was wondering if anyone had yet slapped together a USB to XT adapter? Digging around I found this simple project for using a Raspberry Pi Pico to adapt a USB keyboard to PS/2, but I haven't been able to find anyone having done similar for XT targets.
 
Thanks all. I'll look into my options.

For shits and giggles I decided to try out my PS/2 keyboard with the passive adapter cable, and I get essentially the same behaviour as with the included keyboard. Theres another issue though, but I will start another thread for that if need be.

@modem7 yes, I have seen that site! Yours, I believe?
 
I think that the keyboard that came with the computer is broken. When plugged in I dont get a 301 error at boot, but after the memory count I get a continuous higher pitched short beep. From what Ive been able to work out so far, this sounds like something to do with the keyboard buffer filling up?

Im yet to scope the keyboards clock/data lines, but maybe it is constantly sending keys or something. Ive taken it apart a couple of times to make sure all of the contacts are clean, nothing jammed in there causing a key press etc, but no dice.

If I mash the keyboard Im able to get into BASIC some how, but cant type anything, although the beeps do stop...

Currently looking at cobbling together an AT2XTKB adapter - just have to get my hands on a PIC12F (either that or re-write the code to suit some PIC16s that I already have). I have a much nicer PS/2 keyboard here that I can use instead.
 
Hi all, new member.

I picked up an XT recently, its dead in the water so Im doing a refurb/repair on it (holy heck is it dusty inside...!) If people are interested I will start a thread and document my journey bringing it back to life?

Anyhow, someone mentioned that a PS/2 keyboard should work with these, but Im not convinced. I cant find any particular references anywhere else, other than some keyboards which could be switched between AT and XT compatability modes.

I bought a PS/2 to "AT" style adapter cable, but I assume this is not going to "just work"...

It came with a generic keyboard which Ive given a good clean and will be happy using in the mean time, but it is a British layout keyboard and I am used to US layout, so that is something I'd like to "fix" longer term. Ive heard of products like XT2AT which is an option I suppose.

Thanks
New member here too :)
I'm trying to get an XT working from the motherboard up - I put together a PS/2->XT adapter using this code: https://github.com/kesrut/pcxtkbd
I used a Sparkfun Promicro clone (ATMega32u4 MCU) with no changes to get it working and successfully got past POST - and managed to press F1 on the 601 error.
When I dropped into cassette basic the cursor is blinking but the computer seems crashed as I can no longer toggle caps lock. .. but that's something for a different thread.
 
I have a BTC keyboard from about 1990. It has 3 position switch: XT, Enhanced XT and AT.

In XT mode, it works with all XT class PCs, including 5150.
In Enhanced XT mode, it works with all my clones and 5160 with 1986 bios, but not on 5150 with 1982 bios.

I think early model-M PS/2 keyboards support Enhanced XT protocol, but not plain XT mode.
 
I've got a few keyboards that are switchable. For example, the Honeywell/Micro Switch 101 keyboards as well as various NCR ones. I think even some Chicony keyboards had switches.
 
New member here too :)
I'm trying to get an XT working from the motherboard up - I put together a PS/2->XT adapter using this code: https://github.com/kesrut/pcxtkbd
I used a Sparkfun Promicro clone (ATMega32u4 MCU) with no changes to get it working and successfully got past POST - and managed to press F1 on the 601 error.
When I dropped into cassette basic the cursor is blinking but the computer seems crashed as I can no longer toggle caps lock. .. but that's something for a different thread.
Welcome to the forum @AndersNielsen !
 
At the risk of derailing my own topic a little, can someone confirm a suspicion that I have...

The attached waveform is what I am scoping on the clock and data lines from the keyboard. When attached at boot theres a lot of noise on these signals, and then it eventually settles down to this pattern, which basically looks to me like something is constantly clocking 0xFF's? The resulting behaviour I get is that there is a constantly repeating "high pitched beep", about once per second. It stops briefly if I press a key, and occasionally I'll get a lot of rapid beeps by pressing certain other keys.

But I imagine this is not right - there should only be clocks when a key is pressed and the scancode needs to be sent to the PC right? When I dont have the keyboard plugged in at boot time, these signals are completely stable with clock and data both high.

Therefore my suspicion is that the keyboard controller is dead and is spewing out garbage.

I have put together an AT2XTKB adapter, just waiting on some PIC's to finish it off. At that point I really dont care about this keyboard any more.

Thanks!
 

Attachments

  • scope_130.png
    scope_130.png
    20.1 KB · Views: 7
What you should be seeing during POST is the XT pulling down the clock line repeatedly at an interval (computer requesting reset) and the keyboard should respond with 0x55 as an ACK.
Looks like the computer is pulling down CLK in your case but the keyboard isn’t responding with 0x55. (Seen twice in your scopeshot). Bad data line?

I also found the issue I had with the code I linked above - it was simply because the code was only expecting resets during POST so it was blocking waiting for the CLK to go high (which didn’t happen when starting BASIC). Using literally any Arduino compatible IC is a lot easier than a specific PIC :)
 
I also found the issue I had with the code I linked above - it was simply because the code was only expecting resets during POST so it was blocking waiting for the CLK to go high (which didn’t happen when starting BASIC). Using literally any Arduino compatible IC is a lot easier than a specific PIC :)

At the time I wrote the code, the small PIC was the smallest and cheapest suitable MCU available. I looked at the 6 pin PICs, but not enough I/O. 8 pins, a diode and a small capacitor (no crystal) 1024 instruction words, 64 bytes of RAM--and I used only half the code space--and a fixed length 8 deep stack for return addresses only. Look at some of the code--given the limitations of the tiny PIC, it's quite interesting.

Generally, I don't do PICs, even though I've got a hellbox full of various ones, although the PIC32 is kind of interesting, being basically a MIPS4000 CPU.

Today, I'd probably do it in a "blue pill" that goes for about a buck on Aliexpress. As a matter of fact, I'm currently using a Blue Pill to convert the infrared iPoint keyboard to PS/2 codes. A real IBM keyboard for about $3 on sale, new.

Give me some credit, willya?
 
Last edited:
Give me some credit, willya?
Oh, you bet! It's great!

The STM-clones on the Blue Pill 1$ boards are fine too and I just used the Pro Micro clone because it was literally on my desk and I didnt have to go to the garage for a different one.

If I was doing the adapter from scratch I would probably use the PMS150C (8 pin SOIC - also 1k/64b iirc), since I have a few hundred of those in my garage but that doesn't help other people much these days - the year of the 3 cent microcontroller is long gone.

I'm super happy people like you did the ground work so I could have a PS/2->XT adapter in literally 10 minutes :D
 
I do a lot of work with PICs as part of my hobbies, so I'm right at home with one of them. It's the perfect application for such a tiny PIC.

But I get it that Arduino etc are more accessible for the majority, since there is no need to buy a programming tool - just plug in a USB cable and off you go. Not really my cup of tea though. 😄
 
Back
Top