It's a long time we haven't seen the five bit
Baudot teletypes and I'm taking advantage of the Coronavirus shelter-in-place to finish
some loose end projects. And one of them was a suggestion that we should connect this to a
modern machine, maybe a Linux one. As you might remember from the restoration over a year ago this
model 15 teletype is an entirely mechanical device which was introduced in 1930. It was very
popular until the 1960s, used for military communications and commercial telex service. On
the transmit side it uses a rotating contact to encode the bits. On the receive side it uses
a mind-bogging-ly clever mechanical system driven by an electromagnet to decode the
bits and print them onto the roll of paper. The transmitted contact and receiver magnet are
linked by a line driven by a high voltage to overcome the wire resistance, usually around 120
volts, and running at 60 milliamps current. The scheme is called a 60 milliamp current loop. As
primitive as it looks, it can transmit reliably for many miles. This of course predates ASCII
coding by a very long shot. Instead it uses the earlier Baudot coding with only 5 bits, at the
very pokey rate of only 45.5 bits per second or Bauds as it became known. So at first blush, it
is rather incompatible with modern computers. First thing is to make a circuit that goes from
the 60 milliamp high voltage current loop to a regular 5-volt logic and what I like in this
circuit I got on the Interwebs is that it takes care of the polarity. This is the low voltage
and digital signal. You light up your little LED in your opto-coupler, it's basically a modern
equivalent of a relay, it's a solid state relay. And a voltage clamp to get rid of the relay spikes
that will invariably come back and ruin your opto isolator. I like the receiver circuit too and it
cleverly puts a full bridge rectifier so you are not sensitive to the polarity of the loop. And
same thing, opto-isolator and off you go to the 5 volt circuitry. Except they had two mistakes in
it and that can't be a 100 Ohms - 100 Ohms with a 120V on it will definitely fry your opto-isolator.
And here also the resistor is in the wrong branch of a transistor. And here's the circuit. You
see the transmit with the polarity insensitive opto-isolator and the 120 volt TVS and in the
receive section you have the power resistor, the full-bridge bridge rectifier, the
1k resistor - and not the 100 Ohms - the simple opto-isolator and the resistor in the
right branch of the circuit. And out it comes: plus minus 5 volts, Rx and TX. I wanted to give
it the a whirl and try it on the Teletype here. Except that I need a source of 5-bit 45.5 Bauds
and I haven't made that contraption yet. But i have the HP 8018 serial data generator.
So what this antique instrument can do, is generate a serial bit stream. And you have
a giant memory of 2 K bits. Let's do a 1 bit pattern. Load word. Here is our bit. I
can add another bit. Here are 2 bits. And let's send [it] out to the teletype. So okay my interface works, let's write some
modern Arduino stuff. So my job here is to make a contraption that takes regular
ASCII eight bits on one side and spit out some Baudot bits on the other side. I
usually put the hardware I built over here, or I will put my interface, [but] it's
already taken out, it's already put in a box. And on the software side I use the
Eclipse IDE and I program the devices in straight C. I don't use at all the Arduino
stuff, which gives me more control. And in particular the trick here was to slow down the
Atmel enough so it could do baudot at 45.5. It turns out [that] the Atmel chip supports 5
bits, but to get it to go down that slow, you have to go into the fuses and flip this little
one here that says "divide clock by 8 internally". So this bit is on and instead of having your
standard Arduino running at 16 megahertz, it divides it internally down to 2 megahertz and
that's slow enough to cover all the way down to 45.5 Bauds. I put the Arduino and the interface
in a blue box and wired it to a front panel. Okay, demonstration! So I use the USB either
as an input or for power, actually it does both .Then also put the serial port in
it. Here I have my high voltage supply for the loop. And I'll put myself in
half duplex, power in, here we go. Okay, it's on. If I turn to over here, let me
make a terminal. And it's using - I think I am on COM4. You want to turn Xon-Xoff if you send
big files. All right so now we type on this. And it goes back to the other end. And notice that it has a lot of buffering. And the extra feature I have added is lowercase
mode. Of course the original UNIX did support all caps - heck, that's how it was developed, on
ASR 33 Teletypes - but this feature seemed not to be functional in modern distributions.
Although the -U option is still there, it sure didn't work. And for the
occasional capitalization I need, what I elected to do is to use the blank
key as a prefix. Let's do CuriousMarc and I'll capitalize CuriousMarc. So, I'll
do blank c-u-r-i-o-u-s blank m-a-r-c and of course here it's all caps, it's the
only thing it can do. But on the receive side it did capitalize it properly. So were these
modifications I think I can log into Linux. So here's the setup: on the right it's my Dolch which
has booted an old version of Linux. Now the box is set up in full-duplex. The transmit, which is
powered by this box, and the receive comes to this other box, because I have to power the receive
loop separately. Since it's not half-duplex, there are two independent loops. So they are both
connected to my high [voltage] supply. Now it powers two loops so I have 120 mA instead of 60.
Okay. And actually if I turn this on, that should be OK. So, that where we need the Linux-Fu to come
in, and I always get it wrong. I have two serial ports ttyS0 and ttyS1, and I'm on S0 I believe. So
it would be set TTY dash F slash /dev/ttyS0 9600. And I want xOn Xoff, so ixon ixoff. So now I
have to generate a login shell so sbin/agetty, "Alternate Get TTY". ttyS0. I'm
gonna tell it what type of terminal, I'll try tty33 which is ASR 33. That should do
it. I put myself in lowercase mode here. So... We have a shell prompt!
That's where we'll see if my lowercase trick works. Cannot possibly work without effective root? Ah, I have to do sudo. Okay, all right, almost
there. sudo, Super User do, okay. Try it again. Allright, try again. USER. Okay, doesn't echo my password,
that's correct. Oh we're in! Oh no, it's going to give a disclaimer.
It's going to take forever at 45.5 Bauds. All right! So I should have a computer at the
other end of this old mechanical contraption. So. Oh, let's do UNALIAS LS, because I know this
distribution does color by default, which will give me all all the extra characters I don't want.
So do LS, let's see what's in this directory. Okay. So what can you do? Well, probably not
very much, because you can't do any programming, because you don't have even - there's
no plus sign, there is no equal sign, there is no backlash, so you're really really
limited in what character you can input into this thing. But I could do a little bit of single
line editing. Let's try it. Let's do ED. ED, okay, single line editor. This - no. Append. There
we go. And I go second line. So ED being the original editor for Teletypes, one line at
a time. And to get out of it it's FIGS-dot, I have to go back to LTRS, or
I'll forget. All right. And now I want to change the second line, so
I would go to line two. FIGS 2 LTRS "At the teletype". Now I want to change it,
I do C. Then I do CAT TEST. It works! Can you imagine developing the whole Unix system line by
line on the line editor? Now those guys deserve a medal. What people used to do a lot is print
ASCII art. They are very nice, takes forever to print though. ROADRUNNER. And here is Roadrunner
and my whole Unix session. There! Not that it's useful or anything, but it can be done:
a 1930 Baudot teletype as a terminal for Linux. Alright commenters: I think have
done it, and don't miss the next episode as we might well try to connect to
Linux using Morse code this time.