-
Notifications
You must be signed in to change notification settings - Fork 11
SW_DevCH340TTY
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 |
---|---|---|---|
portname | "/dev/ttyUSB0" | string | serial port used (COMx: in Windows) |
baudrate | 50 | 50, 75, 100 | Baud rate |
bytesize | 5 | 5 … 8 | # of Databits |
stopbits | 1.5 | 1, 1.5, 2 | # 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 |
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 shown as '/dev/ttyUSBx'.
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.
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.
Note: 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!
TODO
Consider using release packages for software installation: https://github.com/fablab-wue/piTelex/releases
-
Local use
-
i-Telex
-
Advanced Topics
-
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