Author Topic: XT Model F Adapter Project  (Read 27464 times)

0 Members and 1 Guest are viewing this topic.

Offline thedward

  • Thread Starter
  • Posts: 10
XT Model F Adapter Project
« on: Wed, 21 October 2009, 19:10:25 »
I have made a working adapter for my XT Model F keyboard.

This is a work in progress. Please feel free to ask questions.
It is not meant to be a general electronics project how-to.

I started off with the following materials:

 * Teensy  USB development board
 * USB cable for the Teensy
 * Breadboard
 * Jumpers for the Breadboard
 * Female DIN-5 Connector
 * Solid Core Wires
 * Soldering Iron & Solder
 * Multimeter

[h=2]Hardware[/h]

I soldered the wires to the terminals on the female DIN-5 connector.



This is a diagram of the side of the connector you plug into; It
is backwards from the side you attach the wires to. If you have
a new DIN-5 connector, it will likely be labeled with tiny little
numbers.

You can skip pin 3 if you want, since it isn't actually used.

In theory, if you have a AT -> PS/2 adapter you could cannibalize
the DIN-5 end of the cable (using a multimeter or continuity tester
to figure out which wire is which). I actually tried this route
first but couldn't get the stranded wires in the cable to play
nice with the breadboard.

Next, I inserted the Teensy into the breadboard straddling the divide.

I jumpered the Teeny's VCC to the positive rail on one side
and GND to the negative rail on other side. I plugged in the
wires from the DIN-5 connector into the bread board at the
matching breadboard number labels (pin 1-5 -> breadboard 1-5).
Then I jumpered the Teeny's D1 to the XT clock pin (pin 1)
and D2 to the XT data pin (pin 2).

Finally, I jumpered the positive rail to XT pin 5 and the
negative rail to XT pin 4.

For a few of these connections multiple jumpers were used
due to lack of properly sized ones.

More pictures and diagrams forthcoming.

[h=2]Software[/h]

I developed the software for the Teensy board on Ubuntu Linux
using gcc-avr (1:4.3.0-4)¹ and avr-libc(1:1.6.2.cvs20080610-2)¹. The current source code can be
found at http://patch-tag.com/r/thedward/xtkbd-usb.

To build from source, you will need to check out the project with darcs:

Code: [Select]

darcs get http://patch-tag.com/r/thedward/xtkbd-usb/pullrepo xtkbd-usb


Then you should just be able to build it with make:

Code: [Select]

cd xtkbd-usb
make


If you are unable or uninterested in compiling the firmware yourself,
I have attached a precompiled version to this article. It is called xtkbd.txt,
but you will need to rename it to xtkbd.hex to load it onto the Teensy.

To load the xtkbd.hex file onto the Teensy you can use the
Teensy loader application from PJRC.

Assuming everything went correctly you should now have a functioning XT -> USB
adapter for a XT Model F keyboard. It might work for other XT keyboards, but
I can't vouch for that.

It just works with Linux and OS X (as much as any PC keyboard "just works" with OS X),
but I have not tested with any version of Windows (since I have none). Some comments
in the example source code from PJRC lead me to believe you might have to create
an INF file for it under Windows. If anyone tries it, let me know.


[h=2]TODO[/h]

As I mentioned above, this is a work in progress.

I still have some things I want to fix:

 * Make the Num Lock key do something useful.
 * Make the Del key do something useful.
 * Add a reset on idle timeout to the firmware²
 * Embed the adapter inside the keyboard.
 * Improve and update this article.

[h=2]References[/h]

This was basically a two day project for me. I could never have put this together in that kind of time frame without
all the great information I found online:

 * PC Keyboard FAQ V1.00
 * kbdbabel (open source keyboard protocol translator project)
 * Reimplementing the Symbolics Keyboard Adapter with Teensy (my inspiration for using the Teensy)
 * symbolics.c
 * PJRC's Teensy pages (an invaluable resource for the Teensy programmer)

This is a great big thanks to everyone who did all the hard work for me.


¹ These are Ubuntu version numbers.
² In case the Teensy gets out of sync with the keyboard; This hasn't happened yet, but better safe than sorry.
« Last Edit: Wed, 21 October 2009, 19:56:03 by thedward »

Offline Rajagra

  • Posts: 1930
XT Model F Adapter Project
« Reply #1 on: Wed, 21 October 2009, 19:38:30 »
Nice work!
If I get my hands on a nice XT keyboard I'll try this out.

Offline ironcoder

  • Posts: 559
XT Model F Adapter Project
« Reply #2 on: Thu, 22 October 2009, 03:55:43 »
kudos on using BSD style license!
In the office: Filco 87 Cherry Browns x 2 (one with coffee damage, recovered) ● Lexmark IBM Model M 52G9658 1993 & 1996

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #3 on: Thu, 22 October 2009, 11:42:50 »
Interesting... I was thinking of making something like this with a Colemak layout and Fn key functionality, seems I won't have to do as much work as before.

What does the reset do, break the power to the keyboard?
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline thedward

  • Thread Starter
  • Posts: 10
XT Model F Adapter Project
« Reply #4 on: Thu, 22 October 2009, 12:07:30 »
Quote from: JBert;127611

What does the reset do, break the power to the keyboard?


The firmware is constantly looking for input
from the keyboard. It looks for 2 clock
cycles, then 1 data bit for each of 8 more
clock cycles. Right now there is no checking
to make sure the clock cycles are a sane
distance apart so it could theoretically
get out of sync if it misses a bit. The
easiest way to fix this is to add a timeout
that resets the clock count to zero after a
certain amount of time with no activitiy.

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #5 on: Thu, 22 October 2009, 12:24:31 »
So what you need is some way to measure the time between those first two pulses... I wonder if one couldn't find that in some serial protocol code.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline chimera15

  • Posts: 1441
XT Model F Adapter Project
« Reply #6 on: Sat, 31 October 2009, 10:22:23 »
wow awesomeness.  I looked for a way to do this for ages when I only had my xt f.  Nice to know it's possible, and with good directions and someone to talk to to ask for advice.  You can get them pretty cheap off ebay, unlike the at's.
Alps boards:
white real complicated: 1x modified siiig minitouch kb1903,  hhkb light2 english steampunk hack, wireless siig minitouch hack
white with rubber damper(cream)+clicky springs: 2x modified siig minitouch kb1903 1x modified siig minitouch kb1948
white fake simplified:   1x white smk-85, 1x Steampunk compact board hack
white real simplified: 1x unitek k-258
low profile: 1x mint m1242 in box
black: ultra mini wrist keyboard hack
blue: Japanese hhk2 lite hack, 1x siig minitouch pcb/doubleshot dc-2014 caps. kb1903, 1x modified kb1948 Siig minitouch
rainbow test boards:  mck-84sx


Offline keyb_gr

  • Posts: 1384
  • Location: Germany
  • Cherrified user
    • My keyboard page (German)
XT Model F Adapter Project
« Reply #7 on: Sat, 31 October 2009, 12:49:54 »
Awesome work, but... why is this in the Wiki rather than the mods section?
Hardware in signatures clutters Google search results. There should be a field in the profile for that (again).

This message was probably typed on a vintage G80-3000 with blues. Double-shots, baby. :D

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #8 on: Sun, 01 November 2009, 13:52:52 »
Quote from: ripster;129550
If anyone ever comes up with Windows inf files (or is it HID files?)  for this mod please post.
Well, I think you could point them to Microsoft's default INF files for USB keyboards - hence no custom ones necessary.

I'd have to check though.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline fastbuck

  • Posts: 32
XT Model F Adapter Project
« Reply #9 on: Sat, 20 February 2010, 07:26:31 »
Any progress on testing this in Windows??

I don't have an XT keyboard to play with, so hoping for a positive confirmation, before I start ordering parts.
Keyboards: IBM Model M 1391401, CVT Avant Stellar, CVT Avant Prime, Dell AT101W, TypeMatrix 2020, Compaq MX 11800, Chicony KB-5181, IBM M-13, Chicony KB-5191, Wang 724,

Pointing devices: Contour Rollermouse & Pro, Microsoft Intellimouse Trackball, Kensington TurboBall Trackball, Evoluent Vertical Mouse, 3M Ergonomic Mouse, Zero tension mouse, MS Ergonomic Laser Mouse 6000, Logitech TrackMan Wheel, Wowpen Vertical mouse, Logitech Trackman Marble, Digital Research DRTRACK Trackball

Offline Sayyad

  • Posts: 2
XT Model F Adapter Project
« Reply #10 on: Mon, 17 May 2010, 01:25:56 »
Well I built it. I ordered up a Teensy and a USB cable, tested out the Teensy (hooray for blinking LEDs), flashed the firmware using thedward's xtkbd.hex file and installed the whole thing into my Model F.
And it doesn't really work. Must be something that I have done wrong. I think it may be the software, and I have no idea how to write my own so I don't know where to begin.
The photographs show the completed keyboard, the adapter installed, the adapter uninstalled, how I ran the cable into the keyboard, the keyboard cable socket, the adapter plugged in to the socket, and the original keyboard cable connector beside the one I made.
If the keyboard is plugged in to a Windows computer, the program button is pressed on the Teensy, and the firmware is uploaded, then the keyboard works well. Fantastically noisy, excellent feel, a joy to use.
Then it gets weird. Unplug it and plug it back in to any computer, Mac or PC (untested on Linux) and it goes haywire. Without me touching anything, modifier keys are held down, random buttons press and repeat, StickyKeys turns on, Num Lock turns on, the Help Viewer opens... Occasionally it will respond to a keystroke but will stick and repeat that key for a while before continuing to type random keys. Get this; even if the Teensy is taken out of the keyboard entirely and plugged in to the computer the random key behavior happens.
So I don't know. I guess I can reinstall the firmware every time I want to use the keyboard; I don't think that was thedward's intention. I'd really like to use this on my Mac but it will only do the random key thing. Has anybody else tried this? Thedward, do you have any idea what I have done wrong here? Thanks for the inspiration to get started on this, by the way. I had all but given up on this XT keyboard until I found out about this adapter.

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #11 on: Mon, 17 May 2010, 15:20:58 »
Maybe it loses its synchronisation with the keyboard, or plugging it in causes such a power drain that the Teensy becomes unstable.

One thing which seems odd are the white wires; what did you solder them to? It seems the Vcc and Gnd holes are still empty.

EDIT: you can counter-act the power drain by adding a decoupling capacitor between Vcc and Gnd.
« Last Edit: Mon, 17 May 2010, 16:02:22 by JBert »
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline Sayyad

  • Posts: 2
XT Model F Adapter Project
« Reply #12 on: Wed, 19 May 2010, 22:22:49 »
Hello, JBert; thank you for the reply. I used wires from old motherboard LEDs that I had lying around, hence the odd colors and socketed ends. They go where they are supposed to and are soldered in firmly with no bridges etc.
Wouldn't the computer into which I plug the keyboard warn me about the power drain? I've had warnings before on the Mac when I had too many devices on one USB port.
The synchronization hypothesis would make sense. I'm willing to try the decoupling capacitor idea, but I don't quite understand where it should be soldered or what it's capacitance should be. From a bit of reading I'm under the impression that I should clip the Vcc wire and install a 5v capacitor of some decent size as near as I can solder it to the Teensy board.
What I will do first is remove the Teensy from inside the keyboard case and attach it to the end of the XT cable as thedward did. I wanted a clean-looking installation but not at the expense of the keyboard's functioning.
Thank you for your help so far.

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #13 on: Thu, 20 May 2010, 13:41:31 »
Alright, I had a closer look. Seems everything is connected...

The PC would warn you if the total current is severely disturbing the computer's power levels. Still, a sudden current flow may still disturb the Teensy. The capacitor should thus be connected as close to the keyboard as possible, between the +5 supply and ground.
I don't think the cable would do that much...

Does the Teensy still have the original bootloader?
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline didjamatic

  • Posts: 1352
XT Model F Adapter Project
« Reply #14 on: Thu, 20 May 2010, 14:09:32 »
Awesome work!

If you can adapt an IBM Displaywriter (beam spring switches) to PS/2 I will shower you with money and gifts.

Or, for an IBM 564098 3178 Terminal board like this to PS/2, that would be awesome.  I think it may be capacitive.
IBM F :: IBM M :: Northgate :: Cherry G80 :: Realforce :: DAS 4

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #15 on: Thu, 20 May 2010, 16:14:55 »
I would love to work on such a project, and it shouldn't be that hard.
I just do not want to foot the bill for a 10-pound keyboard.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline buedi

  • Posts: 10
XT Model F Adapter Project
« Reply #16 on: Fri, 28 May 2010, 15:52:18 »
Is this project still alive JBert? You mention in your article that you wanted to improve some things (Num Lock behaviour for example). And Sayyad: Is your Keyboard working now as expected?

I got my hands on a Model F with the German Layout and I´m thinking about getting a Teensy. But then I want to be sure that it works for others under Windows and if it makes a difference which Keyboard Layout you are using. AFAIK the Codes sent are equal by each Keyboard on the World (this is why we need to select the Keyboard language in our Operating Systems), but I am not sure.

Thanks JBert for sharing your knowledge. I wanted to buy a XT AT converter from clickeykeyboards, but they are not available anymore.

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #17 on: Fri, 28 May 2010, 17:10:58 »
For the record, this isn't an article of mine nor did I build it. I was just trying to help Sayyad seeing how he had some trouble getting it to work.

The keyboard layout shouldn't be a problem, just make sure you configure your Windows to use the right keyboard layout (English US if you want Qwerty, German if you want to use Qwertz).

Clickykeyboards sold out of them or stopped listing them shortly after I was complaining that they were rather overpriced. If the two are related, sorry for that.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline Voixdelion

  • Posts: 338
XT Model F Adapter Project
« Reply #18 on: Sun, 30 May 2010, 16:41:27 »
Quote from: buedi;187765
I wanted to buy a XT AT converter from clickeykeyboards, but they are not available anymore.


So there once was such a thing in existence, eh? That's promising.  I am likely determined enough to put this article to use as example, but i have quite a bit on my plate atm so i'd prefer a less time consuming solution to my model f problem.   OOC, how much did they cost when they were available?
"The more you tolerate each other, the less enforcement will happen."-iMav

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #19 on: Sun, 30 May 2010, 16:49:44 »
IIRC they were $100 each. They were nicely done for a small run, but my main issue with it was that it cost 3-4x more than the keyboard itself. You could just buy a model F AT and be done with it causing the XT to go to a landfill anyway.

Maybe it could have been cheaper if it were a DIY kit, then again they're no longer around.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline buedi

  • Posts: 10
XT Model F Adapter Project
« Reply #20 on: Mon, 31 May 2010, 15:14:13 »
I wrote a Mail to clickykeyboards I thin on the same day I made this post here. They immediately replied. They don´t sell the adapter no more not because JBert was complaining (I hope you can sleep better now :biggrin:). They only had a bunch of them purchased from someone. After they ran out of stock they tried to contact that person by Mail to order some more. But they never got a reply.

Maybe I will purchase such a USB developer Board to try out what´s posted here. But since I have to order this from the US and I´m not sure if the Model F I have here (1984 if I remember correctly) is really working I try to get happy with my Acer 6311 (which looks completely different to the ones posted here on the forums) at home, my G80-3000 at work (I use it daily at work since at least 1990 and it was still used when I got it back then) and maybe my 1990 Model-M which I bought off Ebay for 25€ yesterday :bounce:

I hope I don´t get disappointed after I receive the M... that F sounds very sexy and I have to hide it from my wife :boxing:

Offline Voixdelion

  • Posts: 338
XT Model F Adapter Project
« Reply #21 on: Tue, 01 June 2010, 17:46:17 »
Found this too - seems like as of not too long ago, there were some stirrings of interest in coercing someone to make a handful of these over here:
http://www.vintage-computer.com/vcforum/showthread.php?19964-XT-to-AT-Active-Keyboard-Converter
"The more you tolerate each other, the less enforcement will happen."-iMav

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #22 on: Wed, 02 June 2010, 16:03:26 »
Oooh, this is starting to get interesting. If shipping to Europe wouldn't be too high, I might be interested depending on the price.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline timofonic

  • Posts: 59
XT Model F Adapter Project
« Reply #23 on: Sat, 05 June 2010, 19:54:35 »
What about the IBM PC/XT ---> PS2 from kbdbabel?

I also found AT2XTKBD and seems quite interesting too.
« Last Edit: Sat, 05 June 2010, 20:17:36 by timofonic »

Offline nowsharing

  • Posts: 247
  • Swoop
XT Model F Adapter Project
« Reply #24 on: Sat, 05 June 2010, 21:05:42 »
I put a word in for GH on the vintage-computer thread about XT-AT converters.

If anyone is seriously interested, I recommend posting as they are currently looking into how much interest there is.

Offline dfj

  • Posts: 171
  • Location: Canada
  • Visit our irc: #geekhack on libera.chat!
XT Model F Adapter Project
« Reply #25 on: Wed, 23 June 2010, 18:40:40 »
Quote from: timofonic;190032
What about the IBM PC/XT ---> PS2 from kbdbabel?

I also found AT2XTKBD and seems quite interesting too.


Has anyone here built one of these kbdbabel protocol converters?
  I don't have any 8051's lying around, but they are 40-pin goodness, they can do lots of keyboard stuff.

My code runs on atmega, atiny or av90USB thangs - haven't looked at 8051 yet.

dfj
Fave Switch manus: IBM, Topre, Matias, ...

Offline BigBrother

  • Posts: 87
XT Model F Adapter Project
« Reply #26 on: Sat, 16 October 2010, 06:37:07 »
so this adapter works aside from the Num Lock and Delete key?

what does the lack of timing out do? extra strain on the processor?

also, where can i find a PS/2 adaptation? (hopefully not KBDBabel's, i can't find the list of items for his adapter nor will he reply to my email).

Offline JBert

  • Posts: 764
XT Model F Adapter Project
« Reply #27 on: Sat, 16 October 2010, 10:49:37 »
Quote from: BigBrother;234620
what does the lack of timing out do? extra strain on the processor?
Actually, there is a time out, it is there to reset the hardware every so often to make sure that the keyboard and converters clock won't drift apart.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline arfink

  • Posts: 66
XT Model F Adapter Project
« Reply #28 on: Sat, 16 October 2010, 22:24:25 »
This teensy thing looks promising, but I'm going to resort to this only if by KBDbabel build fails. I actually did manage to get in contact with the guy who runs KBDbabel (I will not reveal his personal email address, sorry) and I have not only a complete parts list but also full schematics and the .HEX files for the adapter. If it works as I hope it will then I will be certain to post all that info and a tutorial besides.

Some things to notice: the ASM files that are on source forge are difficult to compile properly without the stuff from the /INCLUDE directory here: http://kbdbabel.cvs.sourceforge.net/viewvc/kbdbabel/kbdbabel/include/

That tripped me up a bit. :) As for parts listings and schematics, everything is here:
http://kbdbabel.cvs.sourceforge.net/viewvc/kbdbabel/kbdbabel/kbdbabel-pc-ps2/

Yes, there is no bill of materials. You'll need to read the eagle files to find out what you need, and it's all helpfully labeled. Yes, I was reprimanded for being a noob. Yes, it's still confusing, but not nearly as much.

Now of course, I'm interested in building this as a matter of course, even though the Teensy path is probably actually cheaper when you consider getting PCBs made. But I do want PS2 and not USB.

EDIT: KBDBabel has pics of his prototype is you dig deep enough in his website. (I had to use archive.org) It looks like this:




I actually found these pics to be extremely helpful in decoding the various eagle schematic files and figuring out what goes where, and what parts are what. Those NEOSID things are ferrite inductors, which was the one part I could not figure out from the schematic for the life of me.
« Last Edit: Sat, 16 October 2010, 23:26:04 by arfink »

Offline dec.net

  • Posts: 65
XT Model F Adapter Project
« Reply #29 on: Sat, 08 January 2011, 14:19:49 »
Hope this is the right thread to post this in, but since it was the right thread to get me started, let's just wait and see what happens. I received both a Model F XT and a Teensy yesterday, or at least that's what I thought.

Got a pseudo-Teensy actually, with an Atmel AT90USB162 chip instead of an AtMega32U4 as a real teensy would use (see attached links). Since just about all "teensy" boards on ebay.de use this chip, I assumed that this was the correct one, but it seems like it ain't. After some struggling to get the damn thing programmed at all with Atmel Flip under Windows 7 64bit (hint: Need to use someone else's fake-signed drivers to succeed), I did however think this might work nevertheless - after all, my seller said it was 100% teensy compatible, right? ;)
So I gave it a try using thedward's hex-file. While it doesn't work as intended right away, it seemed to do at least something under the oscilloscope:
On both the data and the clock pin there was a timing signal - on-off-on-off...that lasts about 8 bits, then silence for three times as long, then the whole thing repeats.
Since my camera (=cellphone) sucks anyway, let me draw the signal for you:

____̅ _ ̅ _ ̅ _ ̅ _ ̅ _ ̅ _ ̅ _ ̅ ________________________________________________ (repeat)

This signal moves around (that is to say, it seemed to appear a little earlier or later) when I pressed a key, so I got at least some hope left - what's bothering me is just that, like I said, the signal was absolutely identical on both pins which I figure can't be right. So I checked for wire shorts, and found that my board for whatever reason (cleaned it with alcohol and checked for stray lines already) maintains a 105 Ohm connection between the pins I've used: PD1 and RTx (=PD2). Can't think of any reasons for that on my behalf, so I thought it might be time to pass it over to you guys...

Have to admit I went in a bit over my head, didn't do too much that involved microchip-programming before apart from a little robot thingy. Any help would be really appreciated... that keyboard feels REALLY good, I have to say, lighter yet more held together than a Model M keypress.



Oh, before I forget the simplest possible cause for error, is it correct that you used connectors D1 and D2, which is to say actually the second and third output, or did your teensy board for some reason start to number these ports as D1 instead of D0?

Chris

----

Links

Atmel AT90USB162 datasheet (as used in my cheap clone)
Atmel AtMega32U4 datasheet (as used in a "real" teensy)
Daily drivers at home: \'93 IBM Model M; Currently: Model F XT (hebrew layout), adapted via Teensy.
Daily driver at University: Marquardt HEROS miliary board.
Take-with-me-board: G80-1800 (blue/black).
Boards I don\'t use: DS 102W (cherry 1800 lookalike, waterproof industrial case with ultra-mushy membrane switches). Dell AT102W (don\'t like it too much, very uneven feeling - last chance is to teflon-coat the sliders)

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
XT Model F Adapter Project
« Reply #30 on: Sat, 08 January 2011, 20:52:39 »
The keyboard only needs power to output clock and data just by pressing keys, so you can test that end of it just with the scope. It should have a regular signal on clock (like you're seeing) and a less regular one on data, depending on which key you press.

As far as the pins goes, yes, the code is looking at Port D bits 1 and 2 (not 0 and 1). I had a quick look at the datasheets, and it looks like the setup for that port should be the same as on the ATMega. I haven't compared the USB setup registers in any detail, but from a quick glance they look the same too. (The best solution for any incompatibilities there would be to recompile it for the different CPU, but it may not be needed).

I've no idea about the resistance between those pins - 105 ohms is a very odd value, not quite a short - I presume everything was disconnected when you measured that! Does the PCB trace only go from IC pin to the breakout pad and nowhere else?

It's actually very easy to get setup for programming these things - just download and install WinAVR. (At least, that's true on XP...). So changing the code to use different pins would be pretty simple.

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
XT Model F Adapter Project
« Reply #31 on: Sun, 09 January 2011, 15:46:22 »
How many people have built this adapter so far?

I'm asking because I have an upgrade in the works, but at the moment I'm using different pins on the Teensy. Shall I change mine to match this one, so people can load either?

Offline dec.net

  • Posts: 65
XT Model F Adapter Project
« Reply #32 on: Mon, 10 January 2011, 10:11:50 »
Hmm, so I guess with thedward's firmware people had mixed results - including me; I've reached the point where I could type in a few keys, but very soon it would spit out random keys and not release the keys pressed previously. The debug information tells me that it does in fact lose sync quite often, so that a keycode pattern like 1011101 gets recognized as 1110110 or some similar shifted version. I have some hope that the code might be optimized to allow better detection - for starters, it gets triggered by the falling flank of the clock signal to read the bit on the data signal; on an oscilloscope, though, it looks like the rising flank of the clock should give a lot more reliable data. Also, as I've heard people say quite often, it needs some sense of timing, so that it doesn't combine parts of two keypresses to form a new one by mere chance. I'll try and see if I can get it to work with that, possibly by optimizing the code performance as well - I'm having the suspicion that the actual writing of the translated data to USB takes a bit too long (could be related to my debug routines at the moment), so that the chip is still busy writing while it should actually be reading the next keypress.
If this optimization doesn't work, I think I'll try and see how hardware interrupts and timeouts work - after all, we're trying to read a signal that appears at random times and is time-critical to handle, which seems to be much better fitted to interrupts than to the method of polling, as used by thedward's code.

But as I see it, there are quite a few people working on an inexpensive XT adapter, independently nearing the point where they feel comfortable to release their software - so I guess if any of you are considering to get an XT keyboard, DO IT! These things feel amazing, though the key layout is crap, admittedly, but that can be fixed - after all, the USB chip provides some programmability, and Model M keystems seem to fit as well. For an example, I guess it would be rather possible to use a hardcoded CapsLock + 1 = F1 rerouting, to let me use the very conveniently placed actual F1-F10 keys for whatever else springs to mind. Replace the Enter and Backspace keys with something from an old Model M, and you'll have a compact, solidly build, amazingly feeling NKRO keyboard with a fairly decent layout...

Chris
Daily drivers at home: \'93 IBM Model M; Currently: Model F XT (hebrew layout), adapted via Teensy.
Daily driver at University: Marquardt HEROS miliary board.
Take-with-me-board: G80-1800 (blue/black).
Boards I don\'t use: DS 102W (cherry 1800 lookalike, waterproof industrial case with ultra-mushy membrane switches). Dell AT102W (don\'t like it too much, very uneven feeling - last chance is to teflon-coat the sliders)

Offline dec.net

  • Posts: 65
XT Model F Adapter Project
« Reply #33 on: Wed, 12 January 2011, 13:08:12 »
So I guess to sum up the above statement: I've had some problems mainly for my inexperiencedness with these things and programming in general, plus some avoidable errors on my behalf. I did come to a successful almost-conclusion though. As I've had to use different ports than everybody else due to electrical problems with my cheap teensy copy, I ending up relying on the PinChange Interrupt (PCINT12) available by mere chance on the ports I was using (D4 for DATA and D5 for CLOCK). It is thus incompatible with everybody elses already built adapters, and that's why I won't commit it to the darcs project and post it here instead.

 Still, you can have a look at what I did to make the numlock keys work, this should in fact be easily transferrable to the original code by thedward. Also, since my BIOS needs to be told where to start from every now and then using the F12 key (lacking on the original XT keyboard), I did implement the "Capslock+Number row = F1..F12" thing. I'm working on getting replacements to work for the actual F1..F10 keys (cut, copy, volume control...), but so far had no luck under Windows at least. Well, anyways, have a look at my code and tell me how to improve...

(EDIT: Improved the reliability by adding a timer function to make sure the data is read in time. Also implemented some things dfj told me about... Thanks to him, Soarer and #GH for all the help btw!!! Couldn't have made it without you guys!)

Chris
« Last Edit: Wed, 12 January 2011, 15:58:20 by dec.net »
Daily drivers at home: \'93 IBM Model M; Currently: Model F XT (hebrew layout), adapted via Teensy.
Daily driver at University: Marquardt HEROS miliary board.
Take-with-me-board: G80-1800 (blue/black).
Boards I don\'t use: DS 102W (cherry 1800 lookalike, waterproof industrial case with ultra-mushy membrane switches). Dell AT102W (don\'t like it too much, very uneven feeling - last chance is to teflon-coat the sliders)

Offline kps

  • Posts: 410
XT Model F Adapter Project
« Reply #34 on: Sun, 13 February 2011, 21:03:12 »
Here's a picture of my new XT-to-USB adapter, running code based on dec.net's, on a sub-$10 device sold as a PS3 jailbreak dongle. I'm typing this post using it with the Model F that belongs to my IBM 5150 PC.

Notes: (1) I did prototype on a Teensy 2.0 first. (2) Soldering wires to TQFP pins is not a lot of fun.


Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
XT Model F Adapter Project
« Reply #35 on: Sun, 13 February 2011, 21:50:14 »
Nice work! I guess it's got an AT90USB162 inside...?

Offline BigBrother

  • Posts: 87
XT Model F Adapter Project
« Reply #36 on: Sun, 13 February 2011, 22:58:56 »
tl;dr some posts, kbdbabel has unfortunately not updated to compensate for sourceforge removing their cvs system. i and dfj have a copy of the files/schematics.

Offline kps

  • Posts: 410
XT Model F Adapter Project
« Reply #37 on: Sun, 13 February 2011, 22:59:50 »
Quote from: Soarer;294667
I guess it's got an AT90USB162 inside...?


Yes. This is one of the better ones for reuse; it has a HWB (boot mode) switch, and two LEDs. I got a couple when proper dev boards were scarce, but ended up not using them before now. (I don't have a PS3.)

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
XT Model F Adapter Project
« Reply #38 on: Mon, 14 February 2011, 08:32:15 »
Quote from: BigBrother;294688
tl;dr some posts, kbdbabel has unfortunately not updated to compensate for sourceforge removing their cvs system. i and dfj have a copy of the files/schematics.
Looks like the CVS has been restored.

Quote from: kps;294690
Yes. This is one of the better ones for reuse; it has a HWB (boot mode) switch, and two LEDs. I got a couple when proper dev boards were scarce, but ended up not using them before now. (I don't have a PS3.)
The regular Teensy has become scarce again, hasn't been available for a while. Their best guess at them being back in stock is April, and then only maybe. So I've been looking around for alternatives, since it seems wasteful to use Teensy++ for simple converters! But the '162 doesn't have quite enough RAM for my liking (since I want to implement macros). :-(

Offline kps

  • Posts: 410
XT Model F Adapter Project
« Reply #39 on: Mon, 14 February 2011, 09:20:25 »
Quote from: Soarer;294792
So I've been looking around for alternatives, since it seems wasteful to use Teensy++ for simple converters! But the '162 doesn't have quite enough RAM for my liking (since I want to implement macros). :-(


Adafruit has a 32u4 board, using the TQFP package, which is currently available.

Edit: I just noticed you're east of the Atlantic. For projects that can live with 3.3V I/O (e.g. a matrix decoder rather than an adapter), Olimex has an LPC1343 (ARM Cortex M3) board that looks attractive.
« Last Edit: Mon, 14 February 2011, 09:34:29 by kps »

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
XT Model F Adapter Project
« Reply #40 on: Mon, 14 February 2011, 16:04:49 »
Thanks for the adafruit link. I see they're complaining about erratic supply as well!

And for the ARM board - looks like it might be suitable for a different project I have in mind :-)

Offline hasu

  • Posts: 3472
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
XT Model F Adapter Project
« Reply #41 on: Wed, 16 February 2011, 23:48:17 »
I am trying "ATmega168p + USBaspLoader + V-USB" as teensy alternative. I can program MCU via USB like Teensy but it needs another TTL serial line for debug console.





Writing program with V-USB is not easy as Teensy for me, V-USB uses interrupt and some cycles for USB handling so application code is often intervened during keyboard signal process. I have not handled PS/2 signal well enough with V-USB :(
I found $20 Teensy is cheep enough for easy programming :)

ARM... It is so attractive though maybe overkill for keyboard. LPCXpresso is cheep as $30.

Offline ghostwheel

  • Posts: 1
success
« Reply #42 on: Wed, 02 March 2011, 16:19:29 »
I managed to connect my model F to my mac. Thank you!
I moved some keycaps around, so that I have all important keys (see picture)

 This amounted to move esc instead of F2, tilde instead of esc, backslash instead of tilde, command(apple) instead of backslash, and finally F2 instead of keypad minus (yuk). Works for me, though it probably isn't really optimal yet.

The teensy replacement I used based on at90usb162, is called "Teensy Dev Board AVRKey Open Kubus AT90USB Teensy USB" on ebay. I connected pin pd5 to data, and pin pd4 to clock (soldering error...). The other modification I made that the keyboard announces itself as vendor apple 0x5ac, keybaord usb aluminium 0x220. This is because with the original vedor/device id my computer kept asking me to identify the keyboard every time I plugged it in.

To compile the program I used avr-gcc, and to install it on the device
dfu-programmer - both for OSX.

I attach my code and hex file, which can be directly installed if you use an identical setup. The code is almost identical to thedward's, so I just include the modified files. At some point it would be cool to include all the features of the ps/2 to usb adapter based on teensy...
« Last Edit: Wed, 02 March 2011, 16:27:44 by ghostwheel »