A SERVICE OF

logo

SERIAL PORTS SECTION 4
Page 4-1 RPC-320
Figure 4-1 Serial port and jumper locations
DESCRIPTION
The RPC-320 has two serial ports that interface to a
printer, terminal, RS-485 network, or other serial
devices. This chapter describes their characteristics and
how to use them. Frequent references are made to
commands listed in the BASIC-52 Programming Manual
or RPBASIC-52 Software Supplement in this manual.
Please refer to these manuals for more information about
these commands.
Serial por ts are numbered C OM0 and COM1. COM 0 is
RS232 only and is used for progr am development.
During run time, it can be used for other functions.
COM1 is a general purpose port and is jumperable for
RS-232 or RS-422/485.
Each port has a 256 character interrupt driven input and
output buffer. This allows sending characters without
slowing down program execution. However, if the
PRIN T buffer fills, program execution is suspended until
all PRINT characters are in the buffer. Both ports have
a 256 character input buffer. When more than 256
characters are received, excess ones are ignored.
CONFIG BAUD controls baud rate and RS-232/485
mode (COM1 only).
ON C OM$ is useful when data is sent in packets. This
multitasking command branches to a BASIC subroutine
when a specific character or number of characters is
received.
Another useful function is STR. Strings can be
formatted, analyzed for length and content. When used
in conjunction with ON COM$, networking over RS-485
is much easier than with the original BASIC-52.
COM0 SERIAL PORT
This port uses a VTC-9F serial cable to connect external
serial devices to the port. The cable consists of a 10 pin
IDC connector wired one-to-one to a DB-9 connector.
Line 10 is simply cut off. The pin out is designed so it
plugs directly into the 9 pin serial port connector on a
PC.
CTS is a output and is set to high on power up.
Normally, this tells the other device to send data. The
CTS line is set high or low to hold off communication.
The sending device must have a RTS input. Line 400
sets CTS high and 500 sets it low, or to hold off.
400 LINEB 5,0,(LINEB(5,0) .AND. 247)
500 LINEB 5,0,(LINEB(5,0) .OR. 8)
COM0 is normally used for program ming. During run
time it may be used as a general purpose serial port.
When used for programming or with the INPUT
statement, it will accept ASCII character values from 0
to 127. When used with the GET function, it will return
ASCII values from 0 to 255.
COM1 SERIAL PORT
COM 1 is either an RS-232 or RS-422/ 485 port. A
VTC-9F serial cable, described above, is used for RS-
232 level communications. RS-485 is from screw
terminals. COM1 has 2 hardware handshaking lines,
CTS and RTS.
RTS is an input to the card. W hen RTS to the card is
low, it usually indicates the sender does not want any
data sent to it. The status of this port is read by the
LINEB statement. The example below returns a status
of the RTS line:
100 B = LINEB(5,1) .AND. 32
If B = 32, the sender is not requesting information and
nothing further should be printed.
The CTS line may be set high or low to hold off
communication from a sending device. The sender must
recognize the CTS line. Line 400 sets CTS high and 500
sets it low, or to hold off.