Transferring Files: 2068 to QL Volume 1

See all articles from CATS v6 n8
Author(s): Mark Fisher
Publication: CATS Newsletter
Pub Details: CATS v6 n8 (Volume 6, Issue 8)
Date: December 1988
Pages: 7-8

I’ve been doing a mild but steady business in porting text between the QL and the 2068, over the past months. Others have approached me, asking me how I do it… So, here’s the secret of my success: It’s not very complicated, actually. I send the information between the machines using the RS232 protocol. This requires certain specific hardware and software for each machine, but it’s not difficult to arrange. I’ll discuss these requirements below. Hardware: The first need is a circuit that can make sense of the 8mhz buzz inside your machine, and send out an orderly signal that can be recognized by a matching circuit on the target machine. This circuit is the (in)famous RS232 port you’ve heard tell of. For the 2068 the port is composed of the Zebra RS232 add-on board and the Timex MODEM. (The add-on board’s not available anymore, but the circuit is simple, and more or less in the public domain.) The Timex MODEM boards are still available from Ed Grey Enterprises, and the combination produces a reliable 1200 baud signal for the QL. The output from the 2068 goes straight into the QL’s serial port. A cable runs straight from one port to the other, with matched lines: TX to RX, CTS to DTR, etc. Setting up the cable is the hardest part of the sequence, frankly. There’s a tortured discussion of what the RS232 standard implies in the Concepts section of the QL manual that may be of help. Don’t forget your fellow club members if you need help. Software: QL: On its end, the QL catches the flow with a copy of QLINK v.1.556 from Harvey Taylor: a good, flexible terminal program. A simple “COPY ser2 to flp1_text” command will do the job, but you won’t get to see what’s coming in. 2068: Pitching for the 2068, one could use MTERM II, BUT: MTERM II uses the program area as its data buffer. It works fine to RECIEVE text, with the machine code tending to the 2068 operation. However, If you want to SEND text, you’ll need to expand the buffer area before you put your document in it (a pain). AND: It works only at 300 BAUD. The solution is the following program: it allows transmission at 1200 BAUD, and more or less automates the transmission process. As written below, it will only transfer ASCII files, and cannot expand BASIC tokens to port program listings over. THAT improvement will be discussed in next month’s article. A number of lines are written for the AERCO disk system, but users of other DOS’s or the native Timex tape system should find the needed lines easy to change. A note on the listing. The program that expands and ports the 2068 BASIC to the QL offers the option of showing multiple statement lines spread in separate lines. I think it makes for a more readable listing. The core of this program is based on the simple port test program enclosed with the Zebra RS232 adaptor board.

10 REM Filtrans, by Mark Fisher, 1988
20 PAPER 0 : INK 7 : BORDER 0 : CLS
30 OUT 119,0 : REM zero clears UART
40 OUT 119,BIN 01000000 : REM UART reset (command preface)
50 OUT 119,BIN 01001110 : REM UART MODE command : set to 1200b, 8 bits, no pairity
60 REM "01"=1 stop bit;'11'=2 +"0" =even pairity;'1'= odd +"0" =no pairity check +"11"=8 bit words;'10'=7 bit +"10"=clock/16;01=/1;11=/64
70 OUT 119,BIN 00110111 : REM UART COMMAND byte : enable transmit & recieve
80 REM "0"=EH - not used ???? "0"=no RESET "1"=RTS pin 23 low "1"=ER reset error flag "0"=no send BREAK "1"=Rec. enable "1"=DTR pin 24 low "1"=Tx Enable
90 REM Each byte sent OUT 115 will leave on the Transmit line of the RS-232 port.
200 REM ******fil trans *************
210 CLEAR 40000
220 CAT "", : INPUT "Load what file? (name & length )";f$,len : REM length is arbitrary - just make it long enough
230 LET f$=f$+".bin"",40000" : CAT "f$",
300 FOR i=40000 TO 40000+len
310 LET a$=CHR$ PEEK i : PRINT a$;
320 POKE 23692,2 330 OUT 115,PEEK i
340 NEXT i
350 OUT 115,26
360 INPUT "Repeat transfer or new file? (r/n)";f$
370 IF f$<>"r" AND f$<>"n" THEN GO TO 370
380 IF f$="r" THEN GO TO 300
390 GO TO 200

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.