Introduction
Since buying my Sinclair ZX80, I have made so many changes that it is hardly recognizable. One of the most satisfying has been the addition of an RS232 interface and a modem.
I have had a longstanding and probably irrational interest in data communications. Exchanging data between machines opens up the prospect of electronic mail and banking. The individual can also access large data bases such as Compuserve, Dow Jones, and “The Source.” I find this an exciting look at what I hope will be the future.
All that is needed is a device called a modem. It is available from Radio Shack for about $150. Unfortunately, most modems will not work on a Sinclair because they require something called an RS232 interface.
The Byte-Back Modem
When I saw that the Byte-Back Co. was offering a modem that would attach directly to the Sinclair, I wasted a few milliseconds in debate and then ordered one. I was even more pleased when I learned that not only did the system include an RS232 interface, but that its services were available to me for other purposes.
The Byte-Back modem is a fine device. It works well and actually does more than advertised. The instruction manual, on the other hand, in its attempt to furnish operating instructions, assembly instructions, and engineering data, is a bit sketchy. A description of the non-standard output on the RS232 board is not given nor is there much in the way of checkout procedures.
This article attempts to provide some of that missing information as well as to give a review of my experience with the product. I also recommend V. B. Rice’s fine article which describes his homebrew RS232 interface as a source of additional information on the subject (SYNC 2:6).
Bytes, Bits, and BAUDs
Before useful information can be exchanged, a common communications mode must be established to satisfy the needs of the communications media. This is the function performed by the modem, its interface, and the associated software.
First, it is necessary to transform the internal character set used by the Sinclair into the ASCII character set used by everyone else. Since the system must both transmit and receive, this transformation must go both ways. Character transformation and control of the interface hardware is the function of the software.
When the data is organized into ASCII codes on the Sinclair data bus, the data must be communicated to the modem. This is the function of the interface. An interface is required because the data on the Sinclair edge connector is arranged on eight parallel wires while the telephone uses only one. This means that the computer can operate on eight signals or bits at once forming a byte. The telephone system, on the other hand, must take those bits one at a time. It is necessary to trade space for time by arranging the data bytes into some agreed upon serial order. It is also necessary for the interface to control the serial transmission rate or BAUD rate. This conversion from parallel to serial is old hat for the Sinclair since that is the method it uses to generate a TV picture and write to the cassette.
The problem is that the TV and cassette interfaces are specific to the Sinclair alone and connect only one specific device. The importance of the RS232 interface board is that it performs the proper conversion and generates the proper control functions according to a widely supported industry standard set by the Electronic Industries Association (EIA). For the price of a modem alone the Byte-Back system is not only a modem but also a generalized serial input/output (I/O) port that will allow the attachment of numerous peripherals to the Sinclair.
The port operates asynchronously. This means that the timing between characters is not controlled, while the timing within a character is. It supports all normal data transmission rates (as shown in Table 1). It also supports 5 to 8 bit per character data codes, stop bit insertion and even/odd/off parity generation for error checking. Since it is a full duplex system, it can both talk and listen at the same time. Most of these options are software controlled; others by a combination of software and hardware jumpers. It also supports “handshaking” to an external device through its Clear to Send (CTS) line and its status register is available to Basic at any time.
Table 1. Clock frequency straps and mode instruction data bits used to select the BAUD rate.
BAUD rates
Straps Mode instruction D0 1 0 1
Data bits D1 0 1 1
÷1 ÷16 ÷64
A 9600 9600 600 150
B 4800 4800 300 75
C 2400 2400 150 37.5
D 1200 1200 75 18.75
The Byte-Back RS232 board is fully buffered and does not appear to interface with the Sinclair in any way. It is memory mapped into locations 38 and 39, and, since these are two empty places in the ROM, the RS232 board does not take up any RAM. Of course, it can be moved to some other location or a second RS232 device can be attached by changing some options on the board.
Figure 1. Byte-Back RS232 output plug.
J2 1 /O O 16 2 O O 15 3 O O 14 4 O O 13 5 O O 12 6 O O 11 7 O O 10 8 O O 9 *1. +9 Volts. 16. Received data (RxD). 2. Transmitted data (TxD). 15. Clear to send (CTS). *3. Transmitted data (TxD). 14. N/C. 4. N/C. 13. Data terminal rdy (DTR). 5. N/C. 12. Request to send (RTS). 6. N/C. 11. N/C. *7. -9 volts. 10. RS232 output. 8. Ground. *9. RS232 input. * RS232 level (-15 to +15 volts). Other pins are at TTL levels (0 to +5 volts).
As an example of its flexibility, the same device that operates the modem at 300 BAUD with 7 bit ASCII codes, even parity into Compuserve can also communicate with “the Source” using 8 bit codes with no parity and make the switch with one Basic command.
At Byte-Back it has also been connected to a Radio Shack model VII dot matrix printer operating at 600 BAUD allowing the Sinclair to output to a line printer at any line width or character count. A Basic program illustrating this fact is included in the instructions and machine code programs to drive the model VII or other printers are available from the manufacturer for $29.95. In addition TTL, (0 to +5 volt) output is available on the board for those devices requiring those levels. Since the basic chip is an Intel 8251A Universal Synchronous/Asynchronous Receiver/Transmitter (USART), I would assume that other capabilities are also present.
A word of warning, however, because of the nature of the RS232 standard, (it is almost an “unstandard”) you should not read too much into my description. The statement “standard RS232” in advertisements is about the only thing that is. Anytime an RS232 device you are not familiar with is connected to any RS232 interface the engineering data for both devices should be studied or the manufacturer consulted. The device will probably work but some engineering may be required. This is particularly true if the device requires handshaking.
An example of this is the fact that the Byte-Back RS232 board itself does not follow the standard. This is particularly obvious with the output plug. The RS232 standard describes a 25 pin “D” connector with every pin accounted for. Byte-Back uses a 16 pin wire wrap DIP socket with the pin assignments as shown in Figure 1. With its mixture of TTL and RS232 levels, this plug is definitely not standard RS232. The reason is that the modem utilizes only the TTL connections and the wire wrap pins on the plug allow it to fasten directly to and hang down behind the interface forming a single compact unit as shown in Figure 2.
All of the necessary RS232 levels are available somewhere on the board. Unfortunately, the arrangement makes it necessary to have good engineering knowledge of the interface. At the very least it will be necessary to fabricate a custom cable to connect the unit to other RS232 speaking peripherals. Fortunately, Byte-Back seems to be willing to aid the experimenter.
Data passing through the interface is still in digital form. This is fine for local communication between a computer and its peripherals but it is not suitable for transmitting data over the phone. This is because the telephone is an analog system. The modem transforms this data from the computer into tones, then modulates those tones onto a carrier frequency and transmits the resulting analog signal over the telephone lines. When it is receiving, it demodulates the carrier and reconstructs the original digital data stream. (The word modem is a contraction of modulate and demodulate.)
At 300 BAUD there are basically two kinds of modems, acoustic and direct connect. Acoustic modems are distinguished by a rubber cradle which is used to hold the telephone handset. Communication with the phone line is through the microphone and receiver of the handset. The direct connect modem is attached directly to the phone line. It is either hardwired into the baseboard junction box or attached through a plug.
The Byte-Back modem is the direct connect type but with a difference: to save cost, line holding circuitry is not included.
[Figure: Figure 2. Author’s ZX80, RS232, and modem. (Note: Sinclair 16K RAM pack attached to expansion plug.)]
After communication with the host system is established, it is not posssible to press a button and hang up as with other modems. The phone must be left off the hook and muffled in some manner to keep room noise out of the data. This may be objectionable to some, but remember that as modems go, the Byte-Back unit is very inexpensive. However, it is also true that it lacks the portability of an acoustic modem without furnishing the noise immunity of the direct connect type. It appears that the problem is easily corrected with the addition of a switch and a holding coil, but I can unplug my handset and so it does not bother me at all.
[Figure: Figure3. RS232 interface board layout.]
[Figure: Figure 4. Modem board layout.]
The Kit in General
In kit form the system consists of two printed circuit boards, two bags of parts, a software cassette, and two sets of instructions. The boards I received were of excellent quality, solder masked with the component layout printed on the board as shown in Figures 3 and 4. These improvements over earlier boards greatly facilitated assembly. Although my kit was one of the first available, no modifications were required, and, once functional, it has operated flawlessly.
Basically, the builder is told to assemble the components to the board in the locations indicated by the layout drawing printed on the board. There are no step-by-step instructions with the little boxes to check off as each step is completed. The assembly can be done in any sequence “with the following exceptions” (one or two pages of execptions follow).
This works reasonably well in practice if a policy of mounting the smallest parts first is followed unless otherwise directed by an “exception.” Since I do not have the resistor color code down cold and I was not sure I could identify the rest of the parts, I found myself paging back and forth between the parts list (where some parts identification information is given) and the “exceptions” sheet (where additional parts identification is made). I also found that it helped to check the components off on the parts list as they were installed.
The assembly presented no surprises, and I was able to put the kit together in about 6 hours. Anyone with some electronic assembly experience should have little trouble, although some dexterity is required as the boards are packed and the traces are close. I found a 25 watt soldering iron with a .1 inch grounded tip to be essential. Those with no experience in kit building whatsoever would probably find the assembled version worth the extra cost.
[Figure: Figure 5. Expansion connection. Printed circuit board, component side, small connector board, circuit side, cut-out, solder, 1/4″, white key, green connector]
Finally, the warranty and company attitude should be mentioned as they are of distinct advantage to the kit builder and computer hobbyist. The warranty is for the usual 90 days, but it is unique in that it applies to the kit as far parts and factory defects are concerned. It does not apply if the kit is assembled wrong. It remains valid even if you attempt to repair any malfunction yourself! As an additional aid to the kit builder, the chief engineer answers the phone on evenings and weekends when most of us are working on our projects. As my kit came with a defective chip (which was immediately replaced), I came to value this service. I found him to be patient and helpful. Most of the troubleshooting and checkout hints in this article are his.
The RS232 Board
Assembly of the RS232 board presented few difficulties. The major point of interest was the expansion plug (J1 on Figure 1).
Having assembled several kits using the same type of expansion interface as Byte-Back, I have found it almost impossible to get a reliable solder joint on the male side of the connector unless the wire wrap pins are bent as shown in Figure 5. This is accomplished by grasping the pin with needle nose pliers, holding the pliers at right angles to the board and moving the tip parallel to it. The result should be a pin bent in the shape of a crank as shown. Simply bending the pins toward the expansion board to form a V with the board in the middle will not give enough surface area to insure a secure solder connection as the board is bent and flexed during installation.
When the RS232 board is completed, it can be checked out and proper operation verified before connecting the modem. This requires a minor hardware modification. The following procedure was developed after conversation with the chief engineer at Byte-Back and involves getting the board to talk to itself. This is easy because it operates in full duplex mode (it can send and receive at the same time) all that is necessary is to interconnect the pins on J2 as shown on Table 2.
Table 2. Pin assignments for checkout.
Pin Pin Remarks
10 16 Serial data input to
RS232 level translator.
3 9 RS232 transmitter to
RS232 receiver.
8 15 Grounds the clear to
send pin on the 8251A.
The easy way to do this is to build a turnaround plug by connecting the appropriate pins on a blank 16 pin DIP header (Jameco # 16pinHP) as shown in Figure 6 then do the following:
1) Insert the test plug into J2 and attach the RS232 board to the Sinclair edge connector.
[Figure: Figure 6. Turnabout plug.]
2) Turn on the Sinclair and look for smoke. Do not worry, the board is fully buffered and has its own power supply so it is almost impossible to hurt the Sinclair if a mistake is made on the RS232 board.
3) If nothing is obviously wrong, key in the program given in Listing 1 and record it.
Listing 1. Turnabout test.
10 POKE 39,122
20 POKE 39,23
30 FOR I= 0 TO 127
40 POKE 38,I
45 PAUSE 2
50 LET A = PEEK 38
60 IF A =I THEN GOTO 100
70 PRINT "FAIL"
80 STOP
100 NEXT I
110 PRINT I
120 GOTO 30
4) Run the program in SLOW mode unless the PAUSE in line 45 is increased to 10 (this is important if a ZX80 without a video upgrade is used). In SLOW mode the screen should flash 128 times then the number 128 should appear, after which the screen should start to flash again. If the word FAIL appears at any time, the board is defective and either troubleshooting or factory service is in order. The program can be stopped at any time by pressing the BREAK key, but, if it is restarted or executed a second time, it should always be with a RUN 20 or GOTO 20 unless the power has been interrupted.
The first few lines of the program establish the data communication mode and turn on the board’s transmitter and receiver. The signal timing and error checking system to be used are also set at this time. The rest of the program transmits codes from 0 to 127 to the receiver, checks the receiver output to see if it matches what was transmitted, and sends the next code if it does. Only 128 codes are sent because the mode instruction in line 10 established a seven bit data code with one parity bit (the eighth) for error checking and only 128 codes can be sent with 7 bits.
Modem Assembly and Checkout
Assembly of the modem presented few problems largely because the instructions were more or less step by step, unlike the instructions for the RS232 board. It is worth noting, however, that the company tacks an extra charge on to any repair if the components have been mounted “face down” so that the values are not visible. This is the first time I have seen this, but it does motivate good assembly practice.
The modem is attached to the interface by plugging the projecting wire wrap pins on interface plug J2 into J1 on the modem as shown in Figure 7. Care should be exercised as the pins are long, may not be properly aligned or straight and are easily bent. Orientation of the heat sink on the interface is important because it and transistor Q7 on the modem establish the space between the two boards. I know from experience that modem components, particularly the transformer and crystal, will short out the RS232 board, producing expensive odors. Byte-Back has recently included a case for the unit. I wish I had one.
[Figure: Figure 7. RS232 interface with piggyback modem. (Note: Modular plug: Radio Shack 279-375.)]
Connecting the modem to the telephone service may be a problem although adequate instructions are given and the newer units come with a modular plug. It is a good idea to disconnect the modem from the telephone when not in use, particularly in those parts of the country where electrical storms are common. Since a telephone must be used for dialing and answering, a duplex jack (Radio Shack # 279-357) should be used, and the phone connected in parallel with the modem.
It is not necessary to subscribe to a computer service to check out the modem; all that is needed is a telephone number. Of course, the service will evict anyone who cannot produce a password at the proper time but most computer services are patient and enough communication will take place during the login attempt to verify proper terminal function.
Since Byte-Back software is configured at the factory for communication with Compuserve, I decided to visit them for checkout. To get the local Compuserve number I called (800) 848-8990 and asked for a local number in my area. Since Copuserve does not have a local number everywhere, I was also prepared to use the University of Alabama at Huntsville (UAH) bulletin board at (205) 895-6749 (ring once, call back within 40 seconds). Many universities maintain such services. So do many computer clubs. It should be understood, however, that these are amateur systems and they crash a lot, so do not get discouraged.
With the modem plugged into the telephone line and a valid telphone number the system is ready for checkout. This is done by the following steps:
1) LOAD the modem software into the Sinclair.
2) Make sure that the computer is in the SLOW mode (the software will not work on a ZX80 without a video upgrade).
3) RUN the program and answer the prompts by entering “O” and “N” for originate and echo. In a few moments the words “BYTEBACK INC. GLASS TTY” will appear on the screen, indicating that the system is standing by waiting for an answer tone from another modem.
4) Dial the host computer. When it answers, its modem will generate an answer tone (2000Hz). This will be followed immediately by the originate tone (1000Hz) from the Byte-Back unit. If this occurs, the unit can be considered at least partially functional.
5) Do not hang up the phone at this time! Either wrap the receiver in a towel, smother it in a pillow or, if it has a modular handset, remove the handset plug from the telephone base. This is important! Once when I was on line to Compuserve, my dog barked, causing the host computer to fill my screen with garbage and hang up.
6) After the two modems exchange tones, the host will immediately start sending a message that will appear on the screen. If the message is in clear English text, the system works, and communications have been established! Go out and celebrate. If assorted jumbled characters, try PEEKing the mode instruction to make sure that the configuration matches that required by the host.
What Will It Do?
The Byte-Back modem system as delivered will convert the Sinclair ZX80/81 into what is popularly known as a “dumb terminal.” Also it furnishes the capability to connect that terminal to a host computer via the telephone. As with most “dumb terminals” the user can dial up a properly equipped remote computer, command it to execute programs local to it, and receive the results on the TV attached to the Sinclair.
With the software supplied, the only way to retain the output is to halt the terminal program, reenter Basic and COPY the screen to the printer (if one is available). If this is done, however, the remote site may hang up the phone. Also it is not possible to “download” or copy software from any remote site, even another Sinclair. Having examined the terminal software (available from Byte-Back) for $10 and probably worth it, I have good news: the limitations mentioned are not in the hardware. I should point out that the software works well; it is just limited, but then so is the cost.
Since I have installed my modem, I have used it to communicate with several systems. I have been able to command the execution of Fortran and Cobal jobs on the large mainframe computer where I work. An example of this is shown in Figure 8a; sample output is shown in Figure 8b. This program was executed about 15 miles from my home, both the listing and the output were COPYed on my Sinclair. Yes, I am running Fortran jobs from a Sinclair computer.
On a more mundane level I have exchanged notes with Apple, Atari, and other computer owners on the bulletin board at the University and determined on Compuserve that it was raining in Brazil. A complete listing of what is available out there in “computerland” is beyond the scope of this article, but one thing I have enjoyed is the encyclopedia research service that several large systems offer. Just enter the subject, and within a few seconds the complete encyclopedia article appears on the screen!
After some experience, I feel that the larger systems are easier to communicate with. The Sinclair is definitely limited in some respects, and it helps to deal with a system that has enough capability to adjust. Things like page size, interrupt and abort codes often need to be negotiated, and most of the major services can. For example, I have found it helpful to direct the host to send upper case characters only. The Byte-Back software can deal with any incoming ASCII code, but it converts lower case into inverse video. This results in a display that looks a bit like a ransom note, and it is hard to read (Figure 9).
The modem software will LOAD in 2K. The price of the Byte-Back kit is about $120. The TS1000 now costs less than $70 (even as low as $50). So for less than $200 you can command the resources of a computer that costs in excess of $16 million! That ought to satisfy anyone’s power hunger!
If I have inspired you to share my disease and get into data communications with your Sinclair, give me a call on the UAH bulletin board and leave me a message. I would like to hear from you.
Figure 8. Remote job execution.
Figure 8a. Fortran listing.
00100 PROGRAM HERO(INPUT,OUTPUT)
00110 1READ*,A,B,C
00120 IF(A.EQ.0.0)STOP
00130 S=(A+B+C)/2.0
00140 RDCL=S*(S-A)*(S-B)*(S-C)
00150 IF(RDCL.LT.0.0)GOTO 2
00160 AREA=SQRT(RDCL)
00170 PRINT 101,A,B,C,AREA
00180 GOTO 1
00190 2 PRINT 102,A,B,C
00200 GOTO 1
00210 101 FORMAT(10H SIDES ARE,
3F9.4/8H AREA IS, 1PE11.4)
00220 102 FORMAT(10H SIDES ARE,
3
230+ F9.4/17H INVALID TRIANGLE)
00240 END
READY.
█
157
Figure 8b. Sample run.
? 3,6,8
SIDES ARE 3.0000 6.0000 8
.0000
AREA IS 7.6444E+00
? 5,10,15
SIDES ARE 5.0000 10.0000 15
.0000
AREA IS 0.
? 5,5,5
SIDES ARE 5.0000 5.0000 5
.0000
AREA IS 1.0825E+01
? 0
? 0.0,0,0
SRU 1.114 UNTS.
RUN COMPLETE.
█
149
[Figure: Figure 9. Author’s ZX80 on line to Compuserve. (Note: The telephone handset is unplugged.)]