geekhack

geekhack Community => Keyboards => Topic started by: JohnElliott on Sat, 12 February 2011, 19:43:58

Title: IBM Terminal F: Controller ROM
Post by: JohnElliott on Sat, 12 February 2011, 19:43:58
I've managed to desolder the controller from an IBM 6110344 terminal model F, and read its internal ROM. The contents probably won't be very interesting unless you either:

a) have a few spare 8048 / 8748s lying around to make a modified controller image, or
b) are interested in how capacitative keyboards work.

PM me if you want a copy of the ROM image. I've identified two areas where changes could improve PC compatibility (completely untested):


I suppose if the controller were replaced with one that had a larger ROM (say an 8049 or an 8050) it might be possible to add scancode translation (currently, scancodes are tied to the keyboard matrix) or even turn the board into a full terminal emulation board supporting all three scancode sets and LEDs. I will happily leave both as an exercise for the interested reader :smile:
Title: IBM Terminal F: Controller ROM
Post by: microsoft windows on Sat, 12 February 2011, 19:57:24
Kishy would be very interested in this.  You should  send him a  message  or something  about it.  He's done  a  lot with the IBM terminal keyboards.
Title: IBM Terminal F: Controller ROM
Post by: JohnElliott on Sun, 13 February 2011, 08:37:44
Quote from: ripster;294230
I don't code but like learning about capacitive switches.  Anything interesting in the code?


Depends on your definition of 'interesting'. It reads the keys in groups of 8, storing their up/down status in a byte. Then it compares that byte to what it was last time the row was scanned, and if there are differences it gets on to sending scancodes. (It rereads the key group twice, presumably for purposes of debouncing, but I'm not exactly sure what it's up to there). Its buffer appears to be able to hold three scancodes at most, so if you pressed four keys in the same group simultaneously [eg: ZSAW] I think it might miss one.

Another thing, which may or may not be interesting, is that the key matrix has 128 positions, and the keyboard has 127 keys. The extra key position is (roughly) where Right-Windows ought to be -- you can see a sort of vestigial connection on the PCB there. Part of the self-test is to read that key, and if it registers as 'down' report an error.

Anyone studying the code would probably find it helpful to read it in conjunction with the KBDBabel schematic (http://kbdbabel.org/schematic/kbdbabel_doc_ibmat_kbd.pdf) of the 84-key AT keyboard, which appears to have an identical controller. It does make me wonder what would happen if you did a controller swap.

One thing I forgot to mention when talking of patching the controller ROM: You have to make sure the 8-bit checksum is 0, because the self-test checks that. I think the byte at 0100h is used for this purpose.
Title: IBM Terminal F: Controller ROM
Post by: ch_123 on Sun, 13 February 2011, 08:53:27
The AT most definitely has the same controller. As I posted elsewhere, plugging the AT into a system that uses Scancode Set 3 causes the AT to behave like a terminal board in regards to layout.
Title: IBM Terminal F: Controller ROM
Post by: JohnElliott on Sun, 13 February 2011, 10:12:50
Quote from: JohnElliott;294368
It does make me wonder what would happen if you did a controller swap.


Curiosity got the better of me. I desoldered the microcontroller from my 6450225 (84-key AT), and plugged it into the 6110344 (which means I now also have a suitable microcontroller ROM image for the 6450225; again, PM me if you want a copy). I haven't fully reassembled the 6110344, but tests on the bare PCB are encouraging. It does appear to pick up all the extra keys when I bridge them with my fingers.

Possibly related: In both ROMs at 0300h is a table which I think governs key sensitivity. In the 6450225 ROM, all the keys that aren't present on the board have a value of 7, while keys that do exist have values of 1-4. I suspect that best results would be obtained by making a custom ROM that used the 6450225 code and the 6110344 table.
Title: IBM Terminal F: Controller ROM
Post by: JohnElliott on Mon, 28 March 2011, 18:31:32
I've been experimenting, on and off over the last few weeks, with custom firmware for the 122-key terminal Model F (6110344). I've now got a 1k ROM image that seems quite promising.

Upsides:


Downsides:


I've also come up with a 2k ROM image that should turn the Terminal F into a full terminal-emulation board with support for all three scancode sets and E0 prefixes. But my Willem EPROM programmer can't program 8749s (it barely manages 8748s) so I haven't been able to test it at all.

To get round the problem of distributing IBM's copyrighted code, I've written a Java program that, given images of the original IBM ROMs, will create the new 1k and 2k firmware images and allow you to customise the key translation tables. Let me know if you want a copy.

Oh, before you ask: The only hardware I can do this with is the Terminal Model F and the 84-key AT Model F. Not the 83-key XT Model F, and not any kind of Model M.
Title: IBM Terminal F: Controller ROM
Post by: Hak Foo on Mon, 28 March 2011, 21:05:20
Proposal:  Can a replacement for the controller be had cheaply?

If so, you might be able to do a "piggyback" install-- new chip on old chip, and cut just the power lead of the old chip so it doesn't power up.  It's potentially less difficult to install.
Title: IBM Terminal F: Controller ROM
Post by: JohnElliott on Tue, 29 March 2011, 06:47:07
Quote from: Hak Foo;320371
Proposal:  Can a replacement for the controller be had cheaply?

If so, you might be able to do a "piggyback" install-- new chip on old chip, and cut just the power lead of the old chip so it doesn't power up.  It's potentially less difficult to install.


If you needed a replacement for the original microcontroller, you'd have to burn another 8748 with the original firmware, I think, unless Unicomp happen to have a supply of spare Model F microcontrollers somewhere. 8748s seem to cost $10-$20 each on eBay.

While piggybacking may be easier if you're doing a permanent replacement, the advantage of properly desoldering the microcontroller and fitting a socket is that it then becomes much easier to swap the thing in and out in the future -- for example, if you wanted to change the 8748 for one with different key mappings.
Title: IBM Terminal F: Controller ROM
Post by: What is X? on Tue, 29 March 2011, 07:03:47
Wouldn't it be better to upload it somewhere rather than ask for PMs? What if someone wants the code in a year and you're not here or something? Just a suggestion.
Title: IBM Terminal F: Controller ROM
Post by: JohnElliott on Tue, 29 March 2011, 13:26:14
Quote from: What is X?;320561
Wouldn't it be better to upload it somewhere rather than ask for PMs? What if someone wants the code in a year and you're not here or something? Just a suggestion.


A fair point; I'd wanted to wait until I'd written better instructions, but it might as well go up now. The Java app is here (http://www.seasip.info/Misc/keyboardhost.zip). That's on my personal website, though, so if I do go under a bus it won't outlast me by more than a few months at most.