Pinout & Soarer's logic analyzer - Tatung Terminal

User avatar
Bjerrk

10 Jul 2021, 12:55

In this post I'll look at how to get an "unknown" Tatung terminal keyboard up and running.

WheyBags generously sent me this wonderful keyboard:

Image

Thanks man!

In his give-away thread, he wrote:
wheybags wrote:
26 Jun 2021, 14:09
Unidentified terminal board

MX black switches, not sure what kind of terminal it is for, the connector doesn't fit my VT420.
My preference would be to give it to someone who won't just desolder the switches, but at the end of the day it has to go to someone.
Fair enough! Let's see what we can do.

First, the closest thing I could get to a model sticker:

Image

Seems like it may have been produced for the Dow Chemical Company!

I'll just transcribe the sticker information here, so that someone may be able to find it using a search engine:
Tatung Co.
U.L. NO. C1250
P/N: 5733112001
DATE: 79.3.20 (That cannot mean 20th of March 1979, surely ... Cherry hadn't even introduced MX switches then. )
M.M.N. E54680
DOW. CHEM. USA
M/D. 6075 (P.S)
FACTORY: 9216
As you can just about see in the photo, is uses some kind of RJ12 plug. Opening up the board, we see that it has 6 pins, as one would expect from the plug:

Image

Now, this is where it gets interesting. A priori, I had no idea what to expect when it comes to pinout and protocol. I wasn't even sure if it would be 5V or something more exotic.

In order to determine the pinout, let us first identify the ground (GND) and VCC pins.
We begin by looking at the PCB traces:

Image

Clearly, the left-most and right-most pins are connected to large traces which seem to reach all the integrated circuits (ICs). This should be a hint that these two pins are VCC and GND, but we do not yet know which is which.
In order to figure this out, let's take a closer look at the main IC - the Intel P8049AH that you can see in the top of this shot:

Image

Looking at the datasheet, one can quickly see that Pin 1 is VCC and Pin 6 is GND, since they connect to the VCC and VSS pins on the IC:

Image

So far, so good! We still have no idea what protocol this thing speaks, and we only know the function of 2 out of 6 pins.
However, we can immediately reduce the amount of work a bit: looking at the PCB above, pin 3 doesn't actually seem to have any traces associated with it. So it seems reasonable to ignore it.

There are thus tree "unknowns" left: Pin 2, Pin 4 and Pin 5. At this point, one could of course try and throw all the keyboard firmware one knows on a Pro Micro and try all combinations of firmware and pin configurations. But that quickly gets unwieldy, and I wish to take the time to do this systematically, so that hopefully the approach can be helpful to someone else.

What we want to do is use a Logic Analyzer to explore the signals coming from the keyboard. Isn't that a specialized piece of equipment that costs a lot of money? Nope! Thanks to Soarer, who developed a Simple Logic Analyzer that you can simply load onto a Pro Micro or Teensy. It seems to me that this piece of software is a bit overlooked, so let me just advertise it here. It's great!

We thus load Soarer's sctrace firmware on to a Pro Micro and wire it up to the keyboard. We make sure to wire VCC to Pin 1 and GND to Pin 6, but for the rest of the pins you can wire them essentially how you like. Just wire them onto some combination of the pins labeled 2, 3, TX0 and RXI on the Pro Micro (these are the pins labeled PD0-3 on a Teensy).

Image

Having done this, we run the Teensy hid_listen programme and plug in the Pro Micro. This is then the output I get when holding down the spacebar for a short while:

Code: Select all

Waiting for device:...
Listening:
sctrace v1.01
0009FF1 0009FF1 84BBFE0 855CFC0 878EFE0 88CFFF0 89BCFD0 8BEEFF0 8D2CFE0 8E1BFC0
904EFE0 927BFC0 94AFFE0 95EEFF0 96DBFD0 9910FF0 9A4BFE0 9B3BFC0 9D6EFE0 9EAFFF0
9F9CFD0 A1CEFF0 A30BFE0 A3FBFC0 A62FFE0 A85BFC0 AA8EFE0 ACBBFC0 AEEEFE0 B02FFF0
B11BFD0 B34EFF0 000AFF1 0009FF1 D7D9FE0 D87AFC0 DAACFE0 DBECFF0 DCDAFD0 DF0CFF0
E049FE0 E139FC0 E36DFE0 E59BFC0 E7CCFE0 E90CFF0 E9FAFD0 EC2CFF0 ED69FE0 EE5BFC0
F08CFE0 F1CCFF0 F2B9FD0 F4ECFF0 F629FE0 F719FC0 F94CFE0 FB79FC0 FDACFE0 FFDAFC0
0009FC1 020CFE0 034CFF0 0439FD0 066DFF0 000AFF1 0009FF1 BB08FE0 BBA7FC0 BDDAFE0
BF1BFF0 C008FD0 C23AFF0 C377FE0 C467FC0 C69AFE0 C8C8FC0 CAFAFE0 CC3AFF0 CD28FD0
CF5BFF0 D097FE0 D189FC0 D3BBFE0 D4FBFF0 D5E9FD0 D81BFF0 D957FE0 DA49FC0 DC7AFE0
DEA8FC0 E0DAFE0 E308FC0 E53AFE0 E67AFF0 E767FD0 E99BFF0 000AFF1 0009FF1 9E0EFE0
9EADFC0 A0DFFE0 A220FF0 A30DFD0 A53FFF0 A67DFE0 A76DFC0 A99FFE0 ABCEFC0 ADFFFE0
AF41FF0 B02DFD0 B260FF0 B39DFE0 B48DFC0 B6C1FE0 B800FF0 B8EDFD0 BB22FF0 BC5DFE0
BD4EFC0 BF7FFE0 C1ADFC0 C3DFFE0 C60DFC0 C83FFE0 C980FF0 CA6DFD0 CC9FFF0 0009FF1
000AFF1 8114FE0 81B2FC0 83E5FE0 8527FF0 8613FD0 8845FF0 8984FE0 8A73FC0 8CA5FE0
8ED2FC0 9105FE0 9246FF0 9333FD0 9565FF0 96A4FE0 9792FC0 99C8FE0 9B07FF0 9BF2FD0
9E28FF0 9F63FE0 A052FC0 A286FE0 A4B2FC0 A6E5FE0 A912FC0 AB45FE0 AC87FF0 AD72FD0
AFA5FF0 0009FF1 000AFF1 63F0FE0 6490FC0 66C3FE0 6804FF0 68F0FD0 6B24FF0 6C60FE0
6D50FC0 6F84FE0 71B2FC0 73E3FE0 7523FF0 7610FD0 7844FF0 7980FE0 7A70FC0 7CA3FE0
7DE3FF0 7ED1FD0 8103FF0 8241FE0 8331FC0 8563FE0 8790FC0 89C3FE0 8BF0FC0 8E23FE0
8F64FF0 9050FD0 9283FF0 0009FF1 0009FF1 46F7FE0 4797FC0 49C9FE0 4B0CFF0 4BF6FD0
4E2AFF0 4F66FE0 5056FC0 5289FE0 54B6FC0 56EAFE0 5829FF0 5916FD0 5B49FF0 5C86FE0
5D76FC0 5FA9FE0 60EAFF0 61D6FD0 640AFF0 6547FE0 6636FC0 6869FE0 6A97FC0 6CC9FE0
6EF7FC0 7129FE0 7269FF0 7356FD0 7589FF0 0009FF1 0009FF1 2A24FE0 2AC4FC0 2CF8FE0
2E37FF0 2F25FD0 3159FF0 3294FE0 3384FC0 35B7FE0 37E5FC0 3A18FE0 3B57FF0 3C44FD0
3E77FF0 3FB4FE0 40A5FC0 42D8FE0 4417FF0 4504FD0 4737FF0 4874FE0 4966FC0 4B97FE0
4DC4FC0 4FF7FE0 5225FC0 5458FE0 5598FF0 5685FD0 58B8FF0 000AFF1 0009FF1 AF31FE0
AFD1FC0 B207FE0 B431FC0 B664FE0 B891FC0 BAC5FE0 BCF1FC0 BF24FE0 C151FC0 C384FE0
C4C4FF0 C5B1FD0 C7E4FF0 CA12FD0 CC44FF0 CE72FD0 D0A4FF0 D2D1FD0 D504FF0 D731FD0
D964FF0 DB91FD0 DDC6FF0 0009FF1 1F61FE0 2002FC0 2234FE0 2374FF0 2461FD0 2694FF0
27D1FE0 28C1FC0 2AF4FE0 2D21FC0 2F54FE0 3095FF0 3181FD0 33B4FF0 34F4FE0 35E1FC0
3814FE0 3955FF0 3A41FD0 3C75FF0 3DB1FE0 3EA2FC0 40D5FE0 4301FC0 4534FE0 4761FC0
4994FE0 4AD4FF0 4BC1FD0 4DF4FF0 000AFF1 000AFF1 
What a load of gibberish! But this is where Soarer's logic analyzer software come in. We save the above into an ordinary text file and then run Soarer's scla.exe. I should mention here that it runs flawlessly in Linux under WINE, but requires that you place MFC71.DLL in e.g. the program's own directory (this is some sort of Visual Studio 2003 DLL, I believe).

If you then open the text file in Soarer's analyzer, you'll see something like this:

Image

if you had instead held down the 'a' key this would have been the output:

Image

You can see that I have wired up the pins such that they show up in the "Clock" and "Data" channels, but this has no significance - it's just labels. However(!), we can now actually begin to see what the keyboard's protocol is like. There's clearly a channel which outputs a different signal according to which key is pressed. That sounds like data! And there's a channel which outputs a steady, timed oscillating signal. That does indeed sound like a clock signal! Could this simply be a good old XT/AT protocol board in disguise?

To find out, we repurpose the Pro Micro and load it with either Soarer's converter or Hasu's TMK IBM PC converter. Lo and behold, it was! I am typing this sentence on the keyboard, and it is pretty damn nice!

The next step for me would be to write down a keymap for TMK which takes advantage of all the funny keys this board has. I'll let you know when I get around to it! In any case, I hope the general methodology/walkthrough will be useful to someone, even if this keyboard turned out to speak a rather common protocol.

For future reference, the pinout is:

Code: Select all

Pin 1: VCC
Pin 2: Clock
Pin 3: --
Pin 4: Data.
Pin 5: -- 
Pin 6: GND
I'd like to thank WheyBags for the keyboard and an_achronism for help with determining the pinout.

User avatar
wheybags

11 Jul 2021, 17:58

Awesome stuff! Really glad this went to someone willing to put in the time and effort to get it up and running :)

Post Reply

Return to “Workshop”