
Many experimenters who converted a surplus 2050 modem board to a serial port have been unable to use the interface to drive a printer due to the lack of commercial software. The BASIC program listed at the end of this article generates a Machine Code program that will drive a serial printer through the modified modem. The driver software generated by the program will run on a TIMEX 2068 with or without a SPECTRUM ROM replacement. It should also run on a SINCLAIR SPECTRUM but has not been tested on this machine. The program will not run on any of the ZX-81 series computers or their clones.
The most difficult part of using this program is typing it in. Since it is very easy to mis-type a character in one of the fourty-two data statements, an error checking routine has been built into the BASIC program. When the program is run a warning is printed on the screen if a checksum of the data statements is not correct. The program then stops so the error can be found and corrected. However, it does not check for typing errors elsewhere in the program, so save the program after it has been entered but before it is run. If the computer crashes due to a typing error, the program can be reloaded and the error corrected without lengthy re-typing.
When the program runs it displays the byte number of the machine code it is currently POKEing. It takes about a minute to POKE all 420 bytes. The user is then asked for the serial parameters required for the printer. This information can be found in the printer’s manual. Keep in mind that most serial printers have configuration switches on the back. Check to make sure they are set according to the parameters entered at the prompts. The first prompt asks the user to enter the desired baud rate. Enter 300 or 1200 to match the printer’s baud rate. A prompt for the type of parity the printer requires is now displayed, enter “E” for even, “O” for odd or “N” for no parity checking. The program then asks for the number of bits in each character sent to the printer, select 7 or 8. At the next prompt enter the number of stop bits required by entering a 1 or 2. The serial protocols have now been set, but more information is required by the program.
Several options for the printer driver’s operation will now have to be selected.The next prompt asks the user to enter a “L” for LLIST or a “P” for LPRINT software. For general purpose use supporting TAB, AT, LLIST and LPRINT commands, enter a “P”. The “L” option is if the software is for LLISTing programs only. If a “L” is entered, and the program line being printed is longer than the selected printer width, it will be indented when it continues on the next line. The “L” option was selected when the program listing for this article was printed. Notice that it is easier to read and debug programs listed this way. The next prompt asks for the line length. This is the number of characters to be printed on each line, not the width of the printer. If desired, 32 can be entered so the printed copy matches the listing on the screen of the computer. Next enter the number of spaces each line should be indented at the start of each printed line. This indent allows listings to be centered on the paper. Select any number from 0 to one less than the printer’s width. Make sure the selected line length and indent, when added together, do not exceed the maximum number of characters per line that your printer will allow. If this limit is exceeded, the printing will not format properly. The last prompt asks if the UDG markers should be disabled. If “Y” is selected, UDG characters will be printed as capitol letters A through U. If “N” is selected the capitols will be printed with a slash through them, signifying the characters are UDGs and not letters.
The program now stops with the message “CONFIGURATION COMPLETE, SAVE CODE NOW”. If desired, the driver code can be saved as described in the next paragraph, but it can be customised even further. The driver software has a “translation table” for the graphic characters. (CHR. CODES 128 through 143.) This table stores the codes that will be sent to the printer when a graphic character is to be printed. This translation allows the user to poke the code of the printers equivalent character in the appropriate location so graphic characters will be printed correctly. The table is 16 characters long and starts at location 65287 in the computers memory. Page 242 in the TIMEX 2068 manual shows the characters and their corresponding codes. Check your printers manual to find the matching code for each character. Note that the driver has the TIMEX character codes stored in this table, the user must poke different codes in this 16 byte area for the translation to take place. There are also four more locations to poke the printer’s code for a character. Poke 64967 with the printer’s code for the copyright symbol. Poke 64976 with the code for the printer’s equivalent of TIMEX character #94, the “arrow up”. Poke 64985 with the code for the British pound sign and poke 65013 with the printer’s “backspace” code. The custom LLIST/LPRINT code can now be saved to tape or disk. The driver is 420 bytes long starting at location 64900 in the computers memory. As an example, the code can be saved to tape using [SAVE “LLIST” CODE 64900,420]. Save several copies of the code and be sure not to record over the BASIC program that generates the code. Once the print driver code is saved, the program can be run again to configure the machine code differently.
The print driver is now ready to be used for the intended application. To load the program into the computers memory, reserve room for it with the command [CLEAR 64899]. Then load the driver by entering [LOAD “LLIST” CODE]. Once the program loads and the printer and interface are turned on, enter [RANDOMIZE USR 64900] to initialize the code. The LLIST and LPRINT commands now send data to your serial printer. It should work like the TIMEX thermal printer except it leaves spaces over the page breaks in tractor feed paper for better readability.
There are several “tricks to using the driver software. The Formfeed character can be used to advance the paper a full page. Use the command [LPRINT CHR$ 12] instead of using the paper advance knob on your printer, if you do use the paper advance knob, the driver loses track of it’s location on the page. The driver can be re-initialized at any time by entering “RANDOMIZE USR 64900”. This resets the driver so another listing can be printed on a new page while keeping the line count and page breaks for the new listing correct. If your printer has features that can be accessed by sending it control codes, they can be sent one at a time by POKEing the code at location 65278 and then entering a RAND USR command. The following BASIC statement will send the escape character to the printer [POKE 65278,27: RANDOMIZE USR 65277]. Repeat this command for each code to be sent, just remember to change the 27 to the required code. Users with an AERCO compatible parallel interface can also use the driver software by replacing lines 50 and 51 in the BASIC program with the next two lines.
[50 DATA "8D8E8FDB7FCB6720CAF1"] & [51 DATA "D37F000000DB7FC90000]
The BASIC program lines 1170 through 1280 should be deleted. They are only necessary for a serial printer.
The article How To Convert A Surplus WC2050 Modem Into An RS-232 SERIAL INTERFACE For Your TS1000/1500/2068 appeared in the MARCH/APRIL ’86 (Volume 2, Number 3) issue of TIME DESIGNS. Copies of that back issue are still available for $3.00 postage paid, or the whole set of six Volume 2 issues are priced at $17.00 pdd.
RS-232/WC2050 Modem Conversion Kits are still available from Zebra Systems, 78-06 Jamaica Ave., Woodhaven, NY 11421, (718) 296-2385. Price is $19.95 plus $3.00 S&H (total order).
Surplus WC2050 Modem boards (fully-populated) are available from Grey & Clifford Computer Products, PO Box 2186, Inglewood, CA 90305. Write for prices.

SERIAL PORT PRINT DRIVER
1 REM LLIST/LPRINT DRIVER
2 REM FOR 2050 SERIAL PORT
3 REM PUBLISHED BY
4 REM -TIME DESIGNS MAGAZINE-
5 REM WRITTEN BY J. BELL
10 DATA "3E7BD3773E37D377AF32"
11 DATA "03FF3202FF0606CD63FE"
12 DATA "10FB2A4F5C110F001911"
13 DATA "A8FD732372C9ED7305FF"
14 DATA "2104FFCB56C20DFEFEA5"
15 DATA "D2A0FEFE90D240FEFE80"
16 DATA "3071FE7F20053ECBC3D5"
17 DATA "FEFE5E20053EA4C3D5FE"
18 DATA "FE6020053EC3C3D5FEFE"
19 DATA "7B3805D67AC3A0FEFE20"
20 DATA "D2D5FEFE0CCAC1FEFE08"
21 DATA "20053E08C3E6FEFE0DCA"
22 DATA "63FEFE172805FE162801"
23 DATA "C92104FF3606C92104FF"
24 DATA "CB4E2003CB96C9F5AF32"
25 DATA "03FF3E0DCDE6FE3E0432"
26 DATA "04FFF12101FF86FE00C8"
27 DATA "C5471828C92107FF1600"
28 DATA "D6805F197EC3D5FED62F"
29 DATA "CDD5FE3E08CDF0FD3E58"
30 DATA "C3E6FECD63FECD56FEC9"
31 DATA "00C506053E20CDD5FE10"
32 DATA "F9C1C93E003203FF3A02"
33 DATA "FFFE3C28063C3202FF18"
34 DATA "0D060CCD82FE10FB3E06"
35 DATA "3202FFC93E0DCDE6FE3E"
36 DATA "0ACDE6FEAF3203FF3A01"
37 DATA "FF4F0C0DC83E20C5CDD5"
38 DATA "FEC118F5219800D6A4CB"
39 DATA "7E2328FB3D20F8CDD3FE"
40 DATA "7ECDD5FE23CB7E28F77E"
41 DATA "CBBFCDD5FE18123A02FF"
42 DATA "473E429047C5CD82FEC1"
43 DATA "10F9C38CFD3E20F53A03"
44 DATA "FFFE46D44FFE3A03FF3C"
45 DATA "3203FFF1F5CDECFE182B"
46 DATA "3E7FDBFE1FD83EFEDBFE"
47 DATA "1FD8ED7B05FFC93EFF18"
48 DATA "E5000000000000808182"
49 DATA "838485868788898A8B8C"
50 DATA "8D8E8FDB77E68028CADB"
51 DATA "77E601CAE7FEF1D373C9"
1000 REM THIS POKES THE CODE
1010 CLEAR 64899
1020 LET byt=0
1030 LET codloc=64900
1040 FOR a=0 TO 410 STEP 10
1050 READ a$
1060 FOR b=1 TO 20 STEP 2
1070 IF CODE a$(b)<58 THEN LET
c=16*( CODE a$(b)-48)
1080 IF CODE a$(b)>64 THEN LET
c=16*( CODE a$(b)-55)
1090 IF CODE a$(b+1)<58 THEN L
ET c=c+( CODE a$(b+1)-48)
1100 IF CODE a$(b+1)>62 THEN L
ET c=c+( CODE a$(b+1)-55)
1110 POKE (a+ INT (b/2)+codloc),
c
1120 PRINT AT 5,5;"BYTE NUMBER;
";a+b/2+.5
1130 LET byt=byt+c
1140 NEXT b
1150 NEXT a
1160 IF byt <> 56435 THEN CLS :
PRINT "TYPING ERROR, CHECK
DATA": STOP
1170 REM THIS CUSTOMIZES
1180 INPUT "BAUD RATE; 300/1200
";b$
1190 INPUT "EVEN, ODD OR NO PARI
TY; E/O/N ";p$
1200 INPUT "NUMBER OF BITS; 7/8
";n$
1210 INPUT "NUMBER OF STOP BITS;
1/2 ";s$
1220 LET byte=74
1230 IF b$="1200" THEN LET byte
=byte+1
1240 IF n$="8" THEN LET byte=by
te+4
1250 IF p$="E" THEN LET byte=by
te+48
1260 IF p$="O" THEN LET byte=by
te+16
1270 IF s$="2" THEN LET byte=by
te+128
1280 POKE 64905,byte
1290 REM CONFIGURES SOFTWARE
1300 INPUT "LLIST or LPRINT L/P
";a$
1310 IF a$="l" OR a$="L" THEN P
OKE 65110,201
1320 INPUT "Line length ";len
1330 POKE 65242,len
1340 INPUT "Spaces to TAB ";tab
1350 POKE 65281,tab
1360 INPUT "DISABLE UDG MARKERS?
Y/N ";a$
1370 IF a$="y" OR a$="Y" THEN P
OKE 65093,201
1380 PRINT "CONFIGURATION COMPLE
TE";';"SAVE CODE NOW"
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.