Tektronix 4120

MMcM

19 Oct 2020, 04:27

This keyboard is from a Tektronix 4120 series graphic workstation from 1985.
tek-case.jpg
tek-case.jpg (653.89 KiB) Viewed 291 times
To quote the catalog:
The 4120's user-friendly keyboard features numeric keypads, thumbwheels for graphic input, eight dedicated programmable function keys, ports for joystick and mouse, and a complete easy-to-use viewing system implemented from the keyboard.
Like so many cool-looking keyboards from that period, it's foam and foil. But it still seemed worth getting, even though the first step would be dealing with that.
tek-foil.jpg
tek-foil.jpg (498.88 KiB) Viewed 291 times
Time has also taken a toll on the cable, which is several meters(!) long terminating in a DIN-5: the plasticizers have broken down making it sticky and prone to picking up dog fur off the floor.

The function key switches (not including the numpad) have much heavier springs. These were clearly internded for high-level functions and not rapid interaction like navigation.

There was some speculation that the f&f would be BTC. But, no, it's Keytronic.
tek-top.jpg
tek-top.jpg (1.14 MiB) Viewed 291 times
tek-bottom.jpg
tek-bottom.jpg (1.64 MiB) Viewed 291 times
With all the keyboard has to do, some of the engineering is more complex than usual for keyboards of this period.

The controller is an MCS-51, specifically, an 8031, which needs external program ROM. That's convenient because the PROM can be pulled out and disasembled. This keyboard has rev 191-2716.
tek-open.jpg
tek-open.jpg (367.44 KiB) Viewed 291 times
The keys are scanned with the aid of a couple of custom chips, 22-00950-001 and 22-908-03A. The latter presents a parallel interface to Port 1 with strobe on P3.3, more or less exactly as in the patent that is conveniently cited on the PCB.

The thirteen LEDs need more pins and more power than can be handled directly by the MCU. They are connected to a couple of addressable high-current latches, NE5090, which are normally used to drive relays. The address and state lines come from Port 0. The control line comes from one of the outputs of a dual 2-to-4 demux, whose two selector lines come from P3.4 and P3.5. The two gates for the demux are WR and RD. All of which means that the MOVX instruction, which was designed for accessing external RAM, can be used to implement a primitive 8-position bus with common data lines (that are also shared with addresses to the PROM).

The other signals from the demux go to clock lines of various flip-flops for other parts of the system, such as, I believe, the joystick (I don't have one).

Port 2 seems to only be used for the high address bits of the external program memory.

The 8051 has a built-in serial interface, which uses two more pins on Port 3. RxD comes from one of the wires of the DIN-5 connector, after being inverted twice by a NAND gate with Schmitt triggers to clean up the edges. TxD goes to another DIN pin, after begin inverted twice by a 7406.

The power line goes to two(!) 5V regulators, so it needs around 12V with a decent amount of current.

That is enough to build a converter board.
tek-converter.jpg
tek-converter.jpg (421.53 KiB) Viewed 291 times
After power-on / reset, all LEDs are on; the terminal needs to turn them off.

Nothing shows up on the serial port for a straightforward sketch. That is because the from-keyboard line, which is being held at idle-high by the keyboard end, is floating after going through the inverter. Open collector serial isn't really a thing: a pull-up is needed. Fortunately, turning on the internal one for PD2 just works on the Teensy AVR.

The serial communication is 1200 baud and the keyboard sends unique up and down key transitions, which is ideal, even separate codes for the two shift keys.

The to-keyboard protocol includes a single byte code to turn off all LEDs, as is perfect for right after power-up. And another to turn them all back on, which I suppose gives a way of attracting the user's attention by flashing them all quickly. There are also codes to turn on and off individual LEDs. The protocol numbers for those don't have any recognizable order. And the protocol allows for thirty-two of them, which is a bit weird.

Turning on a fourteenth LED by sending the highest possible code (31) actually drives a 555 timer connected to the speaker to play a tone. Even though that's a lot of hardware for this, there does not appear to be any way to change the note. And this keyboard seems to be too late for the craze of boards with linear switches playing clicky sounds.

I did not have anything very useful to do with all the indicator LEDs, so in the QMK default, I just made the four on the right light up when the key above them is pressed.

It's disappointing, but I have not yet had any luck getting the thumbwheels to do anything. I may need to take them out to connect to a scope. I imagine that they are simple rotary encoders with physical contacts for quadrature output as CLK and DT. The outputs go to a quad NAND gate. When I got the keyboard, they were disconnected. It's possible to connect the four-pin cable backwards; there is just a little arrow indicating where the pin 1 end goes. But I do not believe anything permanently bad results from that, even though it reverses power and ground. The signal outputs just don't make sense. It's also possible that the contacts have corroded, although they seem to be sealed inside the wheel.

User avatar
kps

19 Oct 2020, 21:03

MMcM wrote:
19 Oct 2020, 04:27
Turning on a fourteenth LED by sending the highest possible code (31) actually drives a 555 timer connected to the speaker to play a tone. Even though that's a lot of hardware for this, there does not appear to be any way to change the note. And this keyboard seems to be too late for the craze of boards with linear switches playing clicky sounds.
The terminal probably uses it for BEL (^G).

(If you dump the EPROM, please send a copy to Bitsavers for posterity.)

MMcM

25 Oct 2020, 21:58

I took the thumbwheels off and verified with a scope that they are not working.

Unfortunately, there aren't any contacts to be cleaned. It's opto-electric.
tek-wheel-pieces.jpg
tek-wheel-pieces.jpg (1.2 MiB) Viewed 167 times
The wheel rotates a sheet of plastic with alternate sectors transparent. A light-pipe carries white light so it shines down through this to photo-detectors below.

But the light bulbs are burned out. They look like grain-of-wheat. This is the days long before affordable LEDs other than red.

The bulbs is soldered in, but more importantly the housing is held by locking plastic rivets. So, basically, it was designed to replaced as an entire unit.
tek-wheel-bottom.jpg
tek-wheel-bottom.jpg (400.25 KiB) Viewed 167 times
I should be able to rig something up to confirm what the controller behavior is and get the converter able to support other boards. But barring a lucky surplus find this one may not be able to do it.

MMcM

31 Oct 2020, 03:29

Thumbwheel protocol was pretty much as expected: escape byte F1 for upper and F2 for lower followed by signed byte of amount turned.

The converter now supports this, though it's still an open question whether I'll be able to get the bulbs replaced on the board here.

Post Reply

Return to “Workshop”