4
\$\begingroup\$

I'm attempting to build an interface for a 1985 IBM typewriter keyboard. This is interesting because it's bidirectional --- the keyboard has a screen on it. I was expecting some variation of XT or AT protocol, but it's really not.

There appear to be two wires which are used; one is clearly a reset line and is of no further interest; and the other is used for all data transmissions. There is no clock wire.

enter image description here

So far I've observed:

  • data transmission is in short packets, probably bytes. One is pictured above. Each one is prefixed with a much higher frequency prologue sequence. I've observed at least two kinds. (Keyboard→machine and machine→keyboard?)

  • looking at it on the scope, the leading edges are very sloppy, but trailing edges are sharp. If I assume that only the trailing edges are the ones of significance, but the sequence pictured only has five, which isn't enough for a simple time-between-trailing-edges protocol.

  • the pulse width is very approximately 100us, meaning the protocol runs at 100kHz-ish, which seems reasonable. The short pulses are about 20us from trailing edge to trailing edge.

  • (new) Taking a logic analyser trace without the keyboard attached shows that the base station is sending the initial high-frequency sequence and then waiting for a response. This suggests that the protocol is polled and controlled from the master end.

  • (new) In the trace below, there are four timings: high intervals can be 45us or 67us. Low intervals can be 54us or 44us. This doesn't add up neatly to simple async mark/space bits.

  • (new) There's no high-level timing structure I can see --- i.e. no sequences which look like packets or frames. The only communication is a constant stream of sequences like the one below. (newer) This actually turns out to be wrong. There are some multi-packet sequences, mostly in startup and initialisation; I was just looking in the wrong place. I'm not sure they help to identify what this is, however.

I wasn't expecting anything quite this... odd. It's certainly not any of the one-wire protocols I've encountered before. I've double checked that there isn't a clock wire hidden away anywhere. Any ideas?

(As an aside, none of the ICs on the keyboard are identifiable! Mysteriously so, in fact. There's a chip with the TI logo with a number starting with SH, which is not Texas Instruments' IC prefix (SN)? Likewise, a National Semiconductor chip with an NK code (should be DM/LM/MM)... even the MCU just says it's an Intel 'PI M A'. Picture attached.)

enter image description here

\$\endgroup\$
12
  • 1
    \$\begingroup\$ Very interesting! Would you share a picture of the board and device anyways? And maybe the scope traces for some specific ASCII chars (for instance space, zero, 9, @, a, e, z)? \$\endgroup\$
    – datenheim
    Commented Jan 25, 2023 at 21:43
  • \$\begingroup\$ I've uploaded a picture. Sadly I can't produce traces on demand --- there's constant traffic no matter if I'm pressing any keys or not. Polling, maybe? \$\endgroup\$ Commented Jan 25, 2023 at 22:12
  • \$\begingroup\$ Also, one really interesting thing I've just noticed... the top numbers on the two chips on the left are 4767634 and 4767635; but one's Motorola and the other's TI! I always thought that was the batch number. I wonder if IBM had all of these made specially with non-standard markings. \$\endgroup\$ Commented Jan 25, 2023 at 22:13
  • \$\begingroup\$ How sure are you that the data transfer is bidirectional? For example, an input device with a screen could use it for local feedback, and data exchange with the larger system could still be unidirectional. Of course being bidirectional is possible, I just don't believe having a screen is proof unless data from the larger system actually ends up on the screen. \$\endgroup\$
    – Ben Voigt
    Commented Jan 25, 2023 at 22:22
  • \$\begingroup\$ @DavidGiven The IC marked 4767635 looks like it's from National Semiconductor, not TI. Compare the logo to this image. \$\endgroup\$
    – Velvet
    Commented Jan 25, 2023 at 22:27

2 Answers 2

3
\$\begingroup\$

Figured it out, thanks to some help from someone on Reddit --- it turns out that I was dramatically overthinking things!

It's just a simple UART connection, at about 190kbaud. It's either 8n1 with some undetermined parity bit or 9n1. It's strictly master-slave; the master (the base station) sends a byte and then the slave (the keyboard) responds with another byte, rinse and repeat. Those 'fast pulses' are actually the command byte sent by the master. The things which I thought were bits are 0x000 and 0x100, depending on the length. The sequence above is the base station querying the keyboard for status and the keyboard replying with 0x100. The only difficult part is determining the baud rate, as low bits tend to be about 5.75us long, but high bits are 5us --- maybe it's bitbanged?

And that's all there is to it. The higher-level protocol is more complex but I'm making progress. I suppose the moral is that things are frequently more boring than they seem!

\$\endgroup\$
2
\$\begingroup\$

Maybe something like SDLC (or some variant) implemented with open-collector outputs for half-duplex over a single wire.

There were some MCS51 MCUs of that era made with on-chip SLDC controllers. The chip arrangement is suggestive of that kind of architecture, perhaps with external OTP EPROM as the TI chip.

\$\endgroup\$
3
  • \$\begingroup\$ Isn't SDLC a synchronous interface, Synchronous Data Link Control, which requires an accompanying clock? So two wires/signals? \$\endgroup\$
    – SteveSh
    Commented Jan 26, 2023 at 0:57
  • \$\begingroup\$ @SteveSh You'd think so from current usage of the term synchronous, but synchronous here refers to time-based signals. It's used with modems, so no clock. \$\endgroup\$ Commented Jan 26, 2023 at 1:28
  • \$\begingroup\$ Tentatively, I'd have to say it doesn't look like SDLC. There doesn't seem to be high-level framing and the start sequence is completely unlike the traces I've found for SDLC. \$\endgroup\$ Commented Feb 1, 2023 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.