
SERIAL & SPI PORTS BASIC SECTION 4
Page 4-1
Figure 4-1 Serial Com munication Ports
DESCRIPTION
SERIAL PORTS SECTION 4
The RP C-210 has two ser ial ports that inter face to
printers, terminals, RS-485 network, or other serial
devices. A clock and data lines for SPI com patible
devices is also available. This section d escribes their
characteristics and how to use them.
Serial por ts are num bered C OM 0 and CO M1. COM 0 is
RS-232 only and is used for program deve lopment.
During r un time, it can be used for other functions.
COM 1 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 characters to be sent out
(using PRINT) without slowing down program
execution. However, if the PRINT buffer fills, program
execution is suspended until all PRINT charac ters ar e in
the buffer. Both ports have a 256 character input buffer.
When more than 256 char acters are r eceived, excess
ones are ignored.
CONFIG BAUD controls baud rate and RS-232/485
mode (COM1 only).
ON C OM$ is useful whe n data is sent in pac kets. This
multitasking command branches to a BASIC subroutine
when a specific character or number of chara cters is
received.
COM1 UART uses INT0 interrupt. This interrupt may
be used with the real time clock, counter/encoder, or for
external interrupts at J8-6 or J7-3. COM 1 uses this
interrupt for serial comm unications. If you ne ed to use
INT0 for the real time clock or external use, then you
can not use COM1 for serial communication.
COM0 SERIAL PORT
This port at J1 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 . L ine 10 is simply cut off. The pin out is
designed so it plugs directly into the 9 pin serial port
connector on a PC.
COM 0 is normally used for program ming. D uring run
time it may be used as a general purpose serial port.
When used for programming or with the INPUT
statement, it accepts ASCII chara cter value s from 0 to
127. When used with the GET function, it will return
ASCII values from 0 to 255.
COM 0 does not have handshaking lines.
RPBASIC-52 Programming Manual difference
CONFIG BAUD 0,0 does not output 38,400. W hen a
baud code 0 is entered, the rate will be 57,600.
Commentaires sur ces manuels