VT100 converter for QMK without an extra UART

MMcM

29 Nov 2019, 07:44

I finally got to doing something with another of these old boards. The VT100 isn't a particularly nice keyboard; the VT52 had much more personality. I never used a DEC terminal as my daily one. But VT100s were everywhere, so the nostalgia value is still pretty high.

The hardware protocol is also very interesting. It's a 1/4" audio jack with three wires: +12, ground, and signal. The signal is bi-directional serial; both ways on the same wire, sometimes at the same time. This requires some open-collector drivers to compose and analog comparators to decompose.

It's all in the DEC schematics, which have been preserved. I just borrowed the relevant circuit straight — with the exact same resistor values.
vt100-basic-video_LI.jpg
vt100-basic-video_LI.jpg (468.78 KiB) Viewed 153 times
The very same borrowing was done by somebody's earlier effort and featured on Hackaday.

But they were concerned to replicate the timing and so their circuit has a 1MHz crystal and a classic 40-pin CMOS UART.

The UARTs used then and inside the AVR are designed to deal with small variations in timing. They take 16 samples and average. So there's a fair amount of wiggle-room. In fact, a complementary effort to build an interface from a modern USB keyboard to a VT100 terminal as an Arduino sketch just set the MCU's UART to 7867 baud, ignoring the clock PWM.

For my converter, I set a couple of the otherwise unused timers to generate 4µs and 8µs PWM. And set the UART's baud rate register to match. Since it all ultimately comes from the same I/O clock, everything should stay in sync.

It ends up looking like this:
vt100.png
vt100.png (28.07 KiB) Viewed 153 times
The signals are:
  1. receive
  2. transmit
  3. clock
  4. combined signal
and the serial ones decode just fine.

Zooming in, each serial bit takes 16 clock periods. And PWM has 75% duty-cycle for mark and 25% for space.
vt100-zoom.png
vt100-zoom.png (31.08 KiB) Viewed 153 times
For now the firmware in my fork.

And the hardware will, as always, need some cleaning up for putting into more permanent form.
vt100-proto.jpg
vt100-proto.jpg (416.16 KiB) Viewed 153 times

User avatar
OldIsNew

02 Dec 2019, 16:19

Very cool. Interesting background info too. I have a VT100 that I brute forced with a Teensy - it's nice to see approaches that actually keep the boards intact!

Post Reply

Return to “Workshop”