USB-teletype

From HeepyWiki
Revision as of 04:34, 17 March 2016 by Morris (talk | contribs)
Jump to navigation Jump to search

This is a compact USB to teletype current loop interface on a 1.6 by 1.4 inch pcb. It connects to a computer running Windows, Mac OSX, Linux, Android, or probably anything else via a USB Mini-B connector, and presents itself as a USB serial port, while the other end connects directly in series with a teletype loop. Data is relayed bidirectionally between the two. Unlike most USB serial adapters, it uses a general purpose microprocessor rather than a dedicated interface chip like FTDI, CP2102, etc. This allows features like onboard translation between ASCII and 5-level code, selectable auto-newline, unshift on space, and others.

Electrical

The circuit board is physically divided in half. The loop-interface side is 100% completely electrically isolated from the computer interface side. If operating the board without an enclosure, it is very important to insure that nothing conductive comes in contact with it that might bridge exposed contacts and potentially carry high loop voltage anywhere near your computer's USB interface. The loop side is protected against inductive spikes from selector magnets on the line, and should tolerate currents from <20mA to over 100mA. The loop current is sensed non-inductively by a 150 ohm, 2 watt resistor in series with the loop, which provides current to the input side of an opto-isolator. The output side is switched by another optical isolator with an on resistance around 34 ohms. Both input and output can be connected in any polarity. The device has separate connections for input and output, so it can be used in a full-duplex application with two separate loops, but for half duplex operation normally the two connector blocks would be jumpered in series. (they are also completely electrically isolated from each other.)

Software

On initial power-up, the interface's teletype side is set to 45.45 baud and will translate between teletype 5-level code (ITA-2, Baudot) and ASCII bidirectionally, so that from the point of view of the computer, it looks like a plain ASCII terminal. ASCII codes sent to the interface which have no teletype code equivalent are ignored and not forwarded. The interface keeps track of LTRS/FIGS shift and sends the appropriate shifts as necessary. On power up it assumes LTRS until it discovers otherwise. If unshift-on-space is enabled, it will switch to LTRS mode if it sees a space character on the loop side.

Pressing the SW1 button on the interface board switches the device into command mode, in which it ignores input from the teletype loop, keeps the output marking, and presents a command-line interface via USB to the computer. "help" shows available options and how to change them. Changes may be made on the fly and can remain temporary or be saved to permanent storage with the "save" command. If saved settings are present in permanent storage, they will be loaded and used automatically on power up. This way the device can be treated as transparent unless intentionally put into config mode.

Because