Author Topic: Wyse 286 RJ11 keyboard adapter  (Read 6451 times)

0 Members and 1 Guest are viewing this topic.

Offline rootwyrm

  • Thread Starter
  • Posts: 829
  • The Hands of Steel
    • My Website!
Wyse 286 RJ11 keyboard adapter
« on: Thu, 13 December 2012, 14:23:32 »
So, we know the board - it's a beautiful one. Cherry MX Blacks, lovely doubleshot keycaps, but a 4 pin RJ11 connector that nobody's been able to figure out. The reason nobody's gotten anywhere is because there's two parts to the equation - the keyboard and the system it attached to.

I'm making slow but steady progress on digging my genuine, working Wyse PC286. This is the most important part of building an adapter for these, because there's a chip identified as "U57" on the CPU board for the 2116I. U57 is the "keyboard scanner chip." Yes, Virginia, we're probably looking at an active-scan keyboard. (Which is why I couldn't find a damn clock on it!) And yes, U57 is distinct from the i8042 on all diagrams.

The problem once I get it dug out is this: how do we reverse engineer "U57" and it's associated EEPROMs?
"I remain convinced I am the only person alive who has successfully worn out an IBM Model M mechanically."
Daily Drivers: Adesso 625 (NPKC PBT / Kailh Blue), Rosewill RK9000V2 (KC PBT / MX Brown), 1994 Model M13, Sun Type4, and the rare IBM 1394540.

Offline rootwyrm

  • Thread Starter
  • Posts: 829
  • The Hands of Steel
    • My Website!
Re: Wyse 286 RJ11 keyboard adapter
« Reply #1 on: Fri, 01 February 2013, 04:50:47 »
So because I've got a few minutes and can't sleep again, a quick explanation as to why people have seen the results with the RJ11 that they've seen.

In a normal keyboard controller, you have two clock signals involved. One is generated by the host, and the other is generated by the keyboard controller for internal clocking functions.
The first thing you should notice when you disassemble a Wyse PCET keyboard (the 102 key for PC use with RJ11) is that the PCB does not in fact, contain any clocking crystal at all. None whatsoever. In what is both a brilliant and mind-boggling design decision, they elected to rely entirely on an external clock.
Now this alone, would generally be NBD because there's plenty of microcontrollers which can take external clock. They're designed for it, so on and so forth. Transmitting clock over the RJ11 is no big deal.

What I've found is two key logic blocks which have given the results we've seen before with attempts to adapt it. The clock rate goes straight to hell and off the spec at the keyboard, every time. Yet it conforms to AT Set 2 after the U57 when fed to the i8042. Secondly that these clock rates seem to have been completely unrelated to AT specification.
So gentlemen, here's the point folks better equipped than I can take over at again, and actually get this thing working. (Because seriously guys, these MX Blacks are the sex. ANYHOW.)

There's a trigger pattern expected from host clock to keyboard controller to set the correct PLL internally, most likely between 4 and 12MHz - using CPU clock as absolute with it's close link to RTC.
So when the thing seems too ridiculously fast? That's because the clock isn't primed correctly. They stapled on a rise-fall to trigger PLL internal to the keyboard uC.
We know for fact that the "U57" IC could not exceed 12MHz reasonably being locked through i8042 to CPU TDM. That means it would be i286 12MHz, 12MHz; i286 8MHz, 8MHz, and so on. You get the idea. But if the slope is too short, the controller gets the wrong signal and clocks too high.

Basically we need to know what comes out of the HOST looking for the keyboard more than what the keyboard can tell us. I don't have the tooling for that. However, I believe once we know this data, we can solve it pretty easily. The first trick is simply going to be capturing a 500ms window from power applied. The second trick is not frying everything trying to find that.
Get the handshake right, and all problems become solvable.
"I remain convinced I am the only person alive who has successfully worn out an IBM Model M mechanically."
Daily Drivers: Adesso 625 (NPKC PBT / Kailh Blue), Rosewill RK9000V2 (KC PBT / MX Brown), 1994 Model M13, Sun Type4, and the rare IBM 1394540.

Offline poxeclipse

  • Posts: 171
  • Location: Toronto, Canada
  • Hit me with music ... yes, me friend
Re: Wyse 286 RJ11 keyboard adapter
« Reply #2 on: Fri, 01 February 2013, 18:11:44 »
So, what you need is a terminal, or an emulation of it. I had the chance to get the whole equipment, last year, but I picked only the keyboards and left the terminals. They ended, probably, in the garbage.
« Last Edit: Fri, 01 February 2013, 18:14:41 by poxeclipse »

Offline jwaz

  • * based mod
  • Posts: 2069
  • #geekhack on freenode
Re: Wyse 286 RJ11 keyboard adapter
« Reply #3 on: Fri, 01 February 2013, 18:15:52 »
I bought a Wyse brand RJ-11 to 5 Pin DIN a while ago on eBay, I wonder if it would convert successfully

Offline Hak Foo

  • Posts: 1270
  • Make America Clicky Again!
Re: Wyse 286 RJ11 keyboard adapter
« Reply #4 on: Fri, 01 February 2013, 18:55:01 »
I think sometimes though the CPU would use a higher-frequency crystal and a divide-by-X circuit to get down to the actual clock.  Like how old 386s would have a 40MHz CPU and an 80MHz crystal.
Overton130, Box Pale Blues.

Offline rootwyrm

  • Thread Starter
  • Posts: 829
  • The Hands of Steel
    • My Website!
Re: Wyse 286 RJ11 keyboard adapter
« Reply #5 on: Wed, 13 February 2013, 03:02:40 »
I think sometimes though the CPU would use a higher-frequency crystal and a divide-by-X circuit to get down to the actual clock.  Like how old 386s would have a 40MHz CPU and an 80MHz crystal.

That's not unheard of, but there's two things that make it clear this is absolutely not so in the case of the Wyse PC286. First, the maximum CPU clock available for a system with U57 present is 12MHz - keyboard signalling runs at 8-12MHz. And we know that it's in the 8-12MHz range because it's paralleled with a DIN5 which happily takes a standard keyboard. Plus there's no documentation showing U57 having a separate clock crystal. So it would have to be a 1:1 clock with the CPU very distant electrically. Given the technology of the day, effectively impossible to get a 1:1 from CPU, especially since the CPU was already receiving a divided source.
Two, the microcontroller in the keyboard itself is a very, very slow part - about 1-2MHz. That's why I suspect it's actually a polled and externally clocked interface rather than a full implementation on the keyboard. External clocking is not a big deal in and of itself, but without an internal clock to bootstrap the microcontroller? It can't respond to FF interrogation, which means 'no keyboard.' In a polled design, the keyboard doesn't necessarily respond to interrogations at boot; the host controller is likely to just send the internal microcontroller startup commands down the wire blind.

So, what you need is a terminal, or an emulation of it. I had the chance to get the whole equipment, last year, but I picked only the keyboards and left the terminals. They ended, probably, in the garbage.

Actually, that's a false assumption and going to send research down the wrong path. See, even if the terminals had a common part, they didn't have a common controller. That's the tricky part and why U57 matters so much; it's the bridge between PC Enhanced Terminal (which also is not the same as the terminal keyboard!) and i8042 AKA PC-AT.
The "common part" is also why I suspect it's an externally polled and initiated microcontroller. These were made with EEPROMs instead of less expensive UEPROMs, and with slow but rather large microcontrollers. IBM was still using UEPROMs in 1986/1987 AFAIK. And if they have no internal fixed clock range and they're polled, that means they can work with any clock range from 1kHz to 16MHz and so on. And if the microcode load is done by the host, that also means it can speak multiple scansets without requiring separate part numbers.

I've had no luck tracking down any detailed information on the microcontroller in the keyboard itself. I really need that to figure out whether it could be clocked fully external to the PCB without ill-effects. :(
"I remain convinced I am the only person alive who has successfully worn out an IBM Model M mechanically."
Daily Drivers: Adesso 625 (NPKC PBT / Kailh Blue), Rosewill RK9000V2 (KC PBT / MX Brown), 1994 Model M13, Sun Type4, and the rare IBM 1394540.

Offline Soarer

  • * Moderator
  • Posts: 1918
  • Location: UK
Re: Wyse 286 RJ11 keyboard adapter
« Reply #6 on: Wed, 27 November 2013, 07:17:12 »
Still got that keyboard handy? Does it have a 28-pin IC and a 74HC163?

If it does, then this thread is probably relevant :D

 What's the keyboard's part number?
« Last Edit: Wed, 27 November 2013, 08:13:16 by Soarer »