TRS-SO
MODEL III
Using the ModelIII as a Terminal
Probably the most common use
of
the RS-232-C interface will be to allow the Model
III to act like a "terminal" to
another'
'host" computer. In this application,
whateveryou type on the keyboard is sent via
RS-
232-C to the otherhost computer,
and whatever the host computersends to you is displayed on your screen.
Before going into the details
of
RS-232-C operation,
we'll
show you a BASIC
program that sets up a simplified terminal operation.
1.
Make sure the
RS-"232-·C
characteristics are set to match those
of
the host
computer.
If
they are not, then change them, as explained later in this chapter.
Note:
For
this BASIC
Program,
you mustuse a baud
rate
of
110. An equivalent
Z-80 program could use any baud rate.
2. Connectthe Model III to the host computer via the
RS-232-C. You will need a
telephone interface (modem) orothermeans
of
communication.
3. Type in and run the following
BASIC program (you do not need to type in the
comments (material that starts with a singlequote). The program displays
charactersreceived via the
RS-232-C, and sends characters you type in.
It
is for
demonstration only, and
is
not meant to function as a practical terminal. Notice
there are
no spaces between the"
"in
line
160.
'NO
KEY,
SO
GO
CHECK
SERIAL
'DELETE THIS LINE
IF
HOST
PROGRAM
'HAS
AN
ECHO
FEATURE
'PUT
CHAR.
INTO
OUTPUT
BUFFER
'SET
UP
U8R
CALL
TO
SR8TX
'CALL
$RSTX
'GO
CHECK
SERIAL
INPUT
'INTEGER
VARIABLE
FOR
SPEED
'DON'T
WAIT
FOR
SERIAL
I/O
'TX/RCV
AT
BAUD
RATE
110
'LSB
OF
USR
CALL
ADDRESS
'Mse
OF
USR
CALL
ADDRESS
'8ET
UP
USR
CALL,
LSB
MSB
'CALL
$R8INIT
'LSB
OF
$RSRCV
'LSB
OF
$RSTX
'CHARACTER
INPUT
BUFFER
'CHARACTER
OUTPUT
BUFFER
'8ET
UP
U8R
CALL
TO
SRSRCV
'1CALL
$RSRCV
'LOOK
AT
INPUT
BUFFER
'IF
C
::::
0,
NOTHING
HAPPENS
INPUT
PO.~E
CO,
ASC
(
C$
)
PO.<E
U1,
TX
X
::::
USR(0)
GOTO
100
5
DEFINT
A~-Z
1
et
PO.~E
1.
6B90
.,
0
15
POKE
16888,(2*16)+2
1'7
Ul
::::
16526
18
U2
::::
16527
20
PO.~E
U1.,
90
:30
PO."E
U2,
0
40
X
::
USR(Q)
50
RCV
::::
80
60
TX
_.
85
'70
CI
::::
16872
80
CO
:::
1.6BBQ)
90'
CHECK
FOR
SERIAL
INPUT
1
00
P(H~E
U
1.,
RCV
110
X
::::
USR«(2)
120
C$
::::
CHRS(PEEK(CI»
130
PRINT
C$;
140'
CHECK
FOR
KEYBOARD
150
C$
:=
I
N.~EY$
160
IF
C$
::::
""
THEN
100
165
PRINT
C$;
166
1'70
180
190
200
8/2