Building an Arduino Based TELSTAR Modem
This article describes how to assemble an internet modem suitable for connecting an early home computer equipped with a serial port to services such as TELSTAR (see The TELSTAR Videotex System) or Tetrachloromethane (at fish.ccl4.org:23). The device described is based on an Arduino, uses off the shelf parts and does not require soldering.
The following items are required for this project
- Arduino Uno R3 or equivalent.
- Ethernet Shield or equivalent.
- MAX232 RS232 to TTL breakout board or similar.
- Internet Modem Sketch (see below)
The Ethernet shield simply attaches to the Arduino. The MAX232 breakout board has four connections, two of which are +5v and GND and these should be connected to the appropriate pins. The remaining two are RX and TX, these should be connected to pins 0 (RX) and 1 (TX) respectively.
Note that during normal operation, the modem makes use of the Arduino's hardware serial port. This port is also used when uploading a program sketch to the device via USB, therefore, it is necessary to disconnect the RX and TX connections to the MAX232 break out board prior to uploading software to the device. If the unit is to be fitted within a case, consider fitting a simple switch interrupting these connections.
Compiling and Uploading the Software
The sketch for this project is located in the GIT repository here https://bitbucket.org/johnnewcombe/telstar-modem/src/master/. The sketch can be compiled and uploaded to the device using the standard Arduino IDE(https://www.arduino.cc/en/Main/Software). Updates are managed in the same way.
Please note: The device, by default, no longer auto-connects to TELSTAR at startup. However, when using client software that is unable to control the initiation of a connection, enabling Auto-Connect may be of benefit.
Auto-Connection can be enabled with the following command,
and disabled with the following command (see AT Commands).
The TELSTAR modem as described presents a DB9 connector for its serial connection, the image shows the pin numbering of a DB9 Female connector as viewed from the wiring side.
The TELSTAR modem does not implement any RTS/CTS protocol. The connection from the client computer to the device involves only three connections. Transmit (TX) Receive (RX) and Ground (GND), however, as client software often makes use of the two remaining connections Clear to Send (CTS) and Ready to Send (RTS), a simple solution is to loop the RTS back to the CTS within the connecting plug at the computer end.
BBC Micro Serial Connections
The BBC Micro uses a 5 Pin Dominino connector. The following image, taken from the BBC User Guide, shows the connectors and related connecting pins as viewed from the back of the machine. This, naturally, also describes the connecting pins of the connector when viewed from the wiring side of the connector. In this image the the pins of the RS432 are labled A to E.
There are a couple things to note about this. Firstly, the terms Data In and Data Out are used. For our purposes, Data In refers to the RX connection and Data Out refers to the TX connection. Secondly, once the domino connector is wired and re-assembled, it becomes clear that it can be inserted in two different orientations. This means that it can get quite confusing if a mental note is not taken as to which way the connector is wired before refitting the cover. Typically the small divot in the connector base lines up with the line on the connector cover. I always ensure that this line on the cover is pointing to the left when viewed from the rear of the machine. This is a personal choice and all of my leads are made this way, I selected this orientation as the Prestel adapter is wired this way. Typically this means that the cut-out on the metal part of the connector is towards the top.
A suitable connecting lead wiring diagram is shown below.
DB9 5 Pin Domino (RX) 2 ----------- A (TX) 3 ----------- B (GND) 5 ----------- C D * See note E * See note * Note: Connections D and E should be connected together within the domino plug.
The modem is designed to interface a full-duplex serial connection to the TELSTAR videotex system over a TCP connection. The modem behaves, as far as is possible as a serial modem using a set of Hayes type ́AT ́ commands with the internet connection process being handled by the modem.
Please note, the modem is not currently suitable for connecting to Telnet servers.
By default the modem automatically connects to TELSTAR, if this is disabled a manual connection can be made. For example, to connect to TELSTAR the ATD (Dial) command can be used as follows.
the port will default to 6502 however if a different port is required, the following form can be used.
An IP address can also be used.
However, the device includes a default list of Urls stored on the Arduino's EEPROM, TELSTAR is in location 0 (N0). Therefore a simpler way to connect to TELSTAR would be to use the following command. See AT&L below.
The modem, by default, operates at a serial port speed of 2400 baud and uses DHCP for network configuration. the interface speed can be changed as required (AT&I).
The command set is loosely based on the Dowty Quatro modem, however, due to the differences in using an internet connection rather than a switched telephone network, not all of the commands are implemented. Unsupported commands are accepted and return the OK response or 0 if Verbose is not being used (ATV0). This should allow preset modem command strings within existing terminal software to work as expected.
The following is a list of 'AT'commands. Where the command is followed by a n, this indicates a parameter and may be a number, a character or a string of characters. If a parameter is not specified, it is assumed to be 0 or an empty string as is appropriate for the command. Many commands can be combined, for example the commands AT&H (display help) and ATI (Inquiry) can be combined as follows
When in 'command' mode (see ATDT and ATH below), entering AT followed by <Return> should give the response OK, if Verbose is not being used (ATV0) the response will be 0.
Causes the modem to initiate a connection to a remote host for example all of the following are valid commands. The port will default to 6502 if not specified.
ATDT glasstty.com ATDT glasstty.com:6503 ATDT 220.127.116.11:6503
ATDP is accepted as an alias for ATDT. ATDT and ATDP were used to indicate pulse or tone dialling in traditional modems when using the telephone network. The internet modem will accept either ATDT or ATDP.
ATNn (Store a Url)
Stores a url:port definition. This command stores the url in one of 10 memories (0-9). These are lost when the unit is powered off unless AT&Z is invoked (see below).
ATN0glasstty.com:6504 ATN118.104.22.168:6503 ATN2ATDTfish.ccl4.org:23
To use a stored url, ATD can be used for example...
To clear a stored number, simply omit the url for example the following command clears memory 0;
AT&N (Display Stored Urls)
Displays the entire directory of stored Urls. e.g.
N0 - URL: GLASSTTY.COM PORT: 6504 N1 - URL: 22.214.171.124: 6503 N2 - URL: fish.ccl4.org PORT: 23 N3 - URL: 127.0.0.1 PORT: 2323 ... etc.
AT&F (Factory Defaults)
This will restore the modem to its factory default settings. It will not clear stored Urls or delete ant settings stored using AT&W.
AT&L (Auto Connect)
This command controls whether the modem will attempt an automatic connection at startup. When Auto Connect mode is enabled, the modem will attempt to connect to the Url in store N0. By default this is TELSTAR but can be changed see ATN. Auto Connect Mode is enabled by default.
AT&L0 (disabled) AT&L1 (enabled)
ATEn (Echo Mode)
The Echo command controls the echo of characters received by the modem from the terminal, back to the terminal. Echo is enabled by default.
ATE0 (disabled) ATE1 (enabled)
ATQn (Quiet Mode)
This command controls the responses to commands from the modem. When Quiet mode is enabled, the modem will accept commands but will not respond. Quiet Mode is disabled by default.
ATQ0 (disabled) ATQ1 (enabled)
ATVn (Verbose Mode)
Verbose Mode determines the type of responses returned to the terminal. Verbose mode is enabled by default.
ATV0 Verbose Mode disabled. (numeric responses) ATV1 Verbose Mode enabled (plain english responses)
Displays the help screen.
All commands are preceded with AT DT Dial DN Dial Stored H Hook O Online Status E Echo Q Quiet Mode V Verbose N Enter Url I Inquiry &N Display Urls &W Save Config Z Restore Config &F Factory Reset &H Help *C List Settings
Set the interface baud rate to one of the following rates 300, 1200, 2400, 4800, 9600, 19200 or 115200. E.g.
AT*C (Configuration Display)
Displays the current configuration.
AT&W (Write Active Configuration)
This command will store the current modem configuration and stored Urls to Flash memory if installed in the system.
ATZ (Recall User Configuration)
This command will reset the modems current settings and stored Urls to those previously stored with the AT&W command.