-
Notifications
You must be signed in to change notification settings - Fork 14
SW_DevCH340TTY
Using an adapter board (or adapter cable - for V.10) based on the chip CH340 the device is detected as normal (virtual) serial interface. In Windows the device is shown as COMx:. In Linux it is often shown as /dev/ttyUSBx (may vary depending on the OS version...). With the Python library "PySerial" all necessary settings can be done to handle 50 baud, 5 data-bits and 1.5 stop-bits. Also, the handshake pins RTS and DTR can be set by this library.
The TTL output signals of the CH340 PCB can drive some interface hardware for a TW39 / TWM / V.10 / EDS teleprinter. Examples can be found here.
Caution
There are several USB/Serial adapters that use different chips. Be aware that ONLY adapters with CH340 chip are compatible with this project. Only the CH340 chip supports a baud rate of 50 Bd!
| System | Comments |
|---|---|
| RPi | OK |
| PC Linux | OK |
| PC Windows | OK |
| Mac | OK |
| Python Module |
Install | Anaconda |
|---|---|---|
| pyserial | pip install pyserial | conda install pyserial |
USB-Serial-Adapter (CH340-chip) with base teletype (without dialing device):
-Y TTY
--tty TTY
USB-Serial-Adapter (CH340-chip) with TW39 teletype (pulse dial):
--ttyTW39 TTY
USB-Serial-Adapter (CH340-chip) with TWM teletype (keypad dial):
-M TTY
--ttyTWM TTY
USB-Serial-Adapter (CH340-chip) with V.10 teletype (FS200, FS220):
-V TTY
--ttyV10 TTY
./telex.py -W COM3$ ./telex.py -W /dev/ttyUSB0| Param | Default | type/range | Description |
|---|---|---|---|
| mode | "TW39" | "TW39", "TWM", "V10", "EDS" | "TW39": current loop / Number Switch Dial "TWM" : keypad Dial, "V10" : FS200/FS220 mode "EDS" : ED1000 ""(empty): disable hardware handshake |
| portname | "/dev/ttyUSB0" | string | serial port used (COMx: in Windows) |
| baudrate | 50 | 50, 75, 100 | baud rate |
| bytesize | 5 | 5, 6, 7, 8 | number of databits |
| stopbits | 1.5 | 1, 1.5, 2 | number of stopbits |
| coding | 0 | 0, 1, 2, 3 | 0: ITA2 = CCITT2 1: US 2: MKT2 3: ZUSE (see txCode.md) |
| loopback | true | false / true | if true, sent characters are removed from receive buffer |
| loc_echo | false | false / true | if true, echo back all characters received from teleprinter |
| inverse_dtr | false | false / true | If true, use inverted signal |
| inverse_rts | false | false / true | If true, use inverted signal |
Tip
With mode set to any explicit value e.g TW39 or TWM, the module uses hardware handshake to control the TTY equipment connected to the matching interface hardware, to switch to WB mode, to A or Z mode.
Leaving modeempty, i.e. defining "mode": "", lets the module assume that there is no equipment with AT or ST button connected. The AT and ST buttons can then be emulated by special keystrokes at the teletype:
| keystroke | button |
|---|---|
| 5x Zi (Figs) | AT |
| 5x Bu (Ltrs) | ST |
# Module type "CH340TTY"
# requirements: pyserial (Linux: sudo apt install python3-serial)
# TW39 or V10 teletype over USB-serial-adapter with CH340 chip or UART which supports 50 Baud
"CH340TTY": {
"type": "CH340TTY",
"enable": true,
"portname": "COM5", # Windows:"COMx" Linux:"/dev/ttyUSBx"
"baudrate": 50,
"mode": "TW39",
"coding": 0,
"bytesize": 5,
"stopbits": 1.5,
"loopback": false
},
To decode the TW39 protocol correctly, it is necessary to detect a permanent low and high level on the RXD pin. Neither the CH340 chip nor the drivers drivers can handle that. The hack is to use a separate input pin (CTS) to detect the state of the line.
Therefore the pin RXD has to be connected to pin CTS of the CH340 chip.
Most PCBs with the CH340 chip do not route the CTS pin to a connector. Use a thin wire to connect the pins 3 and 9 directly on the chip. Some adapter boards provide a soldering point for the signals RTS and CTS, so you don't have to solder directly at the chip
Consider using release packages for software installation: https://github.com/fablab-wue/piTelex/releases
- Overview
- Electronics for TW39 Current Loop
- Electronics for ED1000
- Electronics for V.10
- SEU-M Board
- PCB Layouts
-
Local use
-
i-Telex
-
Advanced Topics
-
Tips, Tools & Gadgets
-
TW39 (current loop)
-
ED1000 (FSK modulation)
-
V.10 (TeKaDe FS200, FS220)
-
SEU-M-board based
- with Austrian AGT (Ö-AGT, current loop)
- as replacement for SEU-B card inside LO2000, LO2001, LO3000