Page 1 of 1

Convergent Technologies and Negative Serial

Posted: 25 Dec 2019, 20:29
by MMcM
Converting this keyboard with lots of early '80s styling:
convergent.jpg
convergent.jpg (314.46 KiB) Viewed 734 times
  • Metal case
  • Giant coiled cable
  • Big bezel (okay, medium for the time)
  • Green navigation legends
  • Stepped keycaps for some of these (but not for Lock)
  • Some odd action verbs (even including ACTION itself)
  • Eight keys with led indicators
  • Lowercase f-key legends
  • ¢ ½
It uses Micro Switch SD-series switches and so feels pretty good. HaaTa has one, but with a couple missing keycaps; this is complete.

All the tech specs are online, even a schematic. The only snag is that it uses negative polarity (idle low) TTL serial for the two communications lines.

The Sun keyboards were like that, too. The easiest way to deal with it is just bit-bang the serial protocol; it's only 1200 baud (Convergent is 1221, but close enough). That's what the QMK converter does. But it seems unsatisfying to waste the MCU's UART.

Second choice is add an inverter. That's what I did with my Sun keyboards some years ago after looking at the TMK predecessor of that one. (Honestly, now that the QMK build modularity is a lot better, I could probably just customize some macros to use UART serial and flash the QMK code onto my existing hardware, letting me retire another repo.)

In the meantime, the newer Teensy's with 32-bit ARM have UARTs with control registers to invert serial on chip. The Teensy LC (Cortex-M0) is even cheaper than the classic 2.0. Unfortunately, it's a non-starter because the I/O pins aren't 5V tolerant. But the Teensy 3.2 (Cortex-M4) is and that's what's on the Perma-Proto in the photo.

There don't seem to be any examples of using serial with ChibiOS in QMK. Moreover, there don't seem to be any working examples of using serial with ChibiOS period. There are lots of snippets in the forum, where the author also appears to be super-responsive. So, in the end, some experimentation and inspection of the source was needed.

The Kinetis contributed port of ChibiOS has a fairly minimal serial HAL layer. It doesn't expose the polarity registers, so they have to set by hand and not in the SerialConfig.

It took a while of nothing working to figure out that one must mux the UART pins explicitly through the PAL module. In Teensyduino, this just happens in Serial1.begin. But in ChibiOS, sdStart only configures the UART itself. (It also took a while to figure out that leaving INIT- unconfigured was a bad idea instead of actually driving it high.)

The working result is here.

Re: Convergent Technologies and Negative Serial

Posted: 30 Dec 2019, 19:17
by MMcM
Another project where I find myself wanting a slightly more powerful UART.

A Micro Switch ST-series board from 1987.
sc-37225-top-2.jpg
sc-37225-top-2.jpg (434 KiB) Viewed 605 times
The keycaps are dye-sub and if it weren't for those APL legends (and proofreader's Insert and Delete and randomly stepped keys), I probably would have given this one a pass.

It has the usual Honeywell SC-23181 decoder for the membrane matrix. Its choice of an Intel MCS-48 processor is an 8048.
sc-37225-bottom-2.jpg
sc-37225-bottom-2.jpg (356.63 KiB) Viewed 605 times
I have no idea what this board belongs to; this particular one looks to have been a spare and never used. Searching for the various catalogue numbers doesn't turn up anything, either. Does anyone recognize it?

There is an 8-pin ribbon connector with one pin broken off and two pins both labeled 6. That goes to ground; maybe one connector was meant for the chassis and another for the terminal's ground. Another pin is Vcc. Two come from a buffer: those must be the outputs. One goes to a Schmitt trigger inverter and has a pull-up resistor. And the last to one of the 8048's control pins. The remaining IC is a one-shot.

Focusing on the outputs, here is the A key.
a-key.png
a-key.png (27.1 KiB) Viewed 605 times
And here is the B key.
b-key.png
b-key.png (27.04 KiB) Viewed 605 times
That kind of looks like the PS/2 protocol: a clock that goes low for each bit. A start bit that is always high and eight data bits. But no stop bits. Which is too bad. One can decode PS/2 using an AVR's UART in synchronous external clock mode. But there is no way to configure it for zero stop bits (since that doesn't make sense for async mode -- how would you start looking for the next start bit).

So this will have to done in the converter code.

As far as I can tell, the second byte is always zero.

The scan codes are arranged logically: digits 20-29; letters 60-79; F-keys 40-4B; special actions (mostly) 50-5F.

Only the shift keys send break codes (high bit set). The two shift keys are distinguished, but not the two alt keys. I suspect this was to keep the shift mask in 4 bits. The 🔒 key sends a make when pressed and a break when released, just like the other shifts. Which really isn't that great for a shift lock. Maybe it was supposed to be a physically locking key? Anyway, I mapped it to control, since that is needed.

The Silent Tactile isn't silent at all because there's a buzzer and the non-shift keys click. Though there is a volume pot. And it might be possible to turn it off in software; I haven't worked out anything about what the terminal can send the keyboard. There aren't any LEDs, so it isn't super important. Of the Option DIP switches, I can only see an effect from two of them. Both cause action keys to invert the ALT prefix: one for the CLEAR key and the other for PA1 and PA2.

Working version here.

Re: Convergent Technologies and Negative Serial

Posted: 30 Dec 2019, 19:51
by purdobol
Don't know what to say really... other than great job and keep it up!
This stuff is way to advanced for me :mrgreen:

Re: Convergent Technologies and Negative Serial

Posted: 31 Dec 2019, 01:23
by XMIT
Neat! I'm tempted to dig out a couple of boards out of storage to see what sort of protocol surprises they hold...

Re: Convergent Technologies and Negative Serial

Posted: 12 Apr 2020, 03:29
by MMcM
Another converter where most of the work is dealing with voltages: the DEC LK201 / LK401.

The keyboard needs 12V power and the signals are 4800 baud RS-423.

I decided to do it two different ways.

First is copying the circuits in the keyboard itself or the VT-220 terminal it plugged into. The schematic for the keyboard is at http://bitsavers.org/pdf/dec/terminal/l ... _Oct83.pdf (page 16/21) and for the terminal at http://bitsavers.org/pdf/dec/terminal/v ... _Aug83.pdf (page 5/17).

A uA9639 differential receiver converts RX.

A uA9639 driver converts TX. It needs Vcc+ (+12V) and Vcc- (-12V). This can be gotten from the same 12V power source using a DC/DC dual output converter like the RB-1212D.
lk201-teensy-20.jpg
lk201-teensy-20.jpg (670.75 KiB) Viewed 368 times
Second is taking advantage of the serial levels being sufficiently compatible with RS-232, for which there are simple all-in-one converters such as the MAX232.

One additional advantage of this approach is that by using a 3V converter, such as MAX3232, a Teensy LC MCU can be used.

12V is used solely to power the keyboard.
lk201-teensy-lc.jpg
lk201-teensy-lc.jpg (261.76 KiB) Viewed 368 times
QMK WIP.