• Please review our updated Terms and Rules here

AT to XT Keyboard Converter

Thanks Chuck! I have plenty of MIDI cables lying around. :)
There is discussion earlier in this thread about some MIDI cables not having all five wires connected up.
A look on the Internet suggests that at only pins 4 and 5 may be connected, with pin 2 sometimes used for the shield.
Such a cable, irrespective of whether or not pin 2 is connected, is unsuitable for the AT2XTKB because it will not pass though the clock signal (pin 1).
 
I also use MIDI cables, after checking that all the lines are connected.

I can build my version of the board for $25, plus $6 shipping to the USA. If you want multiple boards, I will, of course, combine shipping.

Thanks!
- Alex
 
Hehe, I actually went the other way around: I used to use a keyboard extension cable to connect my MIDI synthesizer to my SB MIDI kit.
 
* after the last CLK fall, the low is held for 147uS. Data is kept at
the same level for 106uS. When attached to this PC clone, the data
line is drug low by the PC right after the CLK line goes low for the
last time, and then it releases it (and then the KB brings it low
after the 106uS mark.

Jim

I'm refreshing my memory re: the XT keyboard protocol, and because I made such great comments in my AT2XT implementation (and by that I mean barely any), I can't actually remember most of my sources of information. Do you still have your oscilloscope/signal traces?

Something is bothering me re: IBM's circuit. According to the block diagram on Page 4-4 in the 1984 IBM 5150 Tech Ref, one purpose of the keyboards' start bit is that it will eventually become the rising edge for IRQ1 when it reaches the LSB of the shift register. For the start bit to properly serve as the IRQ line, the shift register is expected to be clear (all zeros output) prior to clocking in data. When the start bit reaches the LSB of the shift register (8/9 bits total shifted in), the secondary LSB output feeds into a flip-flop (there are two outputs for the LSB- presumably the second one can be used for cascading).

Upon receipt of the next keyboard clock, the following things happen simultaneously:
  • Flip-flop asserts IRQ1 (low-to-high transition).
  • Shift register shifts in the last bit of the keycode.
  • Flip-flop asserts an input on the shift register (~G) which causes the shift register to ignore new input and preserves old output (asynchronously- takes effect immediately).
  • Flip-flop pulls-down the keyboard data line (asynchronously- takes effect immediately).

I can't verify this, but contrary to this popular document, it seems both clock and data lines are used to communicate statuses to the keyboard. CLK line low for an extended period resets the keyboard controller, and DATA line low says "PC is not ready for new data."

Setting PB7 of the PPI to 1 will clear the shift register to all zeros, and clear the flip-flop, which deasserts IRQ1, pulls up the data line, and deasserts the shift register input pin which causes the shift register to ignore data. Clearing PB7 will cause the shift register and the flip-flop to respond to the keyboard clock (according to the relevant datasheets for the TTL parts 74LS322 and 74S74, neither part will respond the the clock while CLR input is asserted).

Since the keyboard controls the clock line, this "down time" where PC pulls the data line low seems like a perfect time for the keyboard released the clock back high to the IDLE position without affecting the shift register/IRQ output. But according to your timing, this doesn't happen. Data line is released by the PC, implying the shift register/flip-flop was reset, before the keyboard releases the clock. I wonder why is that?

The other thing that bothers me is the following: indeed, the PC end will pull the data line low until the CPU clears the shift register and flip-flop, which in turn pulls up the data line. When you say and then "the KB brings it low after the 106uS mark", does this happen immediately after the PC stops pulling the data line low? Or is there a notable delay?

All references I've seen state that in "IDLE" position for the XT keyboard, data line is low, but that doesn't seem to be necessary, since the rising edge of the clock is what clocks in new data after the flip-flops are clear.

EDIT: I believe page 4-4 contains an error. PCLK (14MHz or so) should *not* be connected to the keyboard clock. The keyboard clock should feed into the D input of the nearest flip-flop.
 
Last edited:
FWIW, I open-sourced my keyboard converter design tonight. A little bit late, but I think this time I ironed out all the glitches :p. Now if only I chose a less-overkill microcontroller...
https://github.com/cr1901/AT2XT
 
cr1901,

Looks very cool! How much do you think that you could build it for? The one I built (and still do, if anyone asks) costs around $25, all told, and you should be able to do better if you bought the PCB/parts in quantity.

It's great that there are a number of different designs available.

- Alex
 
Have anyone ever considered doing a straight usb to xt adapter?
It looks like it would be really cheap now using the following.

Usb Host Shield Mini for Arduino promini 3.3V $15.00

http://www.ebay.com/itm/271815305346?_trksid=p2060353.m1438.l2649&ssPageName=STRK%3AMEBIDX%3AIT

New Mini ATMEAG328 3.3V 8Mhz $3.68


http://www.ebay.com/itm/New-Mini-ATMEAG328-3-3V-8Mhz-Replace-ATmega128-For-Arduino-Pro-Mini-Compatible-/191182699659?pt=LH_DefaultDomain_0&hash=item2c83607c8b


Add in a connector and cable, and this combo should in theory be able to connect usb keyboards to most any computer depending on the code. (maybe tandy, AT, and others...)

Later,
dabone
 
I pointed out much earlier that several 5V MCUs could do the job (e.g. AT90USB). I didn't do anything simply because I own not one USB keyboard. Most of mine are model Ms, with few exceptions.
 
Hi,

at first, sorry for my english :rolleyes: and a big thanks to Chuck(G)! I read this thread with enthusiasm and built one of those nice converters for a special terminal. Because the logic of shift-register differs a little bit, I had to make some changes, stumbled about little mistakes and had ideas of improvement, especially got some more PS/2-keyboards working.

I think it's fair to share the code again:
http://pontacko.tfn-clan.de/files/at2xt/XTATKEY_RT01.ZIP

So everyone with problems can give this a try or transfer ideas.

regards
 
Last edited:
Has anyone checked the behavior of [PrtSc]-key? Does it make sense to manipulate it (like I already did with SysReq)?

Some websites say:
PrtSc -> 37 (make) B7 (brake)
an XT-keyboard of GDR says:
PrtSc -> E0 37 (make) E0 B7 (brake)
other wesites say (but I think that's wrong and only the reverse-translation AT->XT):
PrtSc -> E0 2A E0 37 (make) E0 B7 E0 AA (brake)

AT-keyboards supposedly are sending (translated to XT):
Shift-PrtSc - E0 37 (make) E0 B7 (brake)
Ctrl-PrtSc - E0 37 (make) E0 B7 (brake)
PrtSc - E0 2A E0 37 (make) E0 B7 E0 AA (brake)

With aktivated filtering of E0h we get:
Shift-PrtSc - 37 (make) B7 (brake)
Ctrl-PrtSc - 37 (make) B7 (brake)
PrtSc - 2A 37 (make) B7 AA (brake)

What we could send:
PrtSc - 2A AA 37 (make) B7 2A AA (brake)
to revise the reported [Shift]

...or simply remember to press [Shift] or [Ctrl] in front of [PrtSc], exactly when we dont need it? :confused:

regards
 
I'm gonna answer myself before my post from yesterday gets unlocked/visible.:rolleyes:

On old XT [PrtSc] is the second occupancy of [*] -> 37h, so only [Shift] or [Ctrl]+[PrtSc] can tell the XT to print. If XT is a little more modern and the keyboard has an separate [PrtSc]-key which gives E0 37 or E0 2A E0 37, the first would be absolutly correct, but the second more authentic for old software and its lookup tables. So I think it's better to keep unchanged.
 
I built this At2XT converter but have problems. The number keys (above QWERTY) output a character but it is the wrong one. The QWERTY line also outputs wrong characters. Most of the other keys when pressed don't output anything but cause the three keyboard leds to light. I have tried two versions of the software.
Any ideas.
Paul.
 
I built this At2XT converter but have problems. The number keys (above QWERTY) output a character but it is the wrong one. The QWERTY line also outputs wrong characters. Most of the other keys when pressed don't output anything but cause the three keyboard leds to light. I have tried two versions of the software.
Any ideas.
Welcome to these forums.

You do not indicate whether you used an AT2XTKB printed circuit board (per [here]), or used something else.
If the latter, then my suggestion is to recheck your wiring against the diagram at [here].

Also, try a different keyboard.

If you get desperate, I can supply a pre-assembled and tested unit.
 
The number keys (above QWERTY) output a character but it is the wrong one.
Always the same on the same key or are they rotating?

Tried firmware in post #493?
- able to pass through 0xE1 too
- optimized timing with oscilloscope and added missing edge
- filter leading 0xE0/0xE1 if invalid byte follows
- make SysReq behave more realistic
- LockKey-LEDs no longer affected by CTRL or BREAK
- fixed buffer to do something usefull (rKeyQIn -> FSR)
- killed several interrupt problems
- soft-reset checking in SendXTByte routine
- ...
 
Hi,

at first, sorry for my english :rolleyes: and a big thanks to Chuck(G)! I read this thread with enthusiasm and built one of those nice converters for a special terminal. Because the logic of shift-register differs a little bit, I had to make some changes, stumbled about little mistakes and had ideas of improvement, especially got some more PS/2-keyboards working.

I think it's fair to share the code again:
http://pontacko.tfn-clan.de/files/at2xt/XTATKEY_RT01.ZIP

So everyone with problems can give this a try or transfer ideas.

regards

Thank you schnurzel! I upgraded the code in my pic and it solved several problems the adapter had with the Geneve 9640.

The combination ctrl-alt-delete used to 'stick', that is the adapter would keep sending the keys over and over and over. This does not happen any longer.

The combination ctrl-shift-shift didn't previously work at all. This is a very important keypress combination for the Geneve. Now it works perfectly!

Thanks again!

Tony
 
Hi there, i have three 12F675 chips available and no 629. I am not very familiar with assemblers and do not have one loaded... would it be possible for someone to re-compile the file for the 12F675 and post it? :) I have a burner ( KitsRUS kit 149b Pic programmer) with the software that comes with it from their site... :) Kitsrus.com) at any rate i can burn the .hex file. but not sure what to do with the settings ... :) any help appreciated. :)

I just purchased a Philips 2814 keyboard from ebay and as it turns out, it's an AT keyboard. I wanted to use it with my Tandy 1000 SL/2 computer i just got (but with no keyboard)... :)

hoping to build this little converter soon :) any help appreciated. :)
 
Back
Top