So you've got your hands on a late 1980s Minitel 1B (or something slightly later) and then you realize that the entire Minitel network shut down in 2012. What do you do? Well, obviously, you recall that the Minitel 1B (and other later models) have two modes of operation: using the modem to connect to the Minitel service or as a serial terminal via the "peri-informatique" port. With the latter you can use the entire thing as a serial terminal and connect it to something (such as a Raspberry Pi) and browse the web.
Note: there are other interesting modes (such as peer-to-peer Minitels) but I won't go into that here.
The peri-informatique port on the back of the Minitel is a five pin DIN socket which supports open collector TTL logic levels with up to 4,800 baud serial (later models supported faster transmission).
The pinout (note the ordering!) is pin 1 (RX), pin 2 (0V reference), pin 3 (TX), pin 4 (ready) and pin 5 (8.5V at 1A). With just three pins (1, 2, 4) it's pretty easy to put together a cable that turns the Minitel into a serial terminal.
And since the Minitel has an ASCII mode it'll work pretty well outside of its original Videotex format with the right combination of keys. It's important to have a Minitel with the FNCT key because it controls a lot of settings.
A simple test
A quick way to test that your Minitel is happy being in peri-informatique mode is to connect TX to RX in the DIN socket and see if characters get echoed to the screen. I did this with a small piece of paper clip connecting pin 1 (RX) to pin 3 (TX).
By default the peri-informatique port is active and so anything typed is sent out of it, and anything received is displayed. I like to set the display mode to US ASCII with FNCT+T followed by A (if you want a French version of ASCII use FNCT+T followed by F).
If you start typing you should see everything you type twice: once because you typed it and the Minitel echoed it and once because it got sent and receive through the piece of paperclip. To turn off local echo and just see what went from TX to RX, it's FNCT+T then E.
Assuming that worked then you're in good shape to turn this simple serial port into something that can be plugged into USB. For that you'll need a USB-to-serial adapter, three resistors, one transistor and a plug for the DIN socket.
USB-to-Minitel Cable
Before getting to the USB part of the connection it's worth taking an excursion through the details of the Minitel's serial port. The official documentation describes it as "compatible with TTL open collector" logic and gives the following constraints:
Firstly, we learn that logic level 0 is below 0.4V and logic level 1 is above 2.5V (and below 15V). If you look at the RX diagram on the top left you can see that when receiving a logic 1 (voltage greater than 2.5V) current may flow from the Minitel and should be below 150uA. You might be asking yourself why the receive signal would be a current source. That's standard TTL logic style.
In TTL logic inputs are typically the emitter of a transistor. Here's a
simplified TTL NAND gate. Notice how the inputs are emitters in a special double-emitter transistor.
Imagine the case where A and B are tied to ground (logic 0): current will flow through VT1 across the base-emitter junction and therefore out A and B. So, an input is a current source when driven low.
OK, great, but what does the Minitel actually implement since there are no TTL logic gates on the PCB anywhere near the serial port. I ran across a Minitel schematic on line that has the serial port circruit. Here's just the RX and TX part.
The TX part is the simplest. If the processor is transmitting a 1 then the 4069 hex inverter drives the base of the transistor low which means the transistor is off and the TX port floats. This is why in Pila's USB-to-Minitel connector they pull the TX line to 5V using a resistor:
If the processor wants to send a 0 then the base of the transistor T03 is pulled to 5V and so the transistor conducts (as the base-emitter of the NPN transistor is forward biased). This means the TX line is pulled low (via the transistor) and current flows into the Minitel. Nothing special there.
RX is a whole other kettle of fish. Not a transistor in sight but three resistors and two diodes. The two hex inverters serve to make sure that whatever signal they are presented with they bring it back to clear logic levels. We'll ignore them.
I am using
EasyEDA to diagram and simulate.
Receiving 0
Let's first imagine the scenario where we are transmitting a 0 into the Minitel and pull the RX line low. This looks like:
V1 is the system power (5V), V2 is the voltage source for whatever is connected to the Minitel's serial port. XMM4 measures the voltage presented to the two inverters.
So, with S1 set to pull the RX input to ground the inverters get 1.165V which they will interpret is low. Great. But why 1.165V?
Let's go component by component. D4 is reverse biased and therefore doesn't conduct and does nothing. D3 is forward biased and so current flows through D3/R3 to the RX pin. So, when the Minitel receives data it may source current.
R1 and R2 form a
voltage divider which creates precisely 1.165V and also current can flow through them too.
Receiving 1
When receiving a 1 the RX line needs to be set between 2.5V and 15V according to the documentation. Let's analyze some different voltages presented on RX.
We'll start with 2.5V. This is very similar to the 0 case above. D4 does nothing, current flows through D3/R3 out the RX pin and R1/R2 form a voltage divider this time giving a voltage of 3.082V. The inverters see that as high and all is well.
How about 15V? Things are slightly different. D3/R3 does nothing as the diode is reverse biased. D4 is now forward biased and conducts, clamping the voltage presented to 5V + the diode forward voltage (which is about 0.5V). If you check the datasheet of the 4069 inverter it says that its input voltage can be Vdd + 0.5V so that diode keeps voltages in range.
There's no equivalent diode clamping negative voltages, which is a little odd as the 4069 will only accept down to -0.5V. Perhaps it's unnecessary because negative voltages are illegal in France or something.
Finally, what happens if you just let the RX input float and don't connect it at all? This is important for Pila's design. It works fine because R4 pulls up the output to 5V.
Great, so Pila's design makes total sense and works in the real world.
You'd think the story would end there but I couldn't read the value of R01 in the scan of the schematic so figured I'd go look at the actual motherboard and find that resistor. At this point I discovered that my Minitel didn't correspond to the schematic at all. At first I thought I spied the resistors and diodes here:
But that's a 220k resistor not 270k and careful following of the traces (under ultraviolet light for clarity) revealed that the RX circuit is:
A classic PNP switch. Pull it down to turn the transistor on, pull it up or leave it floating otherwise. The TX line is very similar to the schematic.
So, finally, I have satisfied myself that Pila's design makes sense.
Narrator: he could have just built the thing and not obsessed over it.
Using the USB-to-Minitel cable
So, I built the thing and here it is:
You could read all about it on Pila's blog but there's a male DIN connector which I've stuffed all the components inside and a USB to serial converter. Pila suggests opening the connector to verify the colours of the connectors so that RX and TX don't get confused. I am very grateful to the person who laid out the tiny PCB inside the USB connector for labelling everything:
I managed to stuff the transistor and three resistors inside the DIN plug itself as Pila suggests. Tight fit and a bit of heatshrink for insulation.
Once done I tried talking to the Minitel using Python miniterm.py (usually my tool of choice for stuff like this) and saw the following on screen:
If you instantly recognize that the reason a, d, g, h, h, m, n, ... are appearing as blocks is because I've got the wrong number of bits set for the serial transmission then you are a giant nerd. The Minitel is expecting 7 bits plus even parity. Since the top bit for all those characters is 0 for some of the letters the parity will be "correct" but for those characters which have an odd number of 1s in their binary version the parity is wrong and the Minitel displays a white rectangle.
To really use the Minitel as a terminal I plugged it into a Raspberry Pi and it appeared as /dev/ttyUSB0:
stty -F /dev/ttyUSB0 1200 istrip cs7 parenb -parodd brkint \
ignpar icrnl ixon ixany opost onlcr cread hupcl isig icanon \
echo echoe echok
On the Minitel you can change the baud rate with FNCT-P. Followed by 4 you get 4,800 baud; followed by 1 you get 1,200 baud.
And it works. To test it I visited
jgc.org using lynx: