Setting terminal model M's DIP switch "correctly"

okrutnik

16 Aug 2018, 02:24

Hello everyone, I'm in the middle (hopefully) of a "restoration"... actually getting to work... process and I thought I could get some advice from the elders.

I grabbed an IBM model M terminal version. I love big keyboards with lots of function keys; I already own a 1987 Cherry MX Black Nixdorf thing for few years which has impressive 30 F-keys. (Sadly for a long time I couldn't use it, because I broke the cable and didn't know to repair it, for now I just connected and isolated the wires -- need to get into soldering). I also came to like those plus-shaped arrow clusters.

...Somehow I thought I could use my DIN->PS/2 adapter for connecting the M, but it actually has the dreaded 240 degrees plug. I ordered parts for my own Soarer's converter, since importing it ready-made from the US would cost more that the keyboard itself. But I also have a bigger problem. It's an old M with DIP switch, and I'm not sure how it influences my chances of getting this to work.

Some history of this keyboard. The main sticker on the back is completely destroyed, but the plastic was made in September 1985 and the backplate in January 1986, in the UK, part number 1389137. I wasn't aware it is such an early specimen. Some traces inside suggest that someone may have spilled a liquid inside, but I don't want to think about it for now :P I assume that it must have happened somewhere after 1989.

Anyway, I found a strange device inside with numbers and switches. Initially I thought that it may be some kind of lock (like you can't use the keyboard if you don't know the passcode), but apparently it's a "DIP switch" for selecting scan codes, if I'm correct.

I made some photos of what it looks like. I didn't touch the mini-switches and they are as they arrived: 1, 2, 3, 8 are "on". And luckily I documented my disassembly so I'm sure that I re-plugged it as it was: pins A2-A7 and B2-B5 connected to the switch, B6 loose, B7 with its own jumper. But two wires going from the switch went completely loose. Each of the mini-switches has its own connection alright, the loose ones are at the bottom of the plug and on the other side of the switch (I hope it's somewhat visible on the photos). I don't really know that much about electronics, but I suspect that these loosened wires close the circuits for the switch to work (?).

Now, I would get your opinions. Do I have to reconnect those wires? Could I just unplug the DIP switch entirely and expect the board to somehow work? Are there some better settings of these switches? As I said earlier, I plan on trying this board with a Soarer's converter. (But if making my own passive dumb adapter for PS/2 would be somehow possible, I'd also like to know it!)
Last edited by okrutnik on 16 Apr 2020, 19:44, edited 1 time in total.

User avatar
fohat
Elder Messenger

16 Aug 2018, 02:44

okrutnik wrote:
Could I just unplug the DIP switch entirely and expect the board to somehow work?
Yes, I have always just unplugged those modules and discarded them. Soarer's firmware will make allowance and, for me at least, has always worked immediately.

Caveat: I have always used name brand Teensy breakout boards.

User avatar
Sangdrax

17 Aug 2018, 01:42

Yanking it just sets all switches to open, which the board tells you is the down position. So just switch them all to down/open and you don't have to pull parts or throw things away.

okrutnik

17 Aug 2018, 12:26

fohat wrote:
okrutnik wrote:
Could I just unplug the DIP switch entirely and expect the board to somehow work?
Yes, I have always just unplugged those modules and discarded them. Soarer's firmware will make allowance and, for me at least, has always worked immediately.

Caveat: I have always used name brand Teensy breakout boards.
Frankly, what I managed to get is some Arduino Leonardo "compatible".

By some more search-engining I managed to find this page. It confirms my suspicions that making a PS/2 adapter should be possible, but for now I will go with Soarer's for convenience (NKRO etc.). More importantly, the author says that
When sent an identify command (0xF2), the keyboard returns the byte sequence 0xBF 0xBF. However, this can be changed. On the keyboard PCB is a 12-pin header, marked as 6 pairs of pins (B2-B7). These correspond to bits 5-0 of the second byte of the keyboard ID. Shorting a pair of pins sets that bit to zero. So placing a jumper on the B2 pair will change the keyboard ID to 0xBF 0x9F.

Adjacent to this header is a space on the circuit board for an identical header, marked as pins A2-A7. Presumably these would have the same effect on the first byte of the keyboard ID.
So this is interesting. Hexadecimal 0xBF is 1011 1111 in binary. My swich was effectively set to 0001110 plus 11 for B4 and B5 (which are covered by the switch plug but aren't configurable by the DIP switch) plus 10 for B6 and B7. So by that theory, my keyboard's identification would be 1010 0001 and 1010 1011, or 0x51 0xAB (the initial 101 is taken from the non-configurable part of 0xBF). I'm not sure this is correct (I could've messed up bit order and other things), and probably doesn't matter that much.

EDIT: Of course I messed up. Value on the switch is 00011110. Since 6 bits are configurable for A and B (or are they), that would be 1000 0111 (0x87) and 1010 1110 (0xAE).

If the identification bytes theory is true, bogus values should present no danger, I think. But it bothers me that only 8 bits are user-configurable and they are labeled 1-4 and 5-8 on the sticker (as seen on photo). So it is possible that it configures something different altogether. A single byte, probably. Would love to see some original IBM docs for this...
Sangdrax wrote: Yanking it just sets all switches to open, which the board tells you is the down position. So just switch them all to down/open and you don't have to pull parts or throw things away.
I eventually settled on buying a bag of oldschool jumpers, as they cost next to nothing. I should be able to pick them up somewhere in my city to avoid shipping and waiting. Then I will short the pins that were shorted and tape the loose DIP switch plug inside of the keyboard.

Now I'm waiting for my DIN sockets to arrive. The seller said that they are indeed 240 degrees... I hope. Of course the plan B is to cut the cable and connect wires directly to the Arduino. But this would be destructive and I would rather not do that 8-) This big metal IBM plug wouldn't forgive me...

jeb

17 Aug 2018, 20:21

okrutnik wrote: Now I'm waiting for my DIN sockets to arrive. The seller said that they are indeed 240 degrees... I hope. Of course the plan B is to cut the cable and connect wires directly to the Arduino. But this would be destructive and I would rather not do that 8-) This big metal IBM plug wouldn't forgive me...
Usually from what I've seen, the cable connects to a pin header on the controller. If you wanted, you could easily solder the pin headers onto your Arduino and then use female-to-female jumper wires to connect them to the header on the controller, which is as non-destructive and reversible as you could get. No cable cutting necessary.

okrutnik

22 Aug 2018, 14:38

jeb wrote:
okrutnik wrote: Now I'm waiting for my DIN sockets to arrive. The seller said that they are indeed 240 degrees... I hope. Of course the plan B is to cut the cable and connect wires directly to the Arduino. But this would be destructive and I would rather not do that 8-) This big metal IBM plug wouldn't forgive me...
Usually from what I've seen, the cable connects to a pin header on the controller. If you wanted, you could easily solder the pin headers onto your Arduino and then use female-to-female jumper wires to connect them to the header on the controller, which is as non-destructive and reversible as you could get. No cable cutting necessary.
I ended up not needing it, but thank you, that's a neat idea!

Luckiily I managed to order a bag of 100 jumpers for $1.5 in an electronics store. Also the DIN sockets arrived few days too late because of a post hiccup but they do fit. In fact, I'm typing this on the board.

Sadly, it's not an entirely pleasant experience, because 'e' and 'i' alternate between not working and chattering when I hit them harder. I connected the "clock" wire somewhat suboptimally, but all the other keys work fine, except for the right arrow and 'z' which don't work at all. I noticed that keys contact better when I make sure that the spring is mounted at the center and whines loudly on pressing, but it doesn't help with those four. I wonder if it means I would need to disassembly the backplate, clean the membrane and bolt-mod the thing. (Should this help?) Anyway, I don't feel like doing it now.

I thought, after watching people on YT, that model Ms sound (relatively) more clacky and computer-keyboardy than they do. This thing sounds more like a typewriter.

Post Reply

Return to “Keyboards”