Step 2 - Using the Serial Interface Port
Limitations on Port Configurations
Restrictions
IS
RS-232-C?
RI
BASIC
To Use t he Program
the Program
Module
THE INTER
a Disk Drive
a Disk Drive
an
-Configure
MANUAL
AND
MODULE
WITH
Control Block
RS-232-C Device
THE ATA
Capabilities
FACE
THE SYSTEM
the Serial Interface Port
RI
850
MODULE
8
9
11
13
13
13
13
14
15
15
15
15
16
18
19
1
3
7
'
5 SETTING THE
BITS,
SETTING THE
6
AND
Types
Parity
Short
7
CONTROLLING
DTR,
Control Command
AND
PARITY
of
Word
RTS
READY
Code Translation
Conversion
, and XMT
BAUD,
TRANSLATION
HANDLING
THE
WORD
CHECKING
OUTGOING
SIZE, STOP
MODES
LINES
21
25
26
27
27
29
29
29
Co nte nts iii
Page 4
8 BASIC
1/0
COMMANDS
31
Opening
Closing a Port
AT ARI BASIC
GET, INPUT, PUT, and PRINT
LIST,
STARTING
9
a Port
SAVE
, LOAD, and
CONCURRENT
10 THE STATUS
Uses
of
STATUS
Error STATUS Bits
Received Data Framing Error
Received Data Byte
Received Data Parity Error
Received Data Buffer
Illegal
External Device
Data Block Error
Command
11
SAMPLE PROGRAMS
Option
Error
1/0
Statements
COMMAND
Command
Overrun
Overflow
Combination
Not
Fully Ready
to
Interface
ENTER
MODE
Error
Attempted
Module
Error
1/0
31
31
32
33
35
37
43
43
45
45
45
45
46
46
46
46
46
49
Transferring ATARI BASIC Source Programs
Baudot Terminal Emulator
Programming a Printer
Reading a Digitizer
12
INTERFACE
MODULE
ELECTRICAL
SPECIFICATIONS
RS-232-C Standard
RS-232-C Specifications
Electrical Specifications
Printer Port Specifications
13
PRINCIPLES
Software Operation
Printer Software
OF
Operation
of
the Serial Ports
OPERATION
49
53
58
60
63
63
63
64
65
67
67
69
Cont ents
iv
Page 5
APPENDICES
A Code Tables
B XIO Commands and Tables
C Port Diagrams and Interface
D Troubleshooting
E Error Conditions, Causes, and Corrections
F Product Specifications
Module
Schematic
INDEX
ILLUSTRATIONS
1-1
4-1
12-1
C-1
C-2
C-3
C-4
C-5
C-6 ATARI 850 Interface
Communications
Block
Timing
Pin
Pin
Pin
Hook
Pin
Output
of
Printer Ports
Functions
Functions
Functions
Up
of
20-mA Loop Device 90
Functions
Hook-Up
Mode
of
of
of
Serial Interface Port 4 for Use
of
1/0 17
Serial Interface Port 1 87
Serial Interface Ports 2 and 3 88
Serial Interface Port 4 89
the Printer Port 90
Module
Showing Role
Schematic Diagram
TABLES
of
RS-232-C 4
With
a
71
81
87
93
97
101
105
66
91
t
1-1
4-1
10-1
10-2
12-1
B-1
B-2
B-3
B-4
B-5
B-6
B-7
B-8
B-9
B-1
B-11
F-
1
The Most
Available Signals on Ports
Decimal Representation
746
Sense
RS-232
Baud
Word
Specifier
Aux2 Specification To
Translation
Input
Output
Append Line
Control Values for DTR Added
0
Control Values for
Control Values for XMT Added to Aux1
Pin
Connections
Common
Values Added Into Location 747
-C Electrical Specifications
Rate
Specifiers
Size Specifiers
for
Two
Mode
Parity
Mode
Parity
Mode
Feed
RS-232-C
To
To
Stop Bits
Monitor, DSR, CTS, CRX
Options Added
Options
Options
Options
RTS
Added
Circuits
1,
2,
of
the Error Bits in Location
Add
to
Add
to
To
Add
Added
Added
Added
to
3,
and 4
Aux1
Aux1
to
to
Aux1
Aux1
to
to
to
Aux1
Aux1
Aux1
to
Aux1
Aux1
4
18
44
48
63
82
82
82
83
83
83
84
84
84
84
85
103
Conte nt s v
Page 6
HOW
TO
USE
THIS
MANUAL
Before reading this ma nua l,
Module
Module,
Printer
While
face
The
Sections 1
what
and using the
before going on
of
This manual describes
BASIC (often referred
described,
tridge slot
()wners
the ATARI 830™ Acou stic Modem, and the ATARI 825™ 80-
to
your
most
module, you
modem
it can
the interface
of
Manual.
ATARI
of
the
cannot
through 3 of
do.
The
equipment.
module.
you
must first insert an ATARI
your
Home
information
' ll find some i nstructions he re
function
the manual explain
beginning
to
Sections 4
how
to
in
computer
you
shou ld be familia r
It tells
to
you
how
Computer.
in this technical manual cove rs the use
without
user may
The advanced user should at least skim this material
through 13,
use
the
console.
the
text
simply
the interface
want
which
ATARI850
BAS
with
the
ATARI® BSO
to
connect
for
how
the interface
to
study these sections after setting up·
provide
Interface
as
BASIC). To carry
IC
cartr
the ATARI 850 Interface
operating the acoustic
module.
modu
details
Modu
out
idge in the
™ Interface
of
the inter-
le
works
on
the
many
le
only
with
the operations
appropriate
Co
lumn
modem.
and
uses
ATAR I
car-
How to
Use
This Ma nual 1
Page 7
1
WHAT
RS-232-C
Published in August
ment
change."
defines
face called RS-232-C.
Figure
signed to
The data terminal either ge nerates
keyboard/sc reen " terminal" in the normal sense
puter; etc. The idea is that the data terminal
- hence it is cal led " terminal."
the
of
a RS-232-C
At
the
1-1
, each data
sends/receives the data
of
a data set
data
line.
is
a technical standard
of
1969, it
and Data
the
1-1 show
end-
other
from
Communication
The standard specifies electrical signal characteristics and names and
functions
sta
ndardi ze. A data terminal
you can
connectio
end
is
a terminal and converts it for sending and receiving
of
the signal and
s,
diagrammatically, the kind
think
of
"data
n.
of
a RS-232-C
set
takes data from the data terminal it
over
the
modem
(such
of
the Electronic Industries Association (EIA).
is
titled " Interface Between Data Terminal Equip-
Equipment Employing Serial Binary Data Inter-
control
is
or
recei
However
terminal"
connection is
the
communications
as
the ATARI 830 Acoustic
lines that make
of
at each end
ves
is
at the end
, the data terminal need
as just
the data
IS
RS-232-C?
up
a standard inter-
hook-up
data (or does both). It
of
the name
link. The most familiar example
that RS-232-C was de-
of
the
communication
the
word;
it could be a
of
the
communication
not
of
one
o(the
set
. In the example
is
connected
Modem), which
over a telephone
could
really be at
two
of
to
link
be a
com~
link
ends
Figure
and
takes
.
The ATARI
unit
comprising a RS-232-C data terminal.
A
full-duplex
of
the RS-232-C
not
be sent by both ends at the same
tell the
sends a signal saying, "
it
is
simply the sending and receiving
connection
duplex
minal can catch
Home
other
operation
Computer
connection
connection
terminal, " I' m
for the sending
to
up
tell
.
is
OK
the
with
one
simultaneously. In a half-duplex
through
, here I
or
receiving
sending terminal
the interface
where
data can be sent and received by both ends
time
now
come."
of
required signals
of
module
. Therefore,
; it's
your
This exchange
data. Handshaking can be used in full-
to
stop sending until the receiving ter-
should be
one
terminal must be able
turn
."
The second terminal then
is
cal led
to
prepare each end
thought
connection
"handshaking";
, data can-
of
of
as
the
a
to
What
is
RS-232-C? 3
Page 8
The data-set/data-terminal distinction should be kept in mind because the
RS-232-C
interface
is
directional. That is, each line in a
RS-232-C
interface
has
direction - one device drives the line (sends information) and the other receives
the information .
either the data-set end
Each
line
in
an
RS-232-C interface
or
the data-terminal end .
is
defined
as
being driven by
a
DATA
TERMINAL
(TERMINAL)
The
dard refers
omissions and deviations from the standard, a link may
232-C. It
compatible."
The most
the name
RS-232-C
CONNECTION
Figure
RS-232-C
to
is
more
commonly
of
each line in the
DATA
SET
(MODEM)
DATA
COMMUNICATION
LINK
TELEPHONE
(
1-1
Communications
standard defines some 20 signaling lines,
them. Most
common
used
of
them are optional and rarely used.
to
RS-232-C
RS-232-C
Table
1-1
The
Hook-Up
refer
to
the link loosely
lines are listed in Table 1-1. The table shows
standard and
Most
Common
DATA
SET
(MODEM)
CONNECTION
)
Showing
RS-232-C Circuits
Role
of
or
" circuits"
st
ill be referred
as "RS-232" or "RS-232
commonly
RS-232-C
RS-232-C
Even
used mnemonics.
LINE
(CIRCUIT)
NAME DIRECTION DESCRIPTION ABBREVIA
BA
BB
CA
CB
cc
AB
CF
CD
terminal-+set Transmitted data XMT
terminal+-set
terminal-set
term i nal+-set
terminal+-set Data
(none)
term i nal+terminal-set
Received data
Request
Clear
to
set
to
send
send
ready
Signal ground
set
Signal (carrier) detect
Data terminal ready DTR
DATA
TERMINAL
(COMPUTER)
~
as
the stan-
with
to
as
liON
RCV
RTS
CTS
DSR
CRX
many
RS-
It
is
common practice to
signals,
4
What
is
RS-232-C?
and not the two-letter names
use
common names or abbreviations for the RS-232-C
in
the official standard.
Page 9
Transmit (XMT) and receive (RCV) ,
is
device. That
two
RS-232-C devices
connect
one
should
hand,
connected .
XMT
of
the devices
connect
they
are each wired
, data goes
to
RCV
DTR
out
of
a device on XMT and comes in on
when
given the
(in one direction) and
is
wired
as
a data set and the other
to
DTR,
DSR
as
data terminals, you should be careful
for
any given device,
common
RCV
to
DSR, RTS
names
to
XMT (in the
to
RTS,
is
usually relative to that
RCV.
To connect
of
the
signals, you should
other
direction). If
as
a data terminal, then you
and
so
on. If,
on
the
how
things are
other
The Signal Ground
ground potential
nected together. Devices for
nected via a RS-232-C interface.
Data terminal ready
to
readiness
they
that
set
Data
data. This indicates that communications are established.
Request
send data . Some modems (Bell 202
directions.
Clear
data terminal.
The carrier detect (CRX) line allows the data
communication
DSR
usually refers to " telephone
something like " I hear the
CRX
goes OFF, data set ready OFF usually follows a
that the other end
send
have permission
ready
to
send
to
send
connection
of
the
(DTR)
or
receive data. This
(DSR)
is
(RTS)
(CTS)
allows the data
link
is
has
two
used by the data set
is
used by the data terminal
established. This often differs little from
" hung up. "
must always be made. RS-232-C requires that the
devices be equal. That
which
this requirement
is
used by
to
answer the ringing
modem
set
off
at the
RS-232
is
a signal
to
for
example) require this line
to
signal its readiness
the
hook
other
is,
their
cannot
-C
to
allow
to
automatic answering modems
of
the telephone line.
signal its readiness
to
tell the data set
set
to
tell the data terminal that the
" (answered), whereas
end and
few
grounds must be con-
be met cannot be con-
the terminal
to
we
can talk
seconds later, indicating
to
to
send
it
pass
data from the
DSR
, except that
CRX
now
signal its
or
receive
wishes
to
switch
means
."
When
to
In normal operation, DTR ,
and
CTS
are also both ON.
ON
- either
all the lines,
standard
leave parts out). To operate the ATARI 830 Acoustic
the
control
DTR and
Note
that the
In particular, this
that
is,
duplex
most
common
" data" data.
one
or
is
that not all
lines need
RTS,
and it turns
communication
only
data lines and
link,
so
data sent,
or
it
is
all right
link
data can go both ways simultaneously. ASCII characters are the
DSR
, and
CRX
are all
ON.
However
the other devices on the
to
of
it needs
to
be used. In fact, the ATARI 830 Acoustic
DSR, CTS
seldom
no
so
the data sent each
, it
is
often unnecessary
ignore them (one
to
be implemented - it's perfectly all right
, and
CRX
link
shown in Figure
has
more than
control.
the "equivalent" of
However, as
RS-232
of
on and
way
For full-duplex operation
to
have all these lines
-C connection does not have
the
properties
Modem, for
off
together (with carrier) .
1-1
is
not
often
as
can be either
of
the RS-232-C
instance, none
Modem
defined by RS-232-C.
XMT and
not this
"co
ignores
RCV-
link
is
a full-
ntrol" data
RTS
to
of
or
Page 10
With
full-duplex
Common
operation,
terminals usually
keyboard and display (or
make
or
break this internal
duplex
mode
(the most
common
(sends back) each character
actly
what
the
the
other
end
pressing" the
computer
to
decide
echo
at
NOT
of
a password.
two
devices can handshake
do
not
have
an
internal
they
have a switch, usually called
connection)
mode),
to
be displayed
the
other
to
so
when
the
computer
as
it
is
end receives. It also allows
let you
see
what
with
data in various ways.
connection
half/full
talking
with a computer
at
the
other
typed. This allows
the
you have
typed,
between
duplex, to
end
"echoes"
you
to
comp
as
the
in full-
see
ex-
uter
in "sup-
at
In half-duplex
pass
in
only
be half
data
does
co
" half
duplex, but
only
not
nnecti
duplex
Note: The ATARI
switch.
when
phone
A
However,
it
back
common
operation,
one
direction
if
any part is, then the
one
way
at a time. In half-duplex
echo
back
what
on
from
keyboard to screen must be set local ly; that is, set
."
Telelink
the ATARI 830 Acoustic
is
placed in
to
the
computer
the
handshake that requires full
off/transmit on) handshak
ask
the
sender
user
of
a screen terminal
computer
rate at
which
to
pause the data transmission and
that
is
receiving data
it can accept data.
somew
at a time.
you type. In this case, in
here alon g
Not
all parts
whole
the
of
system
mode
com
muni
cations path data may
the communi
will
, the
computer at
order
to
see
cations path need
probably
what
your
™ I cartridge does
not
Modem
have
the
equivalent
does have such a switch, and
half-duplex position, it echoes any data sent
console.
e.
The receiver
to
stop
the
from
data
another
duplex
of
data can send XOFF
so
he can read
is
XON
computer
the
XOFF/XON (tra nsmit
to
to
resume. This allows
the
screen, and it allows a
to
effectively
have to send
the
other
end
you type, the
terminal
of
a half/full
out
over
the
the
sender
the
control
the
to
to
6
What
is
RS-232-C?
Page 11
2
ATARI
This section
grammed. Using ATARI
grammed to let one user talk
Let's start
so
100 INPUT MESSAGE$
110 PRINT #5;
120 INPUT #5,
130 PRINT MESSAGE$
140
Here,
modem
modem
screen.
simply-
on. The main part
GOTO
unit
#5
. Thus , line 100 gets a line from
, line 120 gets a line from the
BASIC
will
show you
just a program
of
MESSAGE$
MESSAGE$
100
is
assumed
BASIC, two
such a program might be:
to
AND
INTERFACE
an
example
ATARI
to
another user through ATARI 830 Acoustic Modems.
to
send a message line, then receive a line, and
have been opened to the RS-232-C
modem
THE
ATARI
MODU
of
how
the interface
Home
Computer
your
keyboard, line 110 sends it
, and 140 prints that on
Systems
port
module
will
attached to the
your
television
850
LE
is
pro-
be pro-
to
the
Here's the
10
20 OPEN #5,
30 XIO 40, #5,
100 INPUT
110 PRINT #5;
120 INPUT #5 ,
130 PRINT
140
Line 10 allows space for the variable
We've
1,
allowing
Mode
more
1/0.
any
allowed until
the keyboard and screen
and that
whole
DIM
MESSAGE$
MESSAGE$
GOTO
assumed the
input
1/0
is
required for
details about
Once
the
time
to
the
Concurrent
is
what we'
program:
(120)
13, 0, "R1
0, 0, "R1
MESSAGE$
MESSAGE$
MESSAGE$
100
modem
and
output,
Concurrent
Concurrent
concurrent
re
doing
:"
:"
is
input
Mod
RS-232-C
Mode
is
allowed
here,
attached to
and enabling
(see
Mode
e 1
/0
1/0 is stopped by closing the port.
MESSAGE$
Sections 4, 5,
1
/0)
. Line 30 turns on the
is started, you may INPUT
port; but
while
RS-232-C
so
there's
(used
to
both send and receiv
port
1. Line 20 opens the RS-232-C
Concurrent
6,
no other 1
Concurrent
no
problem.
Mode
9,
and 10, and
/0
1
/0.
Concurrent
Appendix
Concurrent
and/or
to
any peripheral
Input/output
Mode
1
/0
e).
port
B for
Mode
PRINT at
to
is
active,
is
Page 12
HOW
THIS
TO
USE
PROGRAM
How
is
this program
port
, the RS-232-C 1/0 handler for the RS-232-C ports must be loaded
ATARI
puter
right order. Specifically, the interface
computer
face
console
Home
and the interface
module
Computer
console (or at the same instant),
is
is
turned on.
used?
The first
System . This
module, but
there. The RS-232-C handler can
See
Section 3 for
thing
to
is
done
you have
module
more
know
or
the
is
that since it
automatically
to
turn
on
must be
computer
only
be loaded
details.
for you by the
your
turned
will
not
when
uses
an
RS-232-C
into
equipment
on before the
know
the inter-
the
computer
the
com-
in the
After tu rning your
program can be loaded from tape o r diskette. The person on the
these things, too,
to
gram
statement:
to one
instead
You're
Answer
Both modems should be
turned
you call
communications.
until
before the
your
Th e person
with
listen first, and the
40
GOTO
of
the programs. This
of
the keyboard.
ready to go! Get on the
mode
on , it starts
up
a timesharing service, and it
yo
u are ready
computer
phones
with
a
i;ljil@l
computer on
but
there' s one
120
, and the
in the
. Then the
other
set
to
squeal. This
To avoid the
to
start talking (on ly the interface
console-
modem
the send-first program typ
other
correctly, you can type in the program. Or, the
sma
other
to
way
phone
sets
to Full Duplex.
is
bother
it's. all right
crad le
can answer ... and
ll difference. O ne
talk first.
, the program starts reading from the
to
his to Originate
the same squea l you hear over
of
s.
One
each other.
Note
is a sig
nal
li stening
to
turn
es
a line (up
way
One
mode
that
to
to
this,
module
on the
so
on.
of
you
to
do
this
of
you
(it
doesn't
when
the Answer
the
Originate
don't
needs to be
modem
to
120 cha racters), e
other
has
to
write
is
by addi ng the
sets
his
matter
the
modem
turn
the
later).
end does all
his pro-
modem
modem
which).
modem
phone
when
to
modem
turned
Now
ndin
sta
on
on
put
to
is
rt
g
8
BAS
IC and th e A TA
RI
85 0 Interface
Th e listener
sc
reen for a
program gets
keyboa rd , and
typed
130) , and that INPUT
the
sender.
end
of
ssage
me
doesn
How
l1li!D
whenever
mD
pect it
key (
Note:
during
will
notice something
while,
by
the sender.
(EOL
a line
.)
doesn' t start over the
't
see
the message until it's
is
the program stopped? (Note that the program is an
key. You ' ll find it doesn' t
Concurrent
key first
to
work.
O n early versio ns
Concurre
and then POOF!
to
the INPUT statement, line 100. BASIC waits for
doesn't
is
similar
EOL
whenever
But,
nt
Mod
odd
right away:
ther
e's a message. Here's
go on
to
PRINT
Meanwhile
won
' t
complete
to
1;11"1;111
is
the last character sent by PRINT in line 110.
Mode
1/0
you
want
if
it does
n' t
of
the interface
e 1
/0
.)
to
the
, the listener's
until an
, and
is
phone
work, don't
until he pr
completely
work
, because the
is
activ
e.
to stop a BASIC program, eve n
nothin
g appears on hi s television
modem
used inside the comput
received !
progr
EOL
(line 110)
am is also
(
End
of
Lin
esses
l;ljil@j, and the listener
l1li!D
In general, you s
be upset-
module
just press the
, the
l1li!D
why:
Th e sender's
input
until
the l;ljli@j is
doing
e)
is received from
er
So
the sender's
infinite
hould alw
key
if
loop
is
you
ii1MM1;1}1ji
key
is
not
from
the
INPUT (line
to
mark the
.)
Try the
turned
ays
try the
don
' t ex-
disabled
off
Page 13
IMPROVING
THE PROGRAM
of
one
they'
line at a
allow
re
typed. This
either
You may find the limitation
to
interrupt
version
characters immediately
and get the talker's attention
of
the program should
as
more complicated than the simple program
needed
to
understand it.
time
bothersome. Also, there
when
of
you're
you
the listener. An improved
to
talk at any time, and send
improved
you've
seen, and some background
program
is
no way
is
somewhat
is
The basic idea
work
with
is
to
use
single characte
GET
and PUT instead
rs
(rep
res
of
INPUT and PRINT.
ented by the character's numeric equivalent inside the computer), and characters are immediately available
having
that
the same
to
when
wait
fo r the li!Jill;lli from the keyboard or
you u
se
GET
, the l;liiil;lli key produces the code for
as "ending
the
input
line"
which
EOL
is
the meaning
from the modem. (Note
of
INPUT.)
GET
shares a problem
mittedly
suppose
GET
your
is
copy
you r friend , and he
computer
The
tunately, there
and
will
100
110
120 PUT
isn
't reading
trick
is
to avoid actually
for
the
concurrent
be like this:
IF
no
chara
GET
character from
that
is
200 get STATUS
210
IF
character
GET
220
230 PUT
240
character
that
GOTO
100
with
INPUT: BASIC waits until all the
only
looking
of
hasn
for
one
the program
character
is
executing the
but
' t typed anything. This means you
your
keyboard!
doing
the
GET
until you
a way to check for a character before
RS-232-C port. Thus the "flow" of
cter
from
keyboard
keyboard
character to the
of
the
modem
not
available THEN 100
from
modem
character
to
television screen
yet THEN 200
modem
buffer
input
until it arrives,
GET
from the
can't
know
a character
GET
, both for the keyboard
our
GET
and PUT
to
BASIC
EOL
l;iiii@i
is
BASIC
modem
type, because
without
, but this
when
is
using
available . Ad-
waits.
link to
your
is
there. For-
improved program
not
So
The program
keyboard and one from the
character
(You may
yet tried
terrupts" and " buffering
when
BASIC
if
one
wonder
to
GET
does the
continually
alternates between checking for a character from the
modem
is
ready.
how
a character can become available even
it. The Operating System
,"
accepts and
GET
, the saved character
Operating System. The keyboard
character
character,
defau It buffer for each RS-232-C
is
saved this way. If you press another key before
BASIC
will
find the second character you typed and the first
port
characters behind before anything
you need it -
see
Section 9 for more details.)
, and in each
of
saves
has
a one-character buffer, that is,
case
only
gets and sends along a
the computer, using techniques
the characters
is
handed over
as
BASIC
holds
32
characters; that is,
is
lost. You can
set
up
a buffer larger than
when
BASIC
has
of
" in-
they appear. Then ,
to
BASIC from the
only
one
receives the first
is
lost. The
BASIC
can fall
32
not
31
if
Page 14
This p rogram can be used to " talk" w ith a com p uter other than ano th er ATA
Ho me Com p u te r. If you ge t d o ub le c haracters w hen you a re entering data in
co
other
m puter, then delete PUT #3,
KEY
in line 110.
to
RI
the
INTERFACE
MODULE
CAPABILITIES
ese
two
In effect, th
tel
etypewriter, using the mo d e m and
yo
u ca n access comput
TI
ON
UTILITY* and C
nk
Telel i
sc
Both
ATARI 850
Th e
Th e rest
to take ad
int
* THE SOU R
**COMPUSERVE INFORMATI
™ I cartridge,
ree n and h
pr
as
ograms can be helpful in learning
Int
int
erface mo
of
this m anu al c
va
ntage of some
erface
subsidia ry
modul
CE
and
of
The Reader's Digest Association, Inc.
prog ram s have cha nge d your
er netwo rk s, suc h
OMPUSERV
as
it
will
no provisio n fo r using an ATA
erface
Module.
dul
e h
as
many ca pabiliti
ont
ain s inf
of these
e, loo
AMER
ICA' S IN FORMAT I
ON SERVICE
k at the
Sec
is a registered tradema
ATA
RI
Ho me Co
int
erface mo
as
THE
E* *.The prog ram is not
prin
t all the cont ro l characters to your
how
es
not mention
ormation
capabiliti
ti o n 8 exa
ON
UTILITY are service marks
mpl
dul
e.
W ith the latter progra m,
SOURC E, A M ERICA' S IN FORM A-
int
ended t o replace th e
RI
Printer.
to use, and get
ed in the above exa mp l
abo
ut
the
int
erface
es.
After
you
' ve read
es
of
how
to use
of Sour
ce Telecomputing Corporation, a
rk
of
CompuSer
ve,
Inc., an H & R Block company.
mput
telev isio n
more out
modul
e and ho w
mor
e abo
it.
~
er
int
of, the
ut
o a
es.
the
BAS
IC
and
!he A
TAR/ 850
Interface 11
Page 15
So
much
from the
for the general
Operating
idea-
now
System's screen editor; to use GET you must open the
keyboard (K:). For the PUT commands
(S:)
or
the
editor
the screen device
E:
and
S:
to
see
which
keys such
BASIC Reference
as
suits
Manual
your
I
mmm
for details.) Here, we'
device
needs
I and the cursor
for the details. First
to
the television screen, you can use either
(E:).
(You
-they
differ in
ll
of
might
want
their
movement
use
the editor.
all, GET does
to
experiment
treatment
keys.
of
See
the editing
not
the
work
with
ATARI
To check
memory
whether
at location 764 (decimal), and
a key
has
yet been pressed. This location
Here's the
10
20
30 OPEN #5,
40 OPEN #2, 13,
50 OPEN #3,
60 XIO 40, #2, 0,
100
110
120 PUT #2,
200 STATUS #2,
210
220
improved
LET
KB
= 764:
LET
MODEM=
4,
8,
IF
PEEK(KB)
GET
#5,
KEY:
KEY
IF
PEEK(MODEM)=
GET
#2, CHAR
program:
NO
KEY= 255
747:
0,
"K:"
0,
"R1
0,
"E:"
0,
"R1
=NO
PUT #3 ,
XXX
NOCHAR=
:"
:"
KEY
THEN 200
NOCHAR
230 PUT #3, CHAR
240
GOTO
100
been typed,
has
is
reset
to
0
KEY
THEN 100
PEEK
at the keyboard buffer. It
the value 255
255
when
you GET
whenever
from
is
in
a key
has
not
the keyboard.
10
BASIC
and
the
ATARIBSO
Lines 10 and 20
bols) are given values
stant)-
but
Lines 30
screen
gram
BASIC.
editor
is
just like the "flow
Note
television scree
Lines 200 and 210
opened through IOCB #2). Part
of
see
through
(E:),
this program
which
how
much
60 open the keyboard (K:),
and start
set
will
not be changed
more
readable these variables make lines 100 and 200.
up
the
" program shown before, except it's been
the extra PUT in 110 to place
n.
work
together. First 200 gets the status
of
up
some sy
Concurrent
your
the status
mboli
c constants. The variables (sym-
as
the program runs (they're con-
modem
(attached
1/0 through
keyboard typing
is
the
count
been received and placed in the receiving buffer, and that
(decimal) after the STATUS check. Line 210 checks 747 to
not-if
This program
time
not
, line 220 gets a character from the buffer.
is
used just like the simpler one. Since either
, you can both use the same program - it's
not
necessary
them to listen first. If you both type at the same time, though,
will
get mixed together.
other
to
(buzzer),
Interface.
interrupt
which
is
You'll
if he wants.
typed
as
&I
have
One
2.
to
learn to take turns typing,
character you
might
to
port
R1
R1.
The rest
of
port
of
characters that have
count
see
whether
of
you can talk at any
your
find useful
of
the pro-
turned
onto
R1:
is
into
your
(which
in location 747
it's zero
to
modify
two
messages
but
allow
is
the bell
:), and
real
own
was
or
one
of
for the
Page 16
3
TURN-ON
OPERATION
WITHOUT
A
DISK DRIVE
HOW
INTERACTS
The
Operating
formation
the ATARI 810™ Disk Drive. This
The
before
and send the necessary
called
the expression "
with
The bootstrap
"ha
When
drive
the interface
loads the RS-232-C handler bootstrap program from the interface
though it
run, and it gets the RS-232-C handler from the interface
to
the
freed (but the ha ndler remains).
necessary to operate the interface
computer
or
at the same
"automatic
nothing
ndler
."
The disk drive
the
power
request.
were
computer's
THE INTERFACE
WITH
System
asks
and reach
information
If
module
reading the program from a diskette. The bootstrap program
for
bootstrap
pulling
is
turned on
there
is
RAM. The
(OS)
of
the ATARI
the data
time
yourself
your
no disk
will
when
as
the
computer,
information
," "autoboot,"
up
goal by
contained in the interface
information
to
the
drive
respond to the disk
memory
Home
information
it
is
. This
by
your
your
is
cal led the Disk
computer
in the system (o r
occupied
turned
it
turn-on
or
bootstraps
own
THE
Computer
module
comes from the peripheral itself.
on.
will
answer the
and
just
"boot."
efforts.
module
console, the
drive
by
the bootstrap program
MODULE
SYSTEM
does
not
SERIAL
If
the
,"
if
the disk
request. The
INTERFACE ports
peripheral
computer's
initialization
The term comes from
indicating that you start
is
called the RS-232-C
Operating
computer
drive
module
and relocates it in-
contain the in-
is
turned on
request
procedure
System (DOS).
issues a disk
is
turned
computer
module
off),
then
, just
is
then
is
then
or
is
as
WITH
A
DISK DRIVE
If
the
disk
drive
is
set
for
Drive
1, it
will
respond
compute
start-up program
handler from the interface
In the ATARI 810 Master Diskette, CX8104, this
AUTORUN.SYS that is supplied
supplied for details on
Caution: The RS-232-C handler shares RAM space
utilities.
DOS
MEM.SAV to
call DOS, the RS-232-C handler
Note: ATAR I 810 M
AUTORUN.SYS
SERIAL
r console
When
will
overwrite
INTERFACE ports.
is
is
DOS
the RS-232-C handler and destroy it. To protect against this, add
your
diskette (item
file and
turned
loaded from the diskette and this program then loads the
is
on. The interface
module.
with
AUTORUN.SYS.
called (by
as
ter Diskette,
cannot
typing
Non
will
be saved
be used
your
the DOS
Model
to
the disk
module
job
DOS
II
Diskette.
DOS and pressing l;ljiii;lll from
Command
with
CX8101 , does
with
the interface
drive
request
will
not
respond. A special
is
handled by a file called
Read
the instru ct ions
with a portion
your
Menu).
program.
Then,
not
module
when
the
of
th e DOS
BASIC)
when
you
contain the
RS-232-C
,
Page 17
As
a general rule,
Home
need
Computer
booting
to
turn
on any peripheral that
before
do
turning
so.
on
the
you
computer
intend
. This allows those devices that
to use
with
your
ATARI
USING
A
PR
INT
ER
There are exceptions
not
use the
on at any
In the case
terface
memory.
the
printer
boot
the
amount
Repeat the action witho ut loading the RS-232-C handler. The difference
amount
SERIAL
time, as
of
the ATARI Printer,
module
The RS-232-C
port
your
system wit h the RS-232-C
of
of
RAM saved by
to
this rul
e,
though.
INTERFACE 1/0 ports
can the ATARI 830 Acoustic
turning
saves RAM,
of
the interface
free
memory
as
handler
not
the RS-232-C
is
not needed
module.
handler
with
the
using the
For example, since an ATARI Printer does
of
the
int
erfa ce
Mod
the
computer
handler
to
use
To
see
how
and type ?
RS-232-C handl er loaded
handler
when
module
em.
on b efore
takes
an
ATARI Printer attached
much
FRE
it
is
, it can be
turning
over
1 1/ 2 K-bytes
memory
(0). This
not
needed.
can be saved,
will
into
on
give
memory.
turned
the in-
of
to
you
is
the
14
How
the Interface
Modul
e Int eracts
With
the
Sys
tem
Page 18
4
IN
PUT/OUTPUT
CONTROL
BLOCK
PROGRAMMING
SERIAL
As
with
any peripheral device attached
Computer, the ATARI 850 Interface
do
. This program may be pre-written
FACE
ports from
as
such
program
Using softwa re instructions to
is call ed
FACE
be remembered and
tion gives
IOCB
puter's
system.
An IOCB allows the
the user's . Therefore, an IOCB acts
puter
the ATARI
with
"configu
ports on the ATARI 850 Interface
an
is
an
Operating
1
/0
system.
your
Telelink
the interface
ring the
overview
acronym
System
own
BASIC program. In the case
I cartridge, read the instructions for using that particular
modul
port."
comp
li cated procedures must be
of
the effects
for
Input/Output
(OS)
computer
e.
set
th e spec ifi c values for the parameters
The
that
controls the
to
keep track
THE
INTERFACE
to
an
ATARI 400™ or ATARI 800™ Home
Module
or
conf
of
commands and their relation to each other.
Control
as
an interface between the user and the com-
requires a program
you may
igurat ion and use
Module
can be
Block. It
input
of
the 1
want
/0
to
use the
of
complex.
followed
is
that
and
output
functions, both its
PORTS
to
tell it
what
SERIAL
pre-written programs,
of
the
of
the
SERIAL
Many
details must
exactl
y.
This
portion
of
data
of
the com-
within
own
to
INTER-
port
INTER-
sec-
the
and
ACCESSING
AN
RS-232-C
DEVICE
has
From ATARI BASIC, the user
numbered 1 to
for GRAPHICS
module
face
To
be on the safe side, specify IOCB #5.
STEP 1 -CONFIGURE
The first
INTERFACE
program. In
These are shown
mand
thing
• Baud rate - bits-per-second sent/received
•
Number
•
Number
•
Whether
•
Whether
•
Whether
•
Whether
• Translation
How
•
s;
otherwise, the division
7.
IOCB
#7
is
used by the OS
MODE
if
you have graphics
to
port
configuring
of
of
the
input
output
Line Feed
the
outgoing
functions. These IOCBs should
THE SERIAL INTERFACE PORT
be
done
to
access an
to
which
bits-per-word sent/rece ived
stop bits-per-word sent
incoming
of
the
as
three groups, correspondin g
the
parity
parity
word
contro
the device
port
control
is
checked
is
is
added after every Carriage Return sent
being sent
seve n IOCBs available
or
line
printer
RS-2
is
connected by using instructions in
you may set the followin
signals
set
or
l signals DTR and
into
groups
for
LPRINT and and IOCB
not
be used
commands in
32-C device
DSR, CTS,
received (three types
RTS
to
the three configuration
is
arbitrary.
your
is
to
configu re the
g:
and
CRX
are used
to
use. The
#6
with
the inter-
BASIC program.
are
monitored
of
translation)
se
are
is
used
SERIAL
your
com-
Page 19
If you
do
not
configure the port, the system
as
follows:
• 300 Baud
• 8 bits-per-word
• 1 stop
Input
•
•
Output
bit-per-word
parity
parity (bit
• Line feed
• Light-translation
•
Outgoing
sets
defau It values
transmitted
is
not
checked
7)
is
set
to
zero
is
not
added after every Carriage Return sent
control
signals DTR and
RTS
are set
off
of
the
port
variables,
If the defau It (preset
figuration
Each
and each
do
of
these groups
port
option)
not
have
to
of
conditions
can be configured
effect on the configuration
The CONFIGURE
bits per
"word,"
establishes the
TION
MODE
modes, and the
The
CONTROL
STEP 2-USING
Once
the
SERIAL
There are
two
port: Block
Output
Mode
compatible
CTS
DTR,
the
C
compat
, and
Concurrent
ible device and
BAUD
and the
monitoring
command
will
automatic
command
THE SERIAL INTERFACE PORT
INTERFACE
fundamentally
Output
can
Mode
only
be used for
device. The Block
CRX
monitoring
Mode.
Concurrent
time) operation.
is
what
you want, then the parameters
be set.
can be changed
independently.
of
any
of
the
other
RATE
command
number
of
DTR,
set
up
appending
will
let you
port
is
is
of
stop bits
CTS,
and
the translation
of
LF
(Line Feed) afte r
turn
the
configured, you can OPEN the
different ways
and
Concurrent
Mode.
output
Output
Mode
, and carries none
Mode
1
/0
is
required fo r full-duplex (input and
with
Configuration
port
s.
used
to
set the Baud rate,
to
transmit. This
CRX.
The CONFIGURE TRANSLA-
mode, input
DSR
and
of
doing
1
/0
As
its name implies, the Block
from the
is
is
required
computer
simpler to use, allows use
of
the
concurrency
of
a configuration
of
one
command
and
CR
(Carriage Return).
RTS
to a
for
control
input
lines on
SERIAL
to
your
from the
output
the
port
con-
command
port
has
number
also
output
parity
or
port
for 1
INTERFACE
RS-232-C
of
restrictions
RS-232-
at the same
no
of
off.
/0.
the
of
16
Progr
ammi
ng the Serial
Block
statements
Your
terface
Int
er face Port s
mode
output
to
the appropriate
output
characters
module
• The buffer fills
is performed by simply
will
and then
up
• You close the c hann
• A
CR
(decimal
13)
doing
SERIAL
INTERFACE
normal BASIC PRINT
port
(after
opening
it,
or
of
course).
be placed in a 32-byte buffer and transmitted to the in-
to
your
RS-232-C
el
to the
is
placed in the buffer
RS-232
compatible
port
device. This
is
done
PUT
when:
Page 20
32-BYTE
BLOCKS
RS-232-C
COMPATIBLE
DEVICE
32-BYTE
BUFFER
INTERFACE
On
occasion, you may
For example,
sent at a different time, later than
if the external device
CTS,
or
CRX
monitoring
it can handle, you
characters
lose characters you send it because it became
block
The
Mode.
If
you issue a
action
two
nate
be opened
SHORT BLOCK
one
.
FORCE
SERIAL
FORCE
SHORT BLOCK operation
If you are using
will
be taken.
INT
SHORT
through
MODULE
Figur
e 4-7. Block
want
to
force the sending
if
you have specified the
the
is
a terminal.
feature
ca
n use the
(or a few) at a time. That
Concurrent
FORCE
ERFACE
is
SHORT BLOCK
Doing
this
ports
(?LOCK
different IOCBs,
listed in
Appendix
As
to
avoid sending
FORCE
is
not
when
commands
Output
Append
CR.
You may
another example,
SHORT BLOCK operation
way
is
only
Mode
, you
command
an
error
using Block
from one
of
course. The BASIC
B.
PRINT
OR
PUT
Mode 110
of
the
information
LF
translate
want
more
you can ensure that the device
not
ready in the
valid if you are using Block
cannot
when
. Since you can alternate
Output
port
option,
to
send the
if
you are using the DTR ,
characters
use this
the buffer
Mode
to
another
command
in the buffer.
the
LF
LF
immediately
to
a device than
to
send
middle
, you can also alter-
of
an
command.
is
empty, no
output
. The ports must
for
will
be
your
won
output
Output
to
FORCE
' t
Page 21
Concurrent
opening
operation, and then
to that port.
CURRENT
ecuting
is
sending characters to the
START
as
they ar rive
an INPUT statement to that
input
the
Mode
input, or
the file for
MODE
other
CONCURRENT
data.
Concurrent
doing
In
Concurrent
1/0
commands
into a holding
command
for
MODE
Concurrent
1/0 , executing a START CONCURRENT
normal BASIC INPUT, GET, PRINT, and PUT operations
Mode
you. For example, if
computer
1/0 those characters
buffer by the
port
, the
Mode
(fu ll duplex) 1
/0
,
is
performed by first
1/0 , after you have performed the
, 1/0
is
going on at the same
your
through the interface
wi
computer.
computer
will
really just
RS-232-C
ll be saved
If you subsequently perform
time
compatib
module
look
MODE
START
for
your
in that buffer for
CON-
BASIC
is
le device
, after the
program
1
/0
ex-
LIMITATIONS
The ports have different signals available,
For 8-bit operation, the
Input
•
•
Output
• Full-duplex operation requires
• Full-duplex supports all Baud rates.
For 7-, 6-, and 5-bit operation, the
ON
PORT CONFIGURATIONS
Table 4-1
Available
PORT
1 3
XMT
DTR
RTS
RCV
DSR
CTS
CRX
following
requires
allows the
Concurrent
option
Signals
PORT
XMT
DTR
RCV
DSR
limitations are imposed:
Mode
1/0.
of
Concurrent
Concurrent
following
as
shown in Table 4-1.
on
Ports
7,
2, 3,
and
2,
Mode
1
/0
Mode
limitations are imposed :
PORT
XMT
RCV
or
Block
1/
0.
4
4
Mode
1/0.
• Full-duplex
• Half-duplex
• Half-duplex
•
Input
Other
limitations on
rent 1/0 mode. These limitations are described in this section
If
any default
used. Configuring a
this section. There are three principal commands.
with
several configuration variables. The parameters
to signify different values
presented in
is
not
allowed.
input
can be in
output can be in Block
and
output can be
port
configurations are imposed
condition
Appendix
is
to be changed, the
port
is
accomplished by one
of
B.
Concurrent
only
300 Baud
the several variables. The details
Mode
Mode
port
1
/0
only.
only.
or less.
by
using a
must be configured
or
more
commands
Each
command
of
the
commands
port
in the Concur-
under
Restrictions.
described in
is
of
the
befor
e it
is
concerned
are coded
coding
are
Page 22
A particular default
not
input
data. To
the START CONCURRENT 1/0
command
commands
much
START
one
figured
is
in that the
more
complex
CONCURRENT 1/0
aspect and
port
and, indeed, all the ports.
condition
input
from a port
a configuration
port
than
other
as
having
more
command.
to
which
mode
is
Block
Output
you must
command.
it applies must be opened first.
configuration commands. You should
command
important
Mode
put
Thus, the
It
is
different
as
effects on
in
which,
it
into
Concurrent
START
from
being a configuration
other
of
CONCURRENT 1/0
the
other
aspects
course, you can-
Mode
1/0
with
configuration
Moreover,
think
command
of
using the con-
of
it
the
is
in
RESTRICTIONS
You must observe certain precautions
only
1/0 operations that are
PRINT, STATUS and
screen
peripheral
Using one
face
main inaccessible
Concurrent
Using any
disastrous effects,
your
so
SOUND
As
using the interface
work
gram,
should be the case, use
Note:
limm· The
face
Computer
signal
M a
(which
module,
data
that
the IOCB you are using
a safety precaution, the
sessions. You may use the
but
Jitii#bi;IMiil
Module
when
nual
do
not
is
not
all
owed
port
for
Concurrent
including
until
1/0
by
closing the
of
the
SOUND
from
is
transferred.
command.
module.
be prepared
can
BREAK
. These early versions can be upgraded at
Service Center. The ATARI TeleLink I cartridge
for details.
key was
you type
CLOSE
involve
the PARALLEL INTERFACE (printer) port. The
changing the Baud rate
permitted
to
the opened port, and 1/0
any peripheral device).
while
Concurrent
1/0 prevents the use
you terminate the
port
with
commands
If
you must use
for
1iJi1D
This
is
key
to
1iJi1D
for
nothing
JiiOiiMhfiiil
mess
not
EmiD
to happen
up
your
disabled on early versions
limm· Refer to
when
you use
with
this
Mode
Concurrent
the CLOSE
during
SOUND
Concurrent
is
disabled
prevent certain errors
key
as
you
Concurrent
mode
Input/output
1/0
is
of
any
command.
Concurrent
to
stopping 1/0
commands,
Mode
during
normally
if
Concurrent
.
disk files. Use
JUii@M;!Miil
your
your
ATARI TeleLink I Op
Mode
1/0. The
are GET, INPUT, PUT,
to
the keyboard and
to
any
active.
other
port
of
the inter-
other
ports re-
1/0
Mode.
1/0
Concurrent
would
of
local
You terminate
Mode
1/0
can have
completely
write
your
program
is
closed before the
1/0
from
harming
to stop
1/0
the ATARI
Authorized
will
transmit a break
is
active.
only
your
after trying
850
before
ATARI
erato rs
other
when
your
pro-
If
that
Inter-
During
case, data
tion
Port configuration
that reason, specify
ing
Once
appropriate
parameter
reset some parameters
because
and in the interface
a session
Turning
turn
parameters
Concurrent
is
lost.
10.
Concurrent
set, configured parameters
command
to
information
with
off
the
the
computer
will
1/0,
Methods
cannot
port
Mode
its default value.
module.
the
computer
power
on again, and the
have reverted to their preset default values .
incoming
for
be
parameters (with XIO 34, XIO 36 and
data may
avoiding
done
loss
after having started
overflow
of
data in this
1/0.
will
not
change until you change
. Pressing
but
about
to
the
JitifMM;IMii'
Turning
not
others. This action may result in peculiar operation
some
Turning
is
not
computer
off
of
these parameters
off
recommended.
also resets the interface
the
int
the
power
power
erface
on the
to
module
Programmin
the
computer's
way
are described in
Concurrent
XIO
38)
computer
on the interface
is
saved both in the
the interface
will
module. Wh
boots, all
g the Seria l
buffer.
Mode
them
module
Interf
In
1/0. For
before enter-
with
not
reset any
module
computer
during
en you
of
the above
ace
Port s 19
that
Sec-
an
may
Page 23
5
SffiiNG
WORD
AND
Common
data transmission convention.
in the MARK state. A data character (sometimes cal led a transmission WORD)
signalled by one
data bits, each bit being represented by
terminated by 1 (sometimes
next
in the MARK state. Effectively, the stop bit
The most
7-bit code, the 8th bit usually represents the parity,
a marker bit
module s
tion
a
re also
radioteletype and similar
The receiver can receive all the bits in the
arrive.
seco nd rate).
convention and other standards have settled on a fairly universal serial
When
data
START
word
can immediately
common
of
some sort.
upport
s 7-bit words for these
with
7-bit or 6-b it codes such
allowed
Each
bit
is
BIT
, represented by the
2)
STOP
follow
with
transmission
so
you can communicate
the same du ration
ASCII is
uses
.
word
very rarely sent in 7-bit words. The interface
as
BIT(s),
size
BCD (with or
SIZE,
READY
is
not being sent, the data line will sit idle
SPACE
SPACE
its start bit. If it does not, the line
cases
as
for 0 and MARK for 1. The
represented by the MARK state. The
lasts
indefinitely.
is
8 bits.
and can also be
with
word
because it knows when each
established by the Baud rate (bits-per-
THE
STOP
BAUD,
BITS,
CHECKING
state. It
When
sending ASCII ,
is
just
set
without parit
old Baudot code teletypes for
is
followed by the
to 1 or
0,
used
for communica-
y).
Five-bit words
which
or
word
stays
is
used
is
is
idle
is
a
as
will
The CONFIGU
number
size,
and
CRX.
SER
IAL
INTERFACE
opened
not configu re any port
The CONFIGURE
The
The #IOCB
mand. The IOCB should either be open
not be open
command.
Aux1
number
from Tables
form Aux1. You may add them yourself
exampl
specify the same thing.
an
XIO
36
makes this a CONFIGURE
is a number
e:
RE
BAUD
of
stop bits to transmit, and enable
The command may be issued through
IOCB to the po rt you are configu rin
36, #IOCB, Aux1, Aux2,
is
the
number
at
all.
of
stop bits to send
B-1, B-2
XIO
36, #1, 10 + 0 + 128, 0, " R:" a
RATE
command allows you
port ,
or
through
if
a Concurrent
BAUD
RATE
of
the IOCB that
No
Concurrent
or
expression that specifies the Baud rate,
with
, and
B-3
in Appendix B, and then add the numbers together
an
command looks like this
"Rn:"
BAUD
Mode
each
to
set
the Baud rate,
or
disable checking
an
open IOCB to the
IOCB
which
g,
Mode
1
RATE
BASIC
to
the port you are configurin
1
/0
should be active when you issue this
"word."
or
you can let
isn
you must
/0
operation
command.
should
For each
BASIC
nd
XIO
't bei ng used. If you have
use
that IOCB. You can-
is
active.
in
BASIC:
use
to
execute the com-
"word" size , and
of
these, pick a number
add them for you. For
36, 138, 0,
"word"
of
DSR, CTS,
RS-232-C
g,
or
shou
"R:"
ld
to
both
Setting
the
Baud,
Word
Size, Stop Bits,
and
Ready
Monitoring
21
Page 24
Aux2
is a number
s
hould
(C
performed. If you
interface
status is returned from the Block
CURRENT
matter at the
chec king; the line(s)
CONCURRENT 1/0
BASIC to take the action you d
Aux2.
check Data
RX) when a Block
module will return
Mode
of
expression that spec ifi
Set
Ready (DSR), Clear to Send
Mode
output
ask
to have the interface
1/0 attempt. Th e co
time
you
do
th e CONFIGURE
will
be checked on ly
is
attempted. You may TRAP th e error and program ATARI
error
es
whether
or
START CONCURRENT
module
status if the lin
Mode
output
ndition
when
es
ire. S
ee
of
BAUD
Table
e(s)
attempt
the line(
the Block
or
not
the interface
(CTS),
chec k one
RATE command
B-4
and/or
MODE
or
chec ks
in
is
or
from the
s)
being checked does
Mode
Appendix
Carrier Detect
1/0 operation
more of
not
output
these, the
ON.
The error
START
to turn on the
B for values
modul
or
e
is
CON-
not
START
of
The last XIO parameter, Rn:, specifies
face
module
OPEN
Note
that the default (p reset) values
co
rrespo
of
DSR, CTS, or
You shou ld
The configured parameters
until you reboot the system (turn the
will
not reset any
You may configure each RS-232-C
If you specify 8-bit
However
• Full-duplex
•
• Half-duplex
•
If you specify 7-, 6-,
you may specify.
to devi
word
sent
puter
by
translation operation and, in particular, there may be no
EOL.
If
and you must retrieve characters
found
you are
command.
nding
to 300 Baud , 8-bit
CRX.
know
the
of
, the
following
is
Half-duplex
Input
ces
that require
or
ignoring the most
this
is
in Section 10.
input
output
and
output
or
Note
received
the case, you
configuring
following
will
these parameters.
words
, there are
restri ctions
not
allowed
can be in
can be in Block
can be
5-bit words, there
that most applications
more
than
will
be converted from,
sig
ni ficant bit(s). This
cannot
which
. For n
of
words
things about this comm
stay
as
power
SERIAL
apply
Concurrent
only
300 Baud
one
use the BASIC INPUT statement
one
SERIAL
put
1, 2, 3,
Aux1 and Aux2
, one stop
you
set
off
INTERFACE
no
restrictions on operation
to
7-, 6-, and 5-bit words:
Mode
is
no
restriction on the
of
stop
bit
at a
time
INTERFACE
or
4,
bit
transmitted, and
them until you either reset
and back on) . The Jifil@l;lf1jl key
port
Mode
1
/0
only
or
less
these
word
- you should specify
or to,
an
will
very likely interact
using
GET.
just
as
for
all
four
and :
independently
only
number
sizes
8-bit byte
way
you can receive
More
port
of
the
you
would
ports are zero ,
no
checking
them
.
of
the port.
of
stop bits
will
probably
two.
within
to
the
read the
details
with
will
inter
in the
or
be
Each
com-
the
an
port
be
-
,
If you specify that you
will
check them
try
to
send a
to be c hecked
or
the
block
139 (device
correct
the interface
details.
ive action. Following the TRAP, you may perform a STATUS request
whenever you
block
of
is
not
of
data
not
ack
nowled
module
want
the interface
try
to
sta
rt
data in
ready (OFF) , th en the
will
which
block
output
not
be sent. The interface
ged)
to
BASIC, and you may TRAP the error and take
will
provide
module
Concurrent
bit
to
che
mode. If
Concurrent
4 in Loc ation 746.
any
module
ck
DSR,
mode
one
Mode
CTS, and/or
1
/0
and
of
the
1/0
will
will
then return
See
CRX
, it
whenever
lines you asked
not
Section 10 for
you
be started
ERROR
from
Page 25
Note
that
CTS
and
CRX
are
not
supported on ports 2, 3, and 4, and that
on
port
4. The interface
module
behaves
if they are always ready (ON).
You may
1/0
is
not
at the states
active (yo u must have
of
DSR, CTS,
an
IOCB open
look
quest for the port. Thus, enabling this
only
option
STATUS.
available to you , and you may prefer
See
Section 10 for details.
as
if they are really there,
and
CRX
any
to
the port) by issuing a STATUS re-
automatic
checking
checking
time
that
Concurrent
of
these lines
them
DSR
however
directly
is
is
, and
Mode
not
with
not
as
the
Se
ttin g the Baud, Word Size, Stop Bits,
and Ready Monit o
rin
g 23
Page 26
6
SETTING THE TRANSLATION
MODES
The interface
conversions (translations) and
two
operations interact
together in this section. The various
by
executing the same
Three factors must be kept in
of
course,
another. Parity generation and
another. The third factor
mitting/receiving. Inside the
words
words have
expanded
similar to changing
Each
one
at a time. For
and finally
change may
figured and
ample,
For
input
words),
is
one
are 8 bits . If you are sending/receiving 7-, 6-,
to
into
of
these three possible
truncation
not
depending
if
you have configured 8-bit words, the
, the
followed
AND
module
handler can be configured to
with
command-
of
them, since it results in (possibly) changing
come
from
8-bit
computer
one
code
output,
occur, depending
order
by parity checking, and finally translation.
translation comes first,
(shortening by leaving bits off).
on
which
of
code changing
PARITY
do
parity generating and
each other. For this reason,
mind
checking
to
remember
computer,
8-bit
computer
words
into
code
changes takes place separately
character (code) the
HANDLING
perform
options
CONFIGURE TRANSLATION
when
another.
on
you may select
setting
also may result in changing
all
by adding some bits. These operations are
what
is
up
code
is
the
word
words
are the same
or
words
expansion (from short
by
chopping
followed
selection
computer
truncation
certain types
checking
they
translations. Translation,
5-bit words, these shorter
Of
course, at each stage a
of
options
operation does nothing.
for
you. These
will
be described
for
each are specified
AND
one
code
one
code
size you are trans-
as
bytes; that is, all
out
some bits,
from
the others,
by parity generation ,
you have con-
is
sending. For ex-
words
of
code
PARITY.
into
into
or
to
8-bit
At
each
of
the three stages, a
is
the changed
it
particular configuration
EOL (End-of-Line), it
then parity
the translation step, in this case the
Note: ASCII
change. In ASCII , each letter (both upper- and lowercase),
trol key
display its spectacular screen graphics, the ATARI
modified version
certain ASCII
characters.
There
have an ASCII Line Feed
curs at the translation step. Consequently, the generated
parity and truncation (small word) phases just like the
has a number
is
one
code
would
be generated for the
is
an
acronym
of
control
Appendix
other
would
ASCII ,
characters have been assigned to ATARI
translation
code
change may occur. If a change does
that
will
be operated on in the next stage. For example, (in a
of
translation and parity options) if you
first be translated to
CR.
CR.
for the American Standard Code for
assigned to it.
which
A contains a conversion chart.
option
(LF)
sent after each transmitted
In
order
is
called AT ASCII. In AT ASCII , the codes used for
which
an
ASCII Carriage Return
The parity step operates on the result
for the ATARI
Computer
is
very specific; namely, the
CR.
occur,
output
Information
numeric
Home
engineers devised a
Computer
CR.
This code change oc-
LF
will
an
code, and con-
Computer
go through the
then
AT ASCII
(CR)
and
Inter-
graphics
option
of
to
to
Page 27
TYPES
OF
CO
D E
TRANSLATION
You have three
or
tion,
coming
change
applies
ty and small words. The no-translation
own
be
small
the no-translation
municating
another
No
ment
line. This
translation
GET instead
data
"Heavy"
and
is
only
special processing on the characters you are sending and receiving. This can
particularly
words
ATARI
matter
to
read data, the data must have an AT ASCII EOL character at the end
coming
options
outgoing
made
to
to
the translation step,
useful in the small
are used
with
Home
which
requirement
option,
of
INPUT. Remember
in,
so
from
which
to
choose: no translation at all,
translation.
characters. The no-translation
the characters,
do
option
understands AT ASCII. An example
Computer
translation
your
you
Whichever
whether
of
word
not
(or cannot)
if
the RS-232-C
via
option
applies
incoming
may still need
AFTER
data must
that
option
course-
option
situations, since
involve
modem.
you
choose, if
all translation. Thus,
using short
to
use GET.
you
being received
you can still get changes
is
useful if
ASCII. You may also
compatible
either
words
choose
option
of
this
you
use a BASIC
contain
and
"Light"
will
apply
is
just
what
or
sent. This statement
you
are going
many
of
the
cases
want
device
is
EOLs
you are
communication
INPUT
if
you
select the no-
or
you
checking
"transla-
both
to
it
says
- no
from
pari-
to
do
your
where
to
use
com-
with
state-
of
each
should use
parity
affect
in-
Heavy
In
converted to and from the ASCII
put, EOL
changed
characters
Light translation modes assume ASCII in the outside
AT ASCII in the
significant) bit
Light translation,
translation step
Light translation performs
assumption
as
the same
character
found
EOL it
zero. Light translation
Heavy
if
then
zero,
to
Won't-Translate
than
decimal (7C hex) it
preceding
parity) set
translate. Thus, heavily translated ASCII corresponds
from
in
default
and Light translation are
either
translation
is
changed to
to
CR
out
is
if it
were
really ASCII. Note,
numerically
has
to
be a
is
changed
translation
there
is
no
direct
the
code
if
the character
see
if
it
is
32
decimal (i.e.,
Heavy
to
blank
through
the
CONFIGURE TRANSLATION
value
mode
followed
for
one
in.
computer.
is
always treated
the
eighth bit
will
set this bit
that
you
wish
as
its high bit stripped (set
CR,
it
is
changed
to
CR;
then,
is
is a more
correspondence
should
the
1,
for
not
is
CR
same in ATASCII
character. Specifically,
the
will
be translated
translation leave the most significant bit (bit 7,
the
character
vertical bar. The
it
is
zero (ATASCII graphic heart).
two
ways
to
convert
, the AT ASCII EOL (9B in hexadecimal, 155 in deci!)lal)
CR
(OD
in hex,
CR;
if you also selected the
by LF, that is, the translation
On
input
, a
CR
will
be translated
ASCII
is
treated
as
if
it
of
each
to
zero.
the
fewest changes
to
work
for
example,
some ASCII
to
an EOL. For
no
matter
the
preset
thorough
be translated.
it
is
changed
character
has
a value greater than 124 and therefore, it
default
as
a 7-bit code; that
is
zero.
On
word
with
AT ASCII
that
control
to
zero), and that's
output,
what
the
mode.
translation
between
as
is a control
to
Won
command.
the
So
for
to
EOL; otherwise, the character
in ASCII.
if
the
the
Won't-Translate
' t-Translate character
between
13
in decimal). In the case
input,
is
cleared
between
within
the ATASCII graphics codes are
codes
character
mode.
character in ASCII and
input,
after
If
it
is
code
for
character)
If
you
ASCII and AT ASCII.
Append
world
then, if
ASCII and AT ASCII. The
(1
all-
if
the
Here
not
the
to
do
LF
option,
function
to
EOL. Both
to
zero.
the
- 26).
character being sent
is,
the
the
, it
ASCII character
character. If
the
not
produces
Heavy
and they assume
is,
the eighth (most
you
select
Heavy
On
output
computer
So
except
the
assumption
high
is
or
printable
is
specify it,
but
for
input,
if
the
high
bit
AT
bit
is
cleared
is
checked
translated
greater than 124
the
corresponding
characters
specified by you
the
code
is
of
out-
EOL
two
and
or
, the
treat it
the
is
is
set
to
is
that
ASCII,
to
to
the
is
less
steps
to
won't
preset
is
is
26
Se
lling the Translation Modes and P
ari
ty Han dling
Page 28
On
output,
whose
values range
124
decimal
will
be translated
sc
reen
difference between
characters in the
translatable
Heavy
ASCII
meaning
from 0-31
(7C hex)
as
inverse
output simply
to
video
translation converts EOL to
is
the
same
as
it
is
in ATASCII. That is, characters
will
nothing
input
input
decimal
will
and
are
(ASCII
control
not
be sent.
; that is, characters
not
be sent in
output
converted
is not sent out.
Note
in the H eavy translation
to
Heavy
the
CR,
and
will
values)
that
that
Won't-Translate
or
characters
would
translation
output
whose
whose
show
mode.
mode:
any cha racter
values are
high bit
on
the
television
Note also
untranslatable
value,
where
whose
above
is
one
the
un-
PARITY
The (optional)
spec ify no translation, the
Light translat ion ,
send the 13-decimal
is
on).
Each
word
shortening steps
feature
translation
pended to a
You may select
to
receiving. The
7).
In
However, the
translation step.
For
change.
For
"don't
whether
character
on in the status bytes.
is
send ,
Parity
the
default
output,
input, your
check."
se
nding
of
LF
will
follow
code
character in the CR/LF pair
on
Off, th at
is
for
operation
or
will
is,
the default is
enabled. If
nythin
input
example, even
parity
parity
parity
you
may select even parity,
choices are "
Each
not
a parity check
still be
g.
and
is
always
is
not
condition,
bit
of
input
See
NO
of
LF
after
CR
is
option
(CR),
its
output
useful then,
these last three
of
addi ng
EOL
(which
LF
will
be added
is
way
out. Th e preset
to
not
TRANSLATION
parity
handling
parity
while
the
most significant
if
you
the parity
outgoing
as
Sections 10 and
messages may have been changed
odd
don
't
touch," "check
is
made. If an
if it
were
all right; the parity
produced
LF
of
course becomes
independently sent
append
is
you
are
bit
parity
options
13
in the translation step.
to
CR
is
not
to
it
(when
default
the
set,
separately. Thus,
ignore
bit
working
of
, set
input
for details.
setting
LF.
LF
LF
will
the
of
each 8-bit byte (bit
with
input
or
parity
even," "check
will
clear the
parity
available. If
CR).
Note
the
Append
through
of
the
will
be appended
not
be a
utomatically ap-
you
parity
of
7-,
6-,
output
bit
to
top
error is
error
flag
If
you
you
specify
that
if
you
LF
feature
the parity and
Append
only
may choose
what
you
number
or
5-bit words.
is
not
altered.
during
1,
or
no
parity
odd,"
bit
found,
will
to
be
and
zero,
turned
LF
if
are
the
the
SHORT
WORD
CONVERSION
The
third
operation
you
sion (if
out
are made
That
word
send ASCII in 7-bit
usually 8 bits are sent even
codes,
codes you
off
so
codes
are using
is
, a 7-bit
is
bits 0-4. Thus
you
will
want
the
translation
you
are using.
which
8-bit
from
8-bit
word
is
form
not
be using ASCII ,
to
be sending.
performed
computer
bits 0-6
the
affects
words, this
parity,
without
if
your
characters by
of
the
if
parity (this
the
8th
With
by
code
translation
is
a " no-effect" operation). Short
omitting
character, a
generated,
bit
is
not
so
you
these
the
interface
is
is
used
will
word
6-bit
lost. ASCII
not
have
sizes,
module
is
the
the most significant bits.
word
is
common
for
parity).
to
concern
you
should
handler
short
is
bits 0-5,
a 7-bit
practice,
With
yourself
will
word
conver-
words
code
6-bit and 5-bit
turn
not
sent
and a 5-bit
; you can
though
with
translation
affect
-
the
the
Page 29
On
input
, small words are converted
order
bits. These added bits are always
ASCII , the parity and translation steps
If you are receiving
decimal
bits anyway. This means that in BASIC you
INPUT.
turn
(OD
hex) code (ASCII
Of
course, you
off
the conversions
6-
or
5-bit codes, there
will
be
of
the interface
CR)
doing
to
will
-after
your
8-bit
computer
set
to
1.
be
getting ASCII
is
all , you cannot receive ASCII in 6
will
have
own
module
characters by adding high-
Thus,
if
you are receiving 7-bit
with
the 8th bit
no
way you can receive the
to
use
the
GET
statement,
code conversion ,
handler.
so
you should
set
high.
13
or
not
5
The CONFIGURE TRANSLATION
XIO
38, #IOCB, Auxl, Aux2,
38
specifies the CONFIGURE TRANSLATION
The #IOCB specifies the IOCB
the translation mode. You may open a
port
the
that port. You cannot issue the CONFIGURE TRANSLATION
any
Aux1 specifies the translation mode, the
mode
taken from Tables
yourself and
for
out, and
Aux2
translation. Remember that the BASIC
representation
number. The
"Rn:"
you are configuring
you are configuring; otherwise you must use the IOCB you have opened
Concurrent
, and the Append
you (e.g. , you can
no
is
the numeric representation
specifies the
Mode
1/0
is
LF
B-5, B-6,
put
the sum in
translation) .
of
a character. For example,
number
port
port
your
say
either 2 + 8 +
Do
you specify should
you are configuring. For
1.
MODE
"Rn:"
number
active.
option.
B-7
and
program
not
add in more than
command
(from 1
new
IOCB if you have no channel open to
input
You specify these options by adding numbers
B-8
in
Appendix
for
Aux1 ,
32
or
42 to mean even parity in , even parity
of
th e
Won
function
be
from 0 through 255 .
is
specified in
MODE
65
command
to
7)
you wish to
parity mode, the
B.
You may add the numbers
or
you may let BASIC add them
one
value from each table.
' t-Translate character for Heavy
ASC
will
give you the numeric
and
ASC("A")
n,
you
put
BASIC
.
use
MODE
output
mean the same
1,
2,
3,
or
this way:
to configure
to
command
4.
R:
if
parity
means
The default configuration
FIGURE TRANSLATION
FACE
ports, that configuration
FIGURE TRANSLATION
translation
way.
mode
for any port.
is
Aux1 = 0 and Aux2 =
MODE
MODE
command
will
remain in effect until you
for that port.
Of
course, you can configure each
for
one
of
JiiiiM+;iMill
0.
If you execute the
the RS-232-C
will
do
not
SERIAL
another
port
CON-
INTER-
CON-
change the
a different
Page 30
7
CONTROLLING THE
DTR,
AND
RTS,
XMT
OUTGOING
There are
TERFACE
Request
on
Port 1 supports all three outputs. Ports 2 and 3 have DTR and XMT. Port 4
XMT. You may
try
You may
port
CONTROL
port
in the CONTROL
must
command
up
to
three outgoing RS-232-C signals on each
ports
of
the ATARI 850 Interface
to
Send
(RTS),
and Data Transmit (XMT).
or
off
with
the CONTROL
use
this
command
to
control
with
which
use
a line that does not exist. Your attempt
control
the CONTROL command (controlling lines on other ports requires one
that IOCB in the CONTROL
any
command
is
not
OPEN through
command.
if
any
Concurrent
or
for
Module:
command.
the same
all
of
these lines on a single
each port). The CONTROL
an
IOCB by specifying any unopen IOCB
If the
port
Mode
1/0
way
with
has
been opened through
command.
is
active.
of
the RS-232-C
Data Terminal Ready (DTR),
Each
of
these lines can
any
port-
will
simply have
RS-232-C
command
You may not issue a CONTROL
LINES
SERIAL
it
is
not
no
SERIAL
·may be issued
INTERFACE
an
IOCB, you
be
turned
has
an
error
effect.
number
IN-
only
to
to
a
CONTROL
COMMAND
Controlling
you change XMT you are likely
the serial
to
send a
of
its normal resting state. Specifically, the normal resting state
which
SPACE, which
only
nating MARKS and
that a
transmitted
has
one
stop bits represented by MARK. Thus
mand to
it back
uses
The
see
Section 10.
The preset default state
the XMT line
the
new
CONTROL command to change things. The
lines.
XMT line
communication
BREAK
corresponds
legal states
BREAK
word
or
more MARK bits in
set
the XMT line to
to
MARK (1).
of
the
is
MARK.
setting will remain until you either turn the computer
has
very limited use and
signal. The
to
the binary 1 state. A
corresponds
of
any RS-232-C
SPACES.)
is a SPACE
would
other
be. This
lines
of
Once
few
users
to
interfere
world
the
BREAK
to
binary 0. (Actually, since MARK and
SERIAL
What
distinguishes
which
the
is
a lot longer in duration than the
is
it-
in particular, each
SPACE
will
you change any
(0)
depend on
DTR
and
with
the normal transmission
only
practical use
is
simply a period
BREAK
INTERFACE signal, all data consists
true because any transmitted
to
send a
, then a little
your
RTS
lines
of
..
t;i!iJMI;!ij@l
is
BREAK
BREAK
, first issue a CONTROL com-
while
application. For some guidelines,
is
OFF
them with the CONTROL command,
will
of
control
of
holding
a period
from
word
later issue a
. The preset default state of
key
be concerned
of
the XMT line
the XMT line
is
called MARK,
of
the state called
SPACE
other
uses
of
time
word
ends
with
one
control
off
or
issue
has
no effect on these
with
it. If
of
data . In
out
are the
of
alter-
SPACE
that a
ALWAYS
or
more
to
another
is
is
set
Page 31
The form
34
of
the CONTROL command in
XIO
34, #IOCB,
specifies the CONTROL command.
Auxl,
Aux2, "Rn:"
BASIC
is:
The #IOCB specifies the
IOCB
is
open to the
not doing concurrent 1
Aux1
is
the sum
dix B to control
may add the numbers together yourself and put the resulting sum in your program
for Aux1 ,
for you.
is
Aux2
not used by this command; the best value to specify
of
DTR, RTS
or
you may put
" Rn:" specifies the
put
1,
2,
3,
or
4.
If you
port
1.
IO
CB
number
RS-232-C
/0
three numbers chosen from Tables
RS-232-C
omit
SER
and the port
, and XMT. Choose
an
expression for the sum and let
SERIAL
n, the interface modu le handler
(1-7)
IAL
INTERFACE
is
INTERFA
you wish to
port, specify
open through
only
one
CE
port you are acting on. For n you
use
for the command. If no
an
unused IOCB. If
an
IOCB,
B-9, B-1
number
BASIC
use
0,
and
B-11
from each table. You
do
is
zero.
wi
ll
assume
that IOCB.
in Appen-
the arithmetic
you;nean
Page 32
8
OPENING
A PORT
BASIC
The
commands
PRINT,
language.
You must open
INTERFACE
or
The OPEN
LIST, SAVE
read its status. You may configure a
OPEN #IOCB,
IOCB
is
the
must use .
another
file
OPEN and CLOSE , and the 1/0
described here should be familiar from using the BASIC
an
IOCB (using the BASIC OPEN
port
before you can read
command
number
Any
is
already open
in BASIC is:
Au
xl , Aux2, "Rn:"
of
the IOCB that
IOCB
number
(1
through
from
other
through
it.
1/0
it,
write
port
without
BASIC
7)
may be used .
COMMANDS
commands
command)
to
commands
GET, INPUT, PUT and
to
a RS-232-C
it, start
having opened it.
Concurrent
for
the opened
Do
not
use an IOCB
SERIAL
Mode
1
/0
port
if
CLOSING
A PORT
Aux1 specifies the
• 5 signifies that you are going
1
/0)
• 8 signifies that you are going
• 9 signifies that you are going
Mode
•
13
signifies that you are going to use the
Mode
is
Aux2
Rn:
R:
one
Having
with
not
is
the
RS-
is
int
erpreted
time.
opened and used a
the
BASIC command
direction
1
/0)
1
/0,
full
duplex
used in this
232-C SERIAL INTERF
as
Rl: . For a given
of
)
command
port
CLOSE, as
CLOSE #IOCB
the port:
to
use the
to
use the
to
; make Aux2 ze ro.
ACE
port
, you may disco nnect th e IOCB by closing th e
follows:
port
for
input
only
(Concurrent
port
for
output
use the
port
no more than one IOCB may be open at
port
port
being
for
ope
only
(Block
for
output
input
ned. n can be 1, 2,
or
only
output
Mod
(Co
ncurr
(Conc
3,
Mode
e 1
/0)
ent
urr
ent
or
4.
port
IOCB
is
the IOCB
number
previously opened.
Page 33
CLOSE
number
only
way
is
also used to terminate
is
the one
to
through
terminate
which
Concurrent
Concurrent
the
Concurrent
Mode
1/0
Mode
Mode
from
1/0. In this case the IOCB
1/0
is
active.
a program.
CLOSE
is
the
Note:
To restart
with
When
output
Closing a file does
configuration parameters after closing the
ing sent at the
l.#idhl;lijjl
232-C
The exclusion
or
Always close
Concurrent
the OPEN
you
CLOSE
buffer
Note:
other
program failure.
Pressing l.iiiW+;iijjl on the
most
in the loss
be "
1
is
Failure
peripherals (o r even
of
the
1/0
of
data being held in
interrupted"
is
SERIAL
/0
port
applies to the
RS-232-C
in the
SERIAL
Concurrent
Concurrent
Mode
command.
the IOCB, all data in the
is
sent.
not
change the configuration
to
terminate
system's registers and pointers. This
by the
time
a short burst
INTERFACE port.
of
peripheral I
INTERFACE
Concurrent
other
I.UiliMM;I¥!+1
l.fW#&i;iiJ.ijl
CLOSE
Mode 1/0.
Mode 1/0
1/0
to the port, you must first reopen an IOCB
Mode 1/0
SERIAL
computer
input
and
and
was pressed.
of
random data
/O
to
anything
command.
port
open, you
Close the
before closing anything e
input
buffer
is
lost, and all data in the
of
the IOCB. You may change any
port
.
properly
INTERFACE ports)
closes all open IOCBs and reestabJishes
output
buffers. The interface
so
transmit
to
an
active
other
than the active
If you have any
cannot
Concurrent
before
method
only
part
Another
Concurrent
other
close it
Mod
will
e 1
of
while
/0
lse.
to
attempt
probably
closing files results
of
the character be-
possible effect
Concurrent
peripheral device
port
module
Mode
one
first.
ing 1
/0
result in
1/0
Mode
open
may
RS-
port
to
of
it
AT
ARI
BASIC
STATEMENTS
1/0
If
files are
comes
IOCB
ATARI BASIC
Modes. These
you have opened IOCB
open and change Graphics Modes. For this
used
your
be closed before any other program files.
Note:
before any
This section contains
SERIAL
stand the material in Sections 4,
on
opening
not
specifically closed, BASIC
to
the end
number
when configuring a serial
other
Always make sure that an active
INTERFACE ports. Before reading this section you should read and
of
the program. All files are closed in the descending
you have assigned.
has rese
two
files. Then,
other
and closing ports.
rv ed IOCB
IOCBs are user programmable.
#6
when
closes
occ
information
and then use the LPRINT
port
your
ur.
5,
will
#7
for LPRINT and IOCB
and IOCB's
program ends, the serial
on
how
and
6,
close them
re
ason, it
numbered less
Concurrent
these statements are used
Appendix
when
it interprets END
#6
However,
command,
is
B, and the preceding material
prob
suggested that IOCB #5 be
than #5 be used for
port
Mode
1/ 0 IOCB
order
of
the
for the Graphics
lems
will
occur
or
have IOCB #7
will
automatically
is
closed
with
the
under
or
if
-
Page 34
GET,
INPUT,
PUT,
AND
PRINT
The BASIC
PUT and PRINT . Refer
input
statements are GET and INPUT. The BASIC
to
the
AT
ARI
BASIC Reference
Manual
statements. In this context, PRINT and INPUT must always
IOCB
number.
Formats: GET
avar-
-Any
exp
The formats are given here
#IOCB
IN PUT
,var
#IOCB{;}
{ avar[, { avar} ... ]
{,}{svar}[,{svar}
PUT
#IOCB
,aexp
#IOCB{;}
PRINT
Arithmetic
expression,
variable
exp[,exp ... ]
{,}
[;exp ...
whether
as a reminder
... ]
]}
a string expression
or
.
an
svar - A string variable
Any
string variable, string
ATARI
BASIC Reference
(See
var -
the
INPUT and PRINT are line oriented. They process a
A line ends
one
preset
output,
and
statement
if
your
translate
an AT ASCII
for
you) can be used
CR
to
EOL on
will
not
finish until an EOL
mode
will
EOL
input
not
with
use GET instead.
or
arithmetic
Manual
for details.)
"l
character. The translation
to
translate the EOL character
.
An
EOL
is
required
is
produce
read in.
it on
If
your
input,
you should
ine"
for
input
of
mode
INPUT-
does
output
for detai
arithmetic
statements are
Is
about
include
these
the
proper
expression
characters at a time.
you
~
set
up
(or th e
to
an ASCII
CR
a BASIC INPUT
not
have EOL,
not
use INPUT, but
on
or
Remember that
is
with
not
optiona
mand, EOL
When
you use a BASIC
for
BASIC. For exampl
of
digits
must be separated
Reference
Manual.
you place a
produced
input
e,
l sign, decimal
by
commas
comma
when
statement, the
if
you read
or
or
semicolon at the end
the PRINT
into
numeric
point
, and
EOLs.
For
input
if
GET and PUT are character-oriented. You can
at a time. This
over
what
BASIC
input
is
much
slower than INPUT and PRINT,
you send and receive. You may alternate between the different types
statements, and between the
output
necessary.
Concurrent
opening
first
1/0
operation, and then
tions
START CONCURRENT
BASIC
patible device
after the START CONCURRENT
program
Mode
input, or
the file for
Concurrent
concurrent
doing
to
that port. In CONCURRENT
MODE
is
executing
as
they
other
commands
is
sending characters
arrive
into a holding
Mode
1/0, executing a START CONCURRENT
normal BASIC INPUT,
MODE
1/0
command, 1/0
for
you. For example,
to
the
computer
MODE
1/0, those characters
buffer
by
perform an INPUT statement to that port, the
for
the
input
data.
of
a PRINT com-
command
data must be in the
variables, the
exponent.
more
input
(full-duplex) 1
is
executed.
Multiple
details
or
output
but
it gives you
see
statements,
input
the
only
to
/0,
input
the same
is
proper
form
must consist
numbers
ATARI
BASIC
one character
more
control
port
performed by
MODE
GET,
PRINT and PUT opera-
1/0, after you have performed the
is
through
the
computer.
computer
going on at the same
if
your
RS-232-C comthe interface module,
will
be saved
If
you subsequently
will
just
look
in that buffer
for
time
your
of
if
Page 35
Output
output
For this reason, full-duplex operation
Block
blocks (whenever
or
block
1/0
Block
time."
Block
(the
rent
rent
Note:
face module. This may result
RS-232-C peripheral. To avoid this problem,
may be
in Block
Mode
PRINT statements). The
over the RS-232-C
port
is
Mode
Mode
word
Mode
Mode
On
done
either in Bl
Mode,
output
not
being used
there are no restrictions on using
1/0
size
option
do
sends
32
characters have been collected by the handler from
SERIAL
is
the
only
of
the
1/0 output). 8-bit words may
1/0.
rare occasions, the Operating System may r
ock
not start
your
data
computer
as
it
is
when
mode in
SET
BAUD
in part
Mode
Concurrent
is
not allowed
out
to
waits
INTERFACE
Concurrent
which
RATE
be
or
all
or
in
Concurrent
Mode
1/0 before
with
th~
interface
while
the interface
port
. Between blocks the
Mode
other
you can transmit
command
transmitted in either Block
of
the
block
use
Concurrent
Mode.
doing
Block
Mode
module
1/0
in 32-character
module
is
active,
1/0 devices at
5-, 6-or
will
not
work
ese
nd a
block
being sent
Mod
e 1
When
you
the
output.
output.
your
sends the
computer's
so
if
you
the
"same
7-bit words
with
Concur-
or
Concur-
to the inte
twice
to
/0
oupur.
do
PUT
use
r-
the
Concurrent
gram tries
to
a 32-byte buffer.
been sent they
place
The buffer
transmitted at the Baud rate you are using. Your program
space becomes available in the buffer. If you
up, use
and let
output
Concurrent
Mode
rent
allowed
duplex
input
to 300 Baud.
Concurrent
the RS-232-C
buffer
If the buffer fills, the data that
newer
the
STATUS
REQUEST
you can program the machine
be
used
described in Section 10, Th e STATUS Command.
Mode
1/0
output
to
output
concurrently
will
the STATUS
your
program
statement.
Mode
1/0
if
you
mode. If you select anything
them at the same time. The 5-, 6
Mode
with
GET
data.
REQUEST
can be used
to
determine some kinds
any characters to the interface
As
will
be sent
with
fill
up
when you try to
command
use
1/0
output
do
this. Also note that 5
1/0
SERIAL
INTERFACE port. Your program must get the data
or
INPUT before the buffer fills
What
command
does
not
long
as
there are characters in the buffer
as
fast
as
the execution
to find
that information
input
may be used at the same
(full-duplex operation) .
other
input
data
is
placed in the
has
been in the buffer the longest
your
program
will
tell you
to
find
out
how
to
decide
of
errors in data reception and parity. This
work
in blocks . Instead ,
module
possible. This " draining"
of
other
BASIC statements in
output
out
-, 6-,
-,
and 7-bit words can be
will
many characters are in the
characters faster than they can be
do
not
how
much
to
decide
Note
or 7-bit
than 8-bit
see
if
when
words
input
or
data
is
that characters are missing. The
data
has
to
do
, they are first moved in-
want
your
buffer space
whether
time
that Block
can
words
buffer
will
been lost this way. STATUS
an
INPUT. STATUS can also
whenever
of
will
be held
program
or
not
you are using Concur-
Mode
only
you cannot
input
as
it
be lost from the buffer.
will
your
pro-
which
is
have
not
the buffer takes
your
program .
up
until
to
be
held
has
been used
to
execute
output
be
input
output
at speeds
received from
out
be replaced by
input
is
in half-
of
buffer,
is
fully
an
not
and
up
the
so
Page 36
LIST,
SAVE,
lOAD, AND
ENTER
The BASIC statements
operations. Their operations can be
other
1/ 0 operations.
gram. This section defines
LIST, SAVE,
Each
statement will
how
LOAD
thoug
and
ht
of
input
these statements
ENTER
as
consisting
or
output
work
perform
all
with
the RS-232-C
"compound 1/0"
of
combinations
or
part
INTERFACE ports.
Each
of
these statements can be
or
more
input
or
output
clude
any configuration
clude
any START CONCURRENT
input
statements
Instead, enter
put
th e program on cassette
(LOAD
your
of
and
prog ram
ATARI BASIC from the cassette
example
of
the type
of
program needed.
Since the configuration commands may be executed
RS-232-C
modes, and
gram
ternal 8-bit tokenized
the program
interface
imum
therefore be able
SERIAL
to
the RS-232-C
INTERFACE port, you can configure the Baud rate, translation
so
forth, before you execute a
SERIAL
format-
to
another ATARI
module
status checking, the program
rate allowed by the Baud rate you have selected. The receiving device must
to
receive the data at that rate.
thought
of
operations, then a
RS-232-C
ENTER)
as
INTERFA
SERIAL
MODE
1/0
with
the RS-232-C
data to a program you
or
diskette. Then you can
or
diskette. The REC
CE
port
this
will
probably
Home
Computer
as
consisting
CLOSE
of
first an OPEN, then
. These operations
INTERFACE ports, and they
action. Thus you
EIVE
without
LIST
or
SAVE
will
send the program in BASIC'S in-
be useful
System.) Since
will
simply be sent
cannot
SERIAL
write
INTERFACE ports.
in ATARI BASIC and
ENTER
th e program to
program on page
opening
to
the port. (Saving a pro-
only
if
you are sending
LIST
out
of
your
SERIAL
do
not in-
do
not
use
the
52
an IOCB to a
has
no
implicit
at the max-
of
pro-
one
in-
two
is an
Basic 1
10
Command
s 35
Page 37
9
STARTING
Use the
Mode.
The
rent
nector
example,
the
Operations that are allowed
put
that port, and
There are
The main difference between them
fer bu il t
you
Assembly Language these
command.
command
This
mode
port
must be open before you can start
Mode
1/0
can be performed.
cannot
controller
operations
two
into
the interface
to
give
your
START CONCURRENT 1/0 (XIO 40)
may be used for
is
in effect,
be performed; 1/0
jacks can still be performed.
to
the active
CLOSE
different forms
own
no
other
Input/output
while
port
commands
of
module
buffer
to
two
options are really just different forms
(GET
the START CONCURRENT
CONCURRENT
MODE
to
start
output
Concurrent
to
the hand ler
and must be used for
Concurrent
1/0 operations that use the
operation
to
the keyboard
Mode
, INPUT, PUT, PRINT) , STATUS
that port.
is
that one specifies the use
handler (in the computer) , and the
so
to
editor
1/0
it can be any size you wish.
input
Mode
1/0.
computer
another
, the screen
is
active are
MODE
of
a small
1/0
Concurrent
or
full
duplex
Once
Concur-
1/0 con-
serial port,
editor
input
and out-
commands
1/0
command.
input
other
allows
of
the same
1/0
.
for
, and
to
buf-
In
The
form
of
the START CONCURRENT
specify
to
the BASIC interpreter.
is
even in the
The handler
you start
inserted in
other
Therefore,
current
None
module
quite
With
before the buffer fills
long-range average you read the data
arriving, you
have
example READING A DIGITIZER, Section
to slow
Baud rate) .
small buffer puts demands on
your
own
1/0 buffer
specify in this
being run ,
Concurrent
arrays
1/0
of
these problems
handler, since that buffer does
small
any size
to
put
down
form
, and the BASIC array you use
Once
but
arrays
are
immediate
for
the interface
unpredictable
or
variables
if
using user-program supplied buffers, it
when
(32
bytes) and this may
input
will
up
with
the device that
Even
mode.
Mode
the program stops. See " Closing a Port
buffer you need
up
eventually lose data anyway. If this
losing it (which
if
your
program processes the data fast enough in the long run , a
has
two
created, BASIC arrays are
moved
module
1/0. If BASIC
locations.
or
even in
occur
if
you use the buffer
with
data that you have
is
your
MODE
disadvantages. The
whenever
is
told
Ongoing
your
not
not
to
is
not
sending the data
program
1/0
command
as
the buffer may be moved by
not
you add
of
the location
is
allowed
concurrent
BASIC program, possibly destroying it.
move.
be adequate for all programs.
GET
or
out
of
all that bad in some
11), or
to
or
to
move
is
imperative to close the Con-
which
On
the
INPUT the data
not
yet read.
the buffer
you
will
to
you (such
get data
which
command
moved
delete a BASIC statement,
of
the buffer
the array, data
input
,"
Page
is
built
other
more
is
the case, you
cases-
have
quickly
allows you
is
complicated
while
a program
only
could
wind
31.
into
the interface
hand, that buffer
from
the buffer
Of
course,
slowly
to
figure
as
setting a
and often .
than it
will
see
out
if
program
when
will
up
in the
either
a way
lower
to
be
in
is
is
Starting Concurrent
Mode 110
37
Page 38
The BASIC
do
some processing
300 Baud
enough
long
pays
GET), and it's really helpful if the
Even if
you
the
Note: In
the
input
ASCII
translation
discussed
A large
would
to
as
there
to
read a
the
processing
order
must
CR
input
more
interpreter
on
be fast
read in a line
is
enough
whole
inputting
line
device
time
to
perform
either
must
terminate
mode
of
the
fully
in Section 6.
buffer
will
can be
quite
slow
each and every character
for
of
time
of
BASIC.
input
On
data (terminated
between lines
at a
time
inputting
will
not
pause,
you need. The best
line-orie nted
have an ATASCII EOL at
each line. In
interface
be needed
module
if
you
large, occasional bursts. For example, if
process a line
allow
lines
not
get
mine
the
of
to
"back
too
many
needed size
input
because some lines require a
up"
in
the
input
buffer. This
of
these
of
"slow"
your
lines at once. You
input
buffer
relative
to
that
the
other
hand,
by
CR)
for
your
program
(use
INPUT
device
will
inputting a whole
thing
to
input
using the BASIC
the
the
latter case,
port
to
convert
can read the data
you
do
not
will
by trial.
incoming
comes in. In
the
data, if
system
that
is
more
you
case, even
than fast
at 9600 Baud (960 cps) -
to
do
its processing. It
wherever
pause
do
end
of
know
lot
of
work
will
possible instead
for
you
line at a
is
try it.
INPUT
each
you
must
the
CR
from
the
how
long
work,
fine
as
probably
after each line.
time
may
statement,
input
line,
configure
into
EOL. This
buffer
it
will
you
will
long
as
have
to
want
or
only
take
want
you
deter-
to
as
of
buy
an
the
is
in
to
to
do
number
The
the
arrive each second at 300 Baud; 480 may arrive in
course,
there
are
will
not
but
the
What
buffer
patible device;
of
characters
higher
if
the
the
sending
"gaps"
be
important.
actual
or
it
amounts
faster than
that
can
come
in every second
Baud rate
between
effective data transfer rate may be smaller.
to
is
the
that
is,
the
device
characters
Thus
the
that
your
interface
your
faster characters can arrive.
the
same
does
not
run at
the
maximum
anywhere-
Baud rate
controls
then
the
maximum
program in BASIC must
module
puts
them
there
BASIC program must read
the
INPUT
depends
Thirty
time
speed
from
the
data faster than
device's effective data transmission rate (on average). You can
setting
(that depends
mode
In BASIC,
input
Specify
puter
this
the
Baud rate, and possibly
on
the
of
operation.
the
START CONCURRENT
buffer looks like this:
XIO
40,
#IOCB,
the
appropriate
assumes
is
the
way
port 1 for
the
device itself).
0, 0,
"Rn:"
open
R:. You
RS-232-C
there
are
other
Be
prepared
MODE
IOCB, and specify
must
specify
handler
is
told
to
1
/0
operation
1,
zero
use its
ways
to
to
experiment
2,
3,
or 4 for n in
for
both
own
control
which
Au'
input
on
the
Baud rate
characters may
at 4800 Baud.
Of
possible speed -if
of
the
characters
data transfer rate,
data
from
the
input
your RS-232
-C
com-
your
control
x1
that
rate
by
the
transfer rate
to
find
the
best
uses
the
built-in
Rn:. The
com-
and Aux2, since
buffer.
38
Starting Co ncurre
nt
Mode
If you
the
opened
See
110
opened
port
is
open
for
Section 4
the
both,
for
port
for
then
details
for
input
only,
Concurrent
on
output
only,
then
only
then
only
concurrent
Mode
input
and
how
these various modes operate.
concurrent
input
is
output
are started (full
output
started. If
is
enabled. If
the
port
duplex).
was
Page 39
In
BASIC,
input
calling the Central 1
the type
into
SERIAL
10
20
30
40 OPEN #FILE, 13,
50
60
65
70
80
90
100
110
120
125
130
140
the
START
CONCURRENT
buffer for the handler is specified by a series
/0
(CIO) through a
of
operation and specify the buffer address and length. Poke these values
the IOCB corresponding
INTERFACE
DIM
BUF$(500),
LET
RSTART$ = "hhhiJLVII":REM * and
LET
FILE
port. Here
RSTART$(
= 2
0,
LET
IOCB =
LET
BUF = ADR(BUF$)
LET
BUFLEN = 499
LET
RST
POKE
832+
POKE
832+
POKE
POKE
POKE
POKE
DUMMY
ST
ARTST
16*FILE
ART
= ADR(RST ART$)
IOCB+2
IOCB+
832+
IOCB +
832 + IOCB +
832+
IOCB+
832 + IOCB + 10,
= USR(RSTART,IOCB)
ATUS =
to
the IOCB you have opened for the
is
an
7)
" R4:"
, 40
4,
BUF-(INT(BUF/256) * 256)
5,
INT(BUF/256)
8,
BU
FLEN-(1
9, INT(BUFLEN/256)
13
PEEK(832
+ IOCB +
MODE 1/0
USR
operation in
of
POKE
function. The
example program:
dare
NT(BU FLEN/256) * 256)
3)
which
you supply the
statements followed by
POKE
statements specify
RS-232-C
inverse video
In this program, a full-duplex file
INTERFACE port
70
set
up some values that are used by the
operation. The buffer
returned by the
IOCB. The address
of
the IOCBs (832), a value specifying
number
is
set
1/0
call.
to
poke
4 (the
Each
is
opened through IOCB #2 to
13
in line 40 specifies full duplex). Lines 50 through
START
CONCURRENT
RS-232-C
up in lines 80 through 130. Line 140 gets the status value
POKE
statement puts some needed value into the
is
specified
as
the sum
which
of
the following: the first address
IOCB, and
an
"Offset"
into
for the particular value you are poking. The value specifying the IOCB
the IOCB number through
FACE
port
(in this
case
we
which
set
you have opened the
the variable IOCB
RS-232-C
to
32
in line 50, since the IOCB
SERIAL
#2).
40
The values poked into the IOCB are:
into locations 4 and
to Offset 10.
Pay
5;
the buffer length (minus one) into Offsets 8 and 9; and
spec ial attention to the fact that the buffer address and the buffer
length are both 2-byte values, requiring
Those
complex
looking expressions
into Offset
two
in
lines 90 through 120 are simply splitting the
address and length into their low-part and high-part
2;
the buffer location (address)
pokes to put them into the IOCB.
so
each part can
individually.
Line 130
arguments: the address
used in specifying the poke locations). The address
in line
function itself
this character sequence carefully before you call
and
ca
lls
the 1
/0
system through a
of
the function, and the IOCB specifier (the same
70,
so
you
see
that the function
is
the odd-looking sequence
your
program will probably produce
USR
function. This
of
is
the character array called
of
characters in line
this
USR
an
unrecoverable failure.
this
USR
USR
function-
function
function was found
RSTART$.
20.
Be
any mistakes
SERIAL
MODE
1/0
the IOCB
is
16
times
INTER-
13
in-
be
poked
has
two
as
was
The
sure to type
is
Starting Concurrent Mode 110 39
Page 40
Assembler note: This
PLA; PLA
X-register,
by
; TAX;
jumping
JMP
but
leave the return address on the stack,
to
it at address
USR
function
is
the
following
in Assembly Language:
$E456. The first four instructions get the IOCB
so
the 1
/0
sys
E456.
number
tem
is
PLA
into
the
"called"
;
Line 140 gets the 1
if
you
do
not
1
if
all
went
prints after
does
not
get any meaningful value.)
By
using
USR
of
success
not
occur
Once
the 1/ 0 . The
have the value 1. Therefore,
.
this
START
concurrent
be full-duplex
the
output
/0
status after the
want to. To get status,
USR
PEEK
well. Otherwise, the status
an
1/0 call fails. (Note that the variable
to
call the 1
1/0
is
active. The operation may be either
(as
specified in the OPEN). If you are
buffer
/0
system you are bypassing any checking by
only
result
CONCURRENT
is
built
into
the interface
of
no
BASIC error
MODE
buffers are accessed through normal
Section 8
Remember,
Mode
something outside
There
buffer
for
detai
Is.
BASIC
input
is
a 256-byte area at address 1536 (decimal)
or
anything else.
may move arrays around if
continues after
your
your
buffer array.
Be
sure that area
program stops, this may result in
wish . Most ATARI software does not
area
as
a buffer, read the instructions that
into
low
1536 splits nicely
90 through 120
of
the program
and high parts
as
shown on page 39:
1/0
call. You
do
not
need
at Offset 3 in the IOCB. The status
is
any
input
use
the same
error
1/0
module
is
this area.
come
(so
as
the
error
number
DUMMY
will
be that Offset 3 in the IOCB
will
occur
operation
in-only
running
in the program above
and
no
has
been performed, the
or
full
duplex
handler. The
and
output
your
only
being u
with
does 256),
statements in BASIC.
program stops. If
which
However
you may
sed
for the one
, if you plan
your
ATARI software. Address
so
you could replace lines
out-only,
to
get the status
that
BASIC
TRAP you
or
out-only
input
and
Concurrent
overwriting
use
as
thing
to
will
BASIC
of
set
or
it may
output
an
use
be
the
will
will
,
See
input
you
this
90
100
110
120
If you
since
POKE
832 + IOCB + 4, 0
POKE
832+10CB+5
POKE
832+
POKE
832+10CB+9
use
this area, you
BASIC
will
IOCB+
8, 0
do
not move it.
, 6
, 1
not
need
to
worry
about
it
when
your
program stops
Page 41
BASIC commands that
BYE,
DOS, NEW, and
closes the IOCBs automatically.
will
automatically close all
ENTER.
Allowing
your
of
the IOCBs are: RUN, END,
program to
"run
off
the
end"
also
If BASIC
IOCB
usually involves serial
to the
and IOCB #6
your
that
There are
These are 1
BASIC
IOCBs.
If
you have
rent
the
file
any case , the
is
allowed to close
number
Concurrent
is
Concurrent
way
Concurrent
cases
/0
error, program error, pressing the
command
followed
Mode
1/0
immediate
individually
in descending order.
1/0
reserved for graphics,
1/0
where
STOP. The BASIC
and close
mode. If you have not
with
Concurrent
your
IOCBs, it
port
1/0, it
is
not
port
itself). Therefore, since IOCB
and IOCBs
1/0
will
your
the above suggestion using IOCB #5 and wish to stop Concur-
your
the BASIC
1/0
numbered
be closed before
program may stop
files, you can enter the BASIC
command
mu
st be closed first.
will
close all open IOCBs according to
However,
allowed
we
command
followed
since a
during
strongly suggest that you use IOCB #5 for
less
your
but
1!Ji1m
the suggestion, you must close each
CLOSE
CLOSE
Concurrent
#7
than 5 for
files.
the IOCBs
key
CONT
will
(CLOSE #4,
operation
1/0 (unless it
is
reserved for LPRINT
your
program files.
will
remain open.
when
enabled, and the
not
close any open
command
CLOSE
END from
#3 , etc.). In
to a file
In
is
Page 42
10
USES
OF
STATUS
COMMAND
THE
The STATUS command
SERIAL
certain specific
check parity, and
amount
fect. STATUS also allows you
CTS,
The
SERIAL
Mode
formation (via the STATUS command) from any
The information returned by a STATUS
or
the STATUS command
are,
When
but
in the effect
INTERFACE
error
of
data in the
CRX
(and the state
STATUS
not
but
the state
command may be issued
INTERFACE port. You may issue the
1/0
is
in effect. If this mode
Concurrent
you cannot check on
Concurrent
of
the
of
the STATUS
is
port
and the state
conditions
so
on. The STATUS
input
of
Mode
1/0
al
lows you
Mode
1/0
control
STATUS
useful
lines can be checked. There are other
for
to
find
and
output
to
check the state
RCV
at the
is
in effect
is
in effect.
to
the
state
is
not
in effect, you get
command
determining
of
the interface
out
why
command
buffers
time
only
command
see
of
in the
while
you issue the STATUS command).
through
command
to
When
how
the
control
two
COMMAND
many
facts
about
an
RS-232-C
module
certain errors have occurred,
allows you
Concurrent
of
the RS-232-C
an
IOCB opened
whether
a port, you cannot obtain status in-
other
port.
is
different according
Concurrent
full
your
lines DTR,
no
cases.
. You can chec.k
to
Mode
control
or
Mode
input
and
CTS,
information
minor
determine the
1/0
is
in ef-
lines
DSR
to a RS
not
1/0
output
CRX
about
-232-C
Concurrent
to
whether
is
in effect,
buffers
and
RCV
buffers,
differences
for
to
,
.
In BASIC, the STATUS
command
The first
retrieve status
The STATUS
STATUS
Here, #IOCB specifies the IOCB
C
SERIAL
Concurrent
Avar
avar
BASIC calls the 1
returned
This
any 1
itself to
puts the
the
OPEN the IOCB, since
ERROR
the STATUS call was completed
ror
number
- that is, you must code
is
the STATUS
which
command
#IOCB, avar
INTERFACE port. You may issue this statement
Mode
is
a variable
will
be
set
to
/0
is
the 1
/0
number
/0
ERROR
is
the same kind
call,
but
see
if the 1
number
130 means " Nonexistent Device Specified." The status
in the avar. This status
codes
greater than 127 if there was some
REQUEST
command.
is
placed in a small status area by the STATUS
looks like this in BASIC:
1
/0
is
started.
which
in the other BASIC 1
/0
will
get the status
the
input/output
system. Since the 1
system's determination
was completed
-for
example, you
an
unopen IOCB does not specify any peripheral device and
command
multiple
This
(1-7)
through
system's one-byte status that
of
number
/0
without
without
is
implemented
BASIC statements
is
followed
of
/0
system call here
about
returned
statements, BASIC looks at the
number
will
get
error. The status
by
which
the
STATUS
how
to
error. The STATUS
can be interpreted just like
an
ERROR
problem
as a "compound"
to
get the status.
uses
of
the
PEEK
function
command.
you have opened the
to
the
port
before
sta
teme
nt itself. That
is
returned
is
STATUS, the value
the STATUS
BASIC by the 1/0 system after
130
number
with
command
command
if
you neglected to
number
the STATUS call.
will
be some er-
will
to
RS-232-
or
after
is,
when
went.
number
simply
one
of
be 1
if
The Status
Command
43
Page 43
If the STATUS cal l
is
successfu l, up
to
four
bytes
of
information
are stored in locations 746, 747, 748, and 749 (decimal). Location 746 always contains
bits relating to the status his
three locations
Concurrent
If
CRX,
and
will
contain buffer use
Mode
RCV
on the RS-232-C
1
/0
is
the RS-232-C
information
not
active, 747 contains status bits relating
SERIAL
INTERFACE port, and locations 748 and 749
SERIAL
if
Concurrent
INTERFACE port. The
Mode
tory
of
hold nothing.
Table
10-1
shows the
each bit a decimal value
off" or
"
number.
but
0), adds
The meaning
first here
is
definition
which
to
the total value
of
each
of
a BASIC example
of
the
shows
of
these
showing
error
bits in location 747 . The table gives
how
that bit,
the byte
error
bits
how
if "on"
when
is
discussed later in this section,
you can check one
or 1 (as
interpreted
of
160 STATUS - 1, IGNORED
170
LET
180
ERRORBITS = PEEK(746)
IF
INT(ERRORBITS) < > INT(ERRORBITS + 0.5) THEN PRINT
/ 128
" OVERRUN!"
error
status
other
1
/0
is
active.
to
DSR, CTS
opposed to
as
a decimal
the bits:
,
In
statement 160 the STATUS call
not
use this variable, because
STATUS call must be made in
Statement 170 peeks at lo
decimal
number
of
the error bit being c hecked (this
is
made
to a dummy
we
assume the STATUS call
order
to
put
a value
ca
tion 746. This value
variable IGNORED.
into
is
then
information
Table 1 0-1). This value becomes the variable ERRORBITS.
0, then adding 0.5
integer part
In the above example,
we
table,
Statement
find this to be 64.
180
will
not
increase the integer part
of
the value changes
we
when
are
checking
PEEK(746)
0.5
is
makes the comparison. If there
is
added.
for the
divided
of
the
BYTE
OVERRUN error. From the
by
twice
is
an error, OVERRUN!
printed.
Table 10-1
Decimal Equivalent Error
Decimal
128
64
32
16
8
4
2
1
Repr
esentation
of
the
Error Bits in L
Error
Received data framing
Received data byte overrun
Received data parity
Received data buffer
Illegal
option
External device
Error on
Error on
combination
not
block
data transfer
command
fully
to
will
work
location 746.
divided
If
the
bit
being check
number.
If
the bit
64 (128).
ocatio
error
error
error
overflow
error
attempted
ready flag
out
interface
module
We
all right . The
by
twice
the
is
taken
from
is
1, the
will
n 746
do
is
be
Page 44
Following are the descriptions
STATUS
command.
of
these
error
status bits in location 746 after
ERROR
STATUS
BITS
RECEIVED DATA FRAMING ERROR (bit 7, decimal value 128)
This
error
bit
indicates that a framing
from
the external RS-232-C
not
a STOP bit (9th, 8th
error
can be caused either by garbled data (for instance, noise on the
or
by
improper
This
condition
in the ATARI 850 Interface
of
8-bit data. The interface
5-bit data. In both
received (not
In the 8-bit data case ,
about
the
Mode
input
mand
or
cases
, the
while
the
and reopen the
error
occurred. The
Concurrent
control
1/0
XIO's (but
is
not
configuration to receive the data (for example,
is
monitored
cases
the
time
error
any
is
active. The
when
you
error
is
monitored
Concurrent
Concurrent
Mode
1/0
not
active.
compatible
or
7th in the
in
one
Module.
module
, the
error
you read it
where
time
CLOSE
Mode
error
is
all), and it may be cleared
the
after it occurs by issuing STATUS
error
bit
the
by
input
Mode
bit
in the interface
not
active. It
error
was
encountered
device: the
cases
of 7-, 6-,
of
two
places: in the ATARI
The
computer
catches this
status
is
set
out
of
the
computer
will
be cleared
Concurrent
the interface
operation
IOCB and then issue STATUS
is
also cleared by most
1Oth
bit
or
5-bit received words). This
watches
error
if
you are receiving 7-, 6-,
at the
time
the erroneous character
holding
monitors the error, you may find
Mode
module
is
module
buffer) .
when
you issue the STATUS
IOCB. In the
and
active. In this case, you must close
is
cleared by STATUS
by
CLOSE
when
of
some character was
Home
for
this
while
cannot
of
in the data
wrong
error
the
7-,
be interrogated
to
determine
the configuring and
Concurrent
coming
phone
Computer, or
6-, and 5-bit
lines)
Baud rate).
in the case
or
out
Concurrent
com-
if the
when
Mode
is
In general, the
to
the most recent 1/0 operation
they are cleared
can
see
that the previous
RECEIVED DATA
error
This
too
busy
loading,
the first character
holding
error
bits read from location 746 after a STATUS request apply
to
the RS-232-C
as
the 1/0 operation
error
is
an
exception
BYTE
OVERRUN ERROR (bit 6, decimal value 64)
bit
is
maintained by the
to
read all the data
or
perhaps interrupts being masked
of
data
following
buffer. The
error
should
computer
as
it was arriving (due
the
not
SERIAL
is
started and then
to
this rule.
and indicates that the
off
totally). This
error
is
read
occur
at all
under
from
INTERFACE
set
to
the
normal
RECEIVED DATA PARITY ERROR (bit 5, decimal value 32)
This
error
bit
is
had the
This
character
out
error
of
the
wrong
maintained
parity. The
occurs
to
holding
during
the internal (INPUT,
buffer. The
by
the
computer
bit
will
not
the translation from the external (received) form
GET)
error
flag
and indicates that a received character
be
set
if
no
parity checking
form, which
bit
is
takes place
cleared
by
the STATUS
if the
error
computer
overly
heavy
error
is
flagged
port
and placed in the
conditions.
has
been enabled.
as
the data
only
port
; that is,
occurs. You
got
interrupt
when
of
the
is
read
command.
Page 45
RECEIVED DATA
BUFFER
OVERFLOW ERROR (bit 4, decimal value 16)
This error flag indicates that more data
buffererror
arrives from the
oldest
ILLEGAL
This error flag
Concurrent
input
or
words are allowed for
chec ked immediately after the
may be trapped) for the refu
quest. Error bit zero (comm and error, decimal value
bit
EXTERNAL DEVICE
This bit
Concurrent
MODE
one
external status lines not being monitored
is
ignored;
will
the interface
This flag
data
has
not been read from the buffer (INPUT,
is
maintained by the
RS-232
one
in the buffer. Thi s error bit
OPTION
is
kept in the interface
Mode
1/0
with
short words
output
is
only (short
set.
is
kept in the interface
Mode
1
/0
or
block
or
more
of
the external status lines being
if
none
proceed normally.
module
is
cleared by the STATUS
computer
-C
compatible
COMBINATION
is
not active. It
(7-, 6-, or
words are allowed in only) or
input
NOT
1
/0
is
output
is
being
Read
refuses the operation
5-bit)
at a
int
sed command
FULLY READY (bit 2, decimal value
module
not active. It
command
monitored
this flag bit
has
arrived than can be held in the
, and it occurs when the
device. The n
is
cleared by the STATUS command.
ATTEMPTED (bit 3, decimal value
module
is
with
maximum
erface
is
this bit
command.
and may be read by STATUS
set
by
an
attempt
the
port
rate
of
module
and may be read by STATUS
is
refused by the interface
(as
with
produces a
. Th e bit
set
whenever a
monitored
set by the
will
a STATUS request immediately after
with
Error 139,
GET)
soon enough. This
overflowing
ew
character replaces the
to
start
Concurrent
open
for
both
input
too
high a Baud rate (short
300 Baud). This
NAK (Error 139,
is
cleared by the STATUS r
1)
will alw
ays
be
4)
SET
not
be set and
START
is
BAUD
which
CONCURRENT
module
not
ON.
RATE
the
can be trapped .
input
character
8)
only
if
Mode
and
output
error
may be
which
e-
set
when
this
only
when
because
Any
of
the
command)
1/0 operation
DATA BLOCK ERROR (bit
This
error
bit
is
maintained in the interface
mediately after a
block
output
interface
blems in
module
communication
COMMAND
This
error
bit
mediately after a
This bit indicates that the interface
from the computer,
form the
command
command
, the data
. This
ERROR TO INTERFACE
is
maintained in the interface
command
or
(see
1,
decimal value
is
refused by Error 139,
block
was unsuccessfully received from the
error
should
between the
is refused by
that the interface
ILLEGAL
not
occur
computer
MODULE
module
module
OPTION
2)
module
module
an
did
and may be read by STATUS im-
which
in normal operation; it indicates pro-
and interface
(bit 0, decimal value
and may
Error 139 from the interface module.
not
recognize a
is
not configured
COMBINATION
can be trapped. In a
computer
module
.
1)
be
read by STATUS im-
command
properly
ERROR)
sent
.
by the
to
to
per-
it
Page 46
BUFFER
CHECKING
During
of
characters in the
the
you
When
about the readiness lines
the specified
anything useful after a STATUS request
face
that
affect the past status
whether
command)
active
Concurrent
characters in the
output
input
buffer in ATARI BASIC:
LET
BUFFERUSE = PEEK(747) + 256*
If you
only
want
to find
do
not need
IF
PEEK(747)+ PEEK(748)=0 THEN
or:
IF
PEEK(747)+
If you are using the built-in buffer,
bytes, then locatio n 748
747. The
Location 747
rent and past status
included. The past status
port
output
Concurrent
module
which
DSR, CTS
or
to
PEEK(748)
buffer holds
port
after a STATUS request. (Locations 748 and 749
will
contain the sum
was booted ,
was made
, and
not
you enable readiness checking before 1/0 (in the
will
have
Mode
1/0 , the STATUS
input
buffer in locations 747 and 748 , and the
buffer in location 749 . To find the
out
whether
multiply
by 256 :
< > 0 THEN
will
always be zero and you need
only
32
Mode
1/0
is
not active, location 747
(DSR, CTS
of
DSR, CTS
of
while
CRX
were supplied
of
these line
no
effect on the information supplied by STATUS .
, and
DSR,
CTS
or
to
the most recent STATUS
Concurrent
or
or
characters; location 749
, and
of
four
s,
which
command
PEEK(748)
not
there are characters in the
input
buffer
empty ...
input
buffer
if
your
supplied buffer
CRX)
and the data receive line (RCV)
when
there
numbers, shown in Table 10-2. The cur-
CRX
as
well
as
, and
CRX
applies back
Mode
1/0 was
to
a STATUS request).
is
supplied by STATUS . In particular,
will
return the
number
not
empty
to
will
is
no active
the current status
command
not
active (i.e. , the last
of
...
has
fewer than 256
look
only
will
never exceed 32.
contain information
will
Concurrent
to
the time the inter-
to the specified
No
other operations
SET
number
characters in
input
not
BAUD
number
of
buffer,
at location
of
contain
1/0 .)
of
RCV
are
time
RATE
Ports 2 and 3
CRX
, and
This
is a quick
STATUS #n,
or
to
check if it
IF
PEEK(7
In other words, the
and you can check them this
other
bits in the byte.
will
always show
DSR
as
being
ON.
way
to
check
XXX
IF
PEEK(747)
has
stayed ready since the last check:
47) > = 192 THEN always r
DSR
status bits are the most significant bits in the
CTS
and
CRX
as
being
whether
or
not a port
< 128 THEN no t ready ...
ea
d y ...
way
without
having
to
ON.
is
ready:
worry
Port 4
about
the states
The Statu s Co
will
show
sense
mm
of
and
CTS
byte,
the
47
,
Page 47
Table 70-2 Sense Values
DATA
SET
READY (DSR)
192 Ready
128 Ready
Not
64
0
CLEAR
TO
48 Clear
32
Clear
16
0
CARRIER DETECT (CRX)
12
Carrier
8 Carrier
4
0
DATA
RECEIVE
1
MARK
0
SPACE
*No
information
Not
Not
Not
No
No
now
now
ready
ready
SEND
now
now
clear
clear
now
now
carrier
carrier
(1)
(0)
(ON);
(ON);
now
now
(CTS)
(ON); on since previous STATUS
(ON);
to
send
to
send
(ON);
(ON);
now
now
(RCV)*
now
now
is
supplied
Added
on since previous STATUS
not
always on
(OFF) ;
not
(OFF) ; always
not
always on since last STATUS
now
(OFF);
now
(OFF); always
on
since previous STATUS
not
always
(OFF) ; not always
(OFF) ; always
about
always
off
not
on
off
the
past status
si
nee last STATUS
off
since last STATUS
since last STATUS
always
off
since last STATUS
off
since last STATUS
since last STATUS
Into Location
off
since last STATUS
747
since last STATUS
of
RCV.
48 The Status
Command
Page 48
1 1
TRANSFERRING
BASIC
SOURCE
PROGRAMS
SAMPLE
This section describes a pair
from
one
ATARI 800
programs demonstrate
shaking,
puter
sender
information
The
Likewise,
got
because,
grams
Both programs operate
starts
sent/received. Each program then opens its
(assuming
which
world.
with
trick
here
the
it,"
but
theoretically
show
by
dimensioning
the
What
an "
from
is
receiving program must
th e receiver must be ready
how
send/receive files are disk files).
Home
was described in Section 1,
is
meant here
I've
got
the sender.
that
the
, the sender
this
is
of
programs that can be used
Computer
an
example
it!"
message
sending program must
done.
on
one
line (up
its line array, and each
to
another
of
the
technique
is
that the receiving program
when
it
not
only
to
might
send the next line
to
255 characters) at a time.
is
PROGRAMS
to
transfer
over
the
telephone
called
an
overextended term in the
has
successfully received each line
not
miss
have
got
receive the next line
asks
its user
modem
"handshaking."
will
the "I've
the
line
immediately.
for
the
port
(R1
information
. These
respond to the
got
it!" message.
when
it
immediately
Each
filename
:)
and disk file
two
Hand-
com-
says
"I've
These pro-
program
to
be
of
The
RECEIVE
line. The SEND program
RECEIVE
line
In
prints
the
Then, in lines 570-590,
full
duplex:
mediate reply.
though
for
an EOL
The
RECEIVE
(lines 280-290, 530).
RECEIVE
540, 580) and echoes the data
opens
opened
mediately
INPUT
current
When
another
another
SEND program checks
coded
both
programs
program must be started first, in
will
program.
540,
the
SEND program gets a line
line
on
the
television screen
the
line
SEND assumes
(Of
course, this
it could.) In line 600, SEND waits
is
used
as
routine, meanwhile, has
closes the
the
modem
full
duplex: RECEIVE
after it
the
data
Mode
SEND gets
line
line
line
(EOF
modem
again and sends the reply (lines 610-630).
has
immediately,
data receive (line 620) .
the
of
data
of
data (lines 530-540) and
EOF
explicitly
when
a reply).
When
line 530 completes (the line
port
sent its reply.
but
reply, it
from
EOF)
knows
its diskette (lin
for
the
to
close
send
the
first line
(so
is
sent
over
the
RECEIVE
can't
(R1
:)
on
the
assumes
Note
it
is
end
of
the
RECEIVE
their
gets
happen
for
set itself
in
order
television screen (line 590). Then
that
also
necessary that
it can safely close the
es
the
the disk file and
files.
order
to
be ready
with
from
the
disk file. The program then
you
can
watch
phone.
the
but
the
to
it
might
that
600-610) . It then goes back
whole
program
Note
line,
that
it's best
reply
(a
up
to
get a line
of
save
the
start getting
it
is
not
RECEIVE
cycle repeats.
how
to
for
the
no
prior
signal
the data being sent).
that
port
R1:
there
might
to
write
the
line
that
is
empty
from
data
has
been received),
data on
necessary
signal this. Also note that
the
diskette (lines
Note
that
the
next line im-
for
have started
modem
it sends a specially en-
port
Note
sender' s first
from
the
is
opened
be an im-
program
the
port
RECEIVE
(R1
as
except
modem
RECEIVE
R1:
to
the
Con-
:)
to
get
to
get
how
the
is
Sa
mple Program s 49
Page 49
use
To
and have prepared
your
program gets a filename from each
l;ljii@i.
Originate. Looking at
l;ljll@i key
your
ready to receive before the SEND program sends the first line.
your
your
these programs, assume that you and
your
computers (you have loaded
friend
has
the
RECEIVE
Now
one
of
you
your
as
soon
as
the READY light comes
l;ljii!;lll key 10 seconds later. In
phone
friend.
handsets in the
program) . You each RUN
of
sets
this
modem
watches, you
other
modem
muffs and you proceed
your
friend are talking on the
your
your
you - type the name
to A Answer and the
decide
words
up
that
on his
, the
your
modem
RECEIVE
phone
SEND program and
programs, and each
but
don
' t yet press
other
sets
his to 0
friend
to
will
press his
and you
program must be
Now
send a program to
will
you each
press
put
Since these programs
You should send BASIC source, that
the
LIST
(not
SAVE)
LOAD). You may
character at a
handshake every 40 characters
question
however
lines
of
The
RECEIVE
received
128-byte record be
output.
Lines 210 and 220
communications
time
of
sending the end-of-file
, such a
text.
program
information
A little experimentation should get you going.
work
on
LINES
command.
modify
(us
ing GET and PUT instead
modification
will
on cassette. The cassette handler requires that the first
written
will
have to be modified
with
computers
Your
these programs
or
so.
should
probably
within
about
other
of
data, you
is,
send a file you saved on the diskette
friend should
to
send and receive the
You'll
have to pay particular attention
information
allow
you
need
modification
30 seconds after you OPEN the
than
cannot
ENTER
of
PRINT and INPUT) ,
if you
to
send any kind
if
these programs are
an
ATARI
send tokenized BASIC.
the file he receives (not
try
if
you intend to
Home
information
this
modification;
of
data,
to
Computer.
doing
to
not
put
casse
tte for
be used
with
one
the
the
just
fhe
for
Page 50
RECEIVE
110
200
201
02
2
210
220 XIO
230
PROGRAM
DIM
INLINE$(255)
REM
REM
= = = = = = = = = =
REM
LET
TRANSLATE= 32:REM Full AT ASCII
38
,#5,TRANSLATE ,O,"R1
REM
240 PRINT " Receive file' s full name
250 INPUT INLINE$
260 OPEN #2,8,0, 1NLINE$
REM
270
280 OPEN #5 ,13,0,"R1
290 XIO 40,#5 ,0,0,"R1 :":REM
REM
500
501
REM
= = = = = = = = = =
502
REM
5
10
FOR
ETERNITY
520
REM
530 INPUT #5;1NLINE$ :
540
550
560
570
CLOSE
REM
IF
REM
#5:REM Stop 1/0
IN LINE$ = "
580 PRINT #2 ;1NLINE$ :
590 PRINT INLINE$:
REM
600
610 OPEN #5,13,0,"R1:
620 XIO 40,#5 ,0,0
630 PRINT #5 :
640
REM
650
NEXT
900
REM
901
REM
REM
902
910
CLOSE
REM
ETERNITY
= = = = = = = = = =
#2 :
REM
:"
= O
TO 0 STEP
REM
Get line
EOF EOF EOF
REM
Save
REM
Echo onscreen
"
,"
R1
:" :REM Start 1/0
Send
reply
EOF
received
Start 1/0
" THEN 900
999 END
:"
";
0
line
52 Sample Programs
Page 51
--
-
---------~--
~~--~------------
-------------------------------------
t
BAUDOT
TERMINAL
EMULATOR
Here
is
a sample program
non-AT
Home
Warning: The ATARI 850 Interface
teletype
the
ment.
module.
over a telephone
The Baudot
of
NUMBERS SHIFT category. The latter category includes digits 0 - 9 and some
special characters. This program takes care
control
This program
program's
are values
represented
and
FEED,
GOTOs
NOKEY). Setting INSHIFT
ting
establishes
ASCII (also non-ASCII) character codes. This program turns
Computer
equipment.
more
modern
These voltages
This program
the
characters in Baudot are in
characters.
code
is
into
or
is
actually
20 milliamps.
symbolic
NO);
PEEK
UPSHIFT,
(RECEIVE
ALPHA
which
LISTEN
are
symbolically
and
DOWNSHIFT)
, SEND, and TESTSWITCH); and useful
to
YES
establishes
showing
a Baudot teletype
Such
equipment
could
be dangerous
is
intended
radio
link
an
old
5-bit serial
much
the
use
of
odd
character transmission sizes and
emulator.
Module
High
to
with
someone
the
simpler than it looks. In lines 110 - 210,
used 60
voltages
to
allow
code
which
LETTERS
was
not
designed
milliamp
could
be present in such
you
and
could
you
to
communicate,
owning
is
actually
SHIFT category and half are in
of
sending and receiving
for
current
damage
a Baudot teletype.
two
constants and starting values are set up. The
not
changed in
(as
variables). Constants
POKE
addresses (SWITCH,
to
zero establishes
LETTERS
mode
.
; BASIC line
the
SHIFT
program,
number
LETTERS
for
but
for
include
KB)
; character constants (RETURN,
sent data; and setting TALK
: logical constants
constants
numbers
SHIFT
for
your
AT ARI
connection
loops rather than
old
equip-
your
interface
via a
modem,
codes in one.
the
shifting
symbolic
readability
for
received data; set-
constants
they
GOSUBs and
(NOPUSH,
to
to
Half
(YES
old
the
the
are
NO
Lines
300-
390 fill in
2000-
lines
being translated.
as
numbers
letter (this
representing a
order
In
translation. The Baud rate
speed
Lines 500 - 650 are the receive routine. The
entering
put
and starts
first does a
(TESTSWITCH
see
if
and translated
AT
640.
the LETIERS SHIFT character
2460. Remarks are interspersed in
- the
is
true
particular
to
make
for
old
Baudot
Listen
Mode
the
GOSUB
is
there are any characters received .
to
ASCII table values
the
ASCII-Baudot translation tables
Notice
discussed later) . The STATUS and
ASCII in lines
that
number
for
both
letter are
the
code
is
equipment.
, then opens
Concurrent
TESTSWITCH
less
all
the
characters are represented
is
the "
internal"
ATASCII and Baudot, but,
different
conversion easy, the translation
set
to
45 .5 Baud (60
the
RS-232-C
Mode
input
(510-
to
check
If
there are, a character
600-630,
than zero mean untranslatable characters; 0 means
is
received; 1 means NUMBERS SHIFT.
and
the
data
character
for
computer
printed
code
each).
wpm).
SERIAL
540). The receive
for
switching
IF
PEEK
to
the
from
the data values in
to
show
what
character
within
for
of
course,
mode
This
is
informs
INTERFACE
... statements (580 -585)
television screen in line
this program
the
corresponding
the
is
set
to
the most
you that
port
R3:
loop
to
Send
is
input
in line 590
numbers
32-
common
you
(560-650)
no
are
for
in-
Mode
is
Page 52
Lines
700-
950 are the send routine. Talk mode
opened
Line 770 checks
is
effect
only
means it
echoed
840-
for
output.
retrieved and its high bit
of
disregarding inverse video and allows the conversion
128 elements). The key
has
to
the television screen (830); it then undergoes further translation in lines
890,
where a LETIERS
The first send
for
the typing
of
is
stripped (it
is
no
Baudot equivalent and line 820 restarts the
or
NUMBERS shift character
900 sends the character itself, and
and
LETIERS
SHIFT.
is
loop
(750-
950) action
a keyboard key. In lines
is
forced to be
translated in line 810;
if
it was RETURN , lines
announced, and
is
a GOSUB TESTSWITCH.
780-
800 the key' s value
less
than 128 - this
to
if
it translated
loop
is
added if needed. Line
920-930
port
table
to
to
zero, that
. Otherwise, it
add a
LINEFEED
R3:
is
has
the
require
is
The TESTSWITCH routine (lines
buttons
is
pushed (
&rmi
,
1000-
EJ!DD
returns. Otherwise, the subroutine waits for the
1060) checks
or
liJimill
).
If not pushed , TESTSWITCH just
button
BASIC's GOSUB/FOR-NEXT stack, flips from SEND to
versa) and does a
GOTO
In operation , the 32-character internal buffer fills
the
buffer
is
full, the interface
characters are being sent, the keyboard
won
' t
see
on the screen),
and
wait
for
it
to
appear on the television screen.
ten, sends the
with
ment
block
variations, such
keyboard (using the
you
to
use backspace
connection
110
120
121
122
130
140
150
160
170
180
190
200
201
202
210
300
301
302
310
won't
see
DIM
ATASCII(64) , BAUDOT(128)
REM
REM
Set
up
REM
-----------
LET
YES
= 1
:NO=
LET
SWITCH=
LET
KB
= 764:
LET
RETURN=
LET
UPSHIFT= 27 :
LET
RECEIVE= 500:SEND = 700
LET
TESTSWITCH = 1000
REM
REM
Starting values ...
REM
----------
LET
INSHIFT = O:
REM
REM
Fill Baudot
REM
----------------
FOR
I= 1
TO
to
the proper routine .
module
so
you should type the next character you
immediately
FORCE
to
correct
when
as
sending each character
SHORT BLOCK)
your
anything except
constants ...
0
53279: NOPUSH = 7
NO
KEY
= 255
8:
FEED= 2
DOWNSHIFT=31
ALPHA=
to
YES:TALK=
ATASCII table ...
64
with
characters
sends the characters
will
accept
Note
you type l;iiii@l . You may
or
reading a line at a time (this allows
typing,
but
the person at the
when
you type l;iiiii;!ll ).
NO
whether
RECEIVE
one
to
be
released , restores
mode
to
of
be sent.
as a block. While
one
character (which you
want
that this program,
want
as
it
is
typed from the
other
the
yellow
(or vice-
When
to
as~writ
to
experi-
end
send
of
the
the
54
Sample
Programs
Page 53
I
READ
320
330
340
350
351
352
360
370
380
390
400
401
402
410
420 XIO 36,#5,BAUD,O
430 XIO 38,#5 , TRANSLATE ,O,"R
440
450 OPEN
500
501
502
510 PRINT:PRINT " Listen ... "
520
530 OPEN #5,5,0,"R3:":REM Input
540 XIO 40,#5,0,0
550
551
552
560
570 GOSUB TESTSWITCH
580
585
590
600
610
620
630
640 PRINT CHR$(1N);
650
IN
LET
ATASCII(I) = IN
NEXT
I
REM
REM
Fill ATASCII to Baudot table ...
REM
----------------
FOR
I= 1 TO
READ
IN
LET
BAUDOT(!) = IN
NEXT
I
REM
REM
Set
REM
-------
LET
BAUD=128+48+1
REM
#1
REM
REM
Receive routine ...
REM
---------
REM
REM
REM
Receive loop ...
REM
------
FOR
IN LOOP= 0
STATUS
IF
PEEK(747)=0 THEN
GET
#5,
LET
IN=ATASCII(IN-224+ INSHIFT + 1)
IF
IN<O
IF
IN = O THEN INSHIFT=O:
IF
IN=
NEXT
INLOOP
128
up 1
/0
...
-
:TRANSLATE=32
,"R3:"
,4,0, " K
#5,PORT4
1N
THEN
1 THEN INSHIFT = 32:NEXT IN LOOP
:"
,"
R3:":REM
---
TO 0 STEP
NEXT
-
Start
NEXT
INLOOP
NEXT
:3"
INLOOP
0
INLOOP
Page 54
REM
700
701
REM
Send
routine ...
REM ---------
702
710 PRINT:PRINT " Talk ... "
REM
720
730 OPEN #5 ,8,0, "R3
740
REM
741
REM
Send
REM
FOR
----
OUTLOOP
7 42
750
loop ...
- - -
:":
REM
= 0
TO 0 STEP
760 GOSUB TESTSWITCH
IF
770
780
790
800
810
820
PEEK(KB)
GET
#1
LET
OUT= KEY
IF
OUT>
LET
OUT
IF
OUT=
830 PRINT CHR$ (
840
IF
ALPHA THEN 880
850
IF
OUT
LET
860
870
880
890
900
910
920
ALPHA =
GO
TO
IF
OUT>O
LET
ALPHA = NO:
PUT
#5,ABS(OUT)
IF
OUT<>
PUT
#5,
930 XIO 3
940
LET
ALPHA =
950
NEXT
1000
REM
1001
REM
1002
REM
1010
IF
PEEK(SWITCH)
1020
IF
PEEK(SWITCH)
1030 POP:POP :
CLOSE
1040
IF
1050
1060
2000
TALK THEN TALK = NO:
LET
REM
= NOKEY THEN
,
KEY
127 THEN
= BAUDOT(OUT + 1)
0 THEN
<0
NEXT
KEY
);
THEN 900
YES: PUT
900
THEN 900
PUT
RETURN
FEED:PUT
2,
#5,0,0,"R3
#5,DOWNSHIFT
:"
YES
OUTLOOP
Listen/Talk switch test...
-------
--
= NOPUSH THEN
< > NOPUSH THEN 1020
REM
Pop GOSUB & FO
#5
TALK =
YES:GO
Output
0
NEXT
OUTLOOP
LET
OUT =OUT
OUTLOOP
#5 ,DOWNSHIFT
#5 , UPSHIFT
THEN
TO
- -
GO
SEND
NEXT
OUTLOOP
---
TO RECEIVE
-128
RETURN
R-l
oop
56
Sa
mpl
e Progra ms
Page 55
2001
2002
2010
2020
2030
2040
2050
2060
2070
2080
2090
2100
2110
2120
2130
2140
2150
2160
2200
2201
2202
2210
2220
2230
2240
2250
2260
2270
2280
2290
2300
2310
2320
2330
2340
2350
2360
2370
2380
REM
Baudot
REM
--------------
REM
NUL,E,
DATA
REM
RETURN
DATA
REM
T,Z, L,W , H, Y,P
DATA
REM
O,B,G,Numbers,
DATA
REM
NULL,3,LF,-,SPACE,BELL,8,7
DATA -1,5
REM
RETURN
DATA
REM
5,"
DATA
REM 9,?,+,
DATA
to
ATASCII
LINEFEED
-1,69,-1,65,32,83,73,85
, D, R,J,N, F,C, K
155
,68,82,74,7
,Q
84,90,76,87,72,89,80,81
79,66,71, 1 ,77,88,86,0
1,-1,45,32,253,56,55
,$,4,',COMMA,!, :,(
155,36,52,39,44,33,58,
,),2,#,
6,0
, 1
53,
34,41,50,35,54,48,49
Numbers,.,/,;,Letters
57,63,43,1,46,47,59,0
REM
REM
AT
ASCII
to
Baudot
REM
--------------
REM
Graphics
OAT
A 0,0,0,0,
OAT A 0,0 ,
OAT
A 0,0,0,
OAT A
0,0,0,8,0,0,0,0
REM
SPACE,!,",#,$,%,&,'
DATA 4,-
REM
(,),*,+,CO
DATA
-15 ,- 18,0,-26,-12,-3,-28,-29
REM
0,1 ,2,3,4
DATA
-22,-23,-19,-1,-10,-16,-21,-7
REM
8,9, :,;,
DATA
-6,-24,-14,-30,0,0,0,-25
REM
@,A,B,C,D,E,F,G
DATA
0,3,25,14,9,1,45,26
REM
H, I,J,K, L,M,N
DATA
20,6,11, 15, 18,28,
REM P,Q,
characters
0,0
,0,0
0,0,0,0
,0 ,0
0,0,0,0,0
45,- 17,-20,-9,0,-26,-
MMA,-,.,/
,5,6,7
<,=,>,?
,O
R,S, T,U,V,W
table
...
,A,SPACE,S,I,U
8,70
,67,75
M,X,V,Letters
40
table
...
incl .
CR
11
12,24
Sample
Programs 57
Page 56
2390 DATA 22 ,
REM
2400
2410
DATA
REM
2420
2430 DATA 0,3,
2440 DATA 20,6,
DATA
2450
2460
DATA
9999 END
23
X,Y,Z,Graphics characters
29,21, 17,0,0,5,0,0
A - Z again
22,23,10,5,16,7,30, 19
29,21 ,17,0,0,5,0,0
,10,5,16,7,30, 19
25
,14,9, 1,45,26
11, 15
, 18,28 ,12,24
PROGRAMMING
A PRINTER
two
Here are
232-C
ferences between the
are
specific needs can be met.
The
its
it does
after it
send data
The
we
When a block
quest). If it
ceed because the
SERIAL
printer
nected here
printer
DSR
routine (900 etc.) the program checks that the TRAP was really caused by the
being OFF.
must be programmed . These
not
printer
printing
not
sets
says
line
automatic
tell the interface
examples
INTERFACE ports. It
intended to show general techniques,
being programmed here
(or it
is
want
you
to
the
its READY line OFF
it' s full. In
out
in blocks
once
per block.
monitoring
is
about
is
OFF, the resulting
If
this was the cause, the PRINT
of
programming
two
- the characteristics
so
fast that it
to
send
DSR
pin on the RS-232-C
other
module
to be sent, the interface
printer
is
always ready
more
data, it
early-
words, since the RS-232-C
of
up
to
32
of
DSR
once
to
add
NAK
will
become ready again .
printers connected serially
is
assumed that there are fundamental dif-
of
each
printer
two
sample programs (or program fragments)
but
are examples
is
able
to
buffer and hold characters ahead
to
accept characters
sets
a READY line OFF; that line
SERIAL
it
is
still able to
characters, it
per
block
LF
to
each
error
is
is
INTERFACE port.
collect
is
only
is
set
up
CR
(this
module
trapped (line 360) , and in the TRAP
simply
retried-
up
SERIAL
necessary
in line 150. In line 160,
printer
checks
eventually it
through
control
to
INTERFACE ports
wants the
DSR
of
how
to
print) .
However
32
to
monitor
(per
how
characters
certain
LF).
our
will
RS-
that
When
is
con, the
the
re-
DSR
suc-
of
58
Sa
mple Program s
140 OPEN #5,8,0," R2:"
150
XIO
36,#5 ,0,4,"R2:":REM
160
XIO
38,#5, 64,0,"R2:":REM
360 TRAP 900
370 PRINT #5; ....
REM
Monitor
Add
LF
PRINT something
DSR
to
CR
to R2:
Page 57
900 STATUS #5,PORT2:REM
LET
910
920
930
The
signal that it
accept any data. Therefore, the data must be sent
time, checking
made
was first
diskette
READY=
IF
I NT(
REM
If here then some
printer
being programmed in the example
is
to
send data one character at a
written
or
cassette and
PEEK(746)
READY)<>
not
ready to accept data.
DSR
before each character. Since the PRINT statement
to
a diskette
print
Get
R2:
status
/8:REM Check readiness
INT(READY + 0.5) THEN 360:REM
error
other
than port-not-ready
However,
time, we
or
cassette. Here
it on this printer.
is
error
If
so,
retry
below
assume that the file
a program to read that file
when
to
the
also
has
it
is
printer
a READY line
not
ready, it cannot
one character at a
cannot
to
be printed
off
to
be
the
The operation
printer
from
ready (540 - 550), the character
SHORT BLOCK) in line 570.
wants both
diskette (or tape) one character at a time. Then
DIM
110
200
REM
201
REM
202
REM
210
LET
220 XIO 36 ,#5,BAUD,O, "
230
LET
240 XIO 38,#5,TRANSLATE,O,"R2:"
250
REM
260 PRINT " List file's full name
270 INPUT
280 OPEN
290
REM
300 OPEN
500
REM
501
REM
REM
502
510 FOR ETERNITY =O
520 TRAP 900:REM Trap end
530 GET
of
this program should be fairly obvious.
CR
and
LF
FILE$(16)
= = = = = = = = = =
BAUD=
TRANSLATE= 64:
= = = = = = = = = =
#1
13:REM 4800 Baud
FILE$
#1
,4,0,
Fl
LE$
#5,8,0,"R2:"
,CHARACTER
TO 0 STEP
at the end
is
R2:
"
REM
Add
of
of
PUT (560). The
LF
";
0
file
a line (lines
to
CR
Once
230-
if
the
output
again,
we
240). The file
printer
is
on
then forced
assume the
is
read
port
R2:
is
(FORCE
Page 58
READING
A DIGITIZER
540 STATUS #5,XXX:REM Check ready
550
IF
PEEK(?
47) < 128 THEN 540
560 PUT #5,CHARACTER
570 XIO
580 NEXT ETERNITY
900
901
902
910
920 END
is
This
is
that
whatever) and reporting its location to the
The
digitizing
computer
pen position
the pen
characters), a
read it
32,#5,0,0,"R2:"
REM
REM
= = = = = = = = = =
REM
CLOSE
an example
capable
as
#5:CLOSE
of
of
pad used in this example
at speeds
is
14 characters long: a
is
being pushed, the x-coordinate
CR
and a
the first character on the
#1
reading data from a digitizing pad. A
sensing the position
up
to
4800 Baud ,
LF.
Since the
of
is
so
that Baud rate
digit
LF
follows the
following
a handheld
computer.
capable
indicating
of sending
(6
characters) , the y-coordinate
input
digitizing
object
is
used here.
whether
CR,
the interface
line.
pad
(a
special pen
its
information
Each
or
not
the
is
a device
to
~
sampled
button
module
or
the
on
(6
will
If
we
assume that the
will
not
BASIC
BASIC
to
second
to
because the pen
Therefore, it
gram just grabs
way
holding
reads the oldest data -
This
first INPUT gets the messed-up sample
Then the second INPUT gets a sample
works
significantly ahead
tains
Lines
an INPUT statement
have commas between the sample numbers. The details
with
points) .
for
come
the interface
buffer fills up, the newest data replaces
is
actually very trivial
because the sample contains enough characters
fewer
110-
the
be able
get every sample,
each sample
in at the highest possible rate. It really
is
all right
them
characters than the
130 extract the coordinates
samples
digitizer
to
to
is
usually in pretty
if
now
module
which
of
the arriving character stream, and because the sample con-
with
is
not
shown (in
sends the pen coordinates
keep
up
at 4800 Baud. A
but
at 300 Baud ,
come
in
(15
much
the
digitizer
and then
behaves
to
solve. Look at line 100. A sample
these
when
is
messed
holding
number
when
order
for
characters at 30 cps). Thus
the same place sample after sample.
sends samples
it can.
data arrives
up
by
which
has
from
the buffer
buffer
.)
from
the sample. It was
variables because the sample does
to keep the example to the
lower
example, it
doesn't
as
How
too
the
oldest. An INPUT statement
being replaced by the
been
as
fast
Baud rate might
would
matter if
fast
as
it can and the pro-
ever, take
fast:
when
is
INPUT twice. The
written
which
to
of
over
is
allow
not
what
the program does
as
it can, then
allow
take
about
half a
we
want
the data
we
miss samples,
into
account
the
computer's
newer
by
unharmed. (This
an
INPUT
possible
the
data!
new
data.
to
get
to
use
not
important
Page 59
10
DIM
IN$(16)
20
XIO 36,#5, 13,0,"R2:"
30
OPEN #5,5,0,"R2
40 XIO 40,#5,0,0,"R2:
:"
"
100 INPUT #5 ,
110
LET
BUTTON = VAL(IN$(2,
120
LET
X= VAL(IN$(3,
130
LET
Y= VAL(IN$(9, 14))
590
GO
TO
100:
1N$:1NPUT
8))
REM
Get next
#1,1N$
2))
point
Page 60
12
RS-232-C
STANDARD
INTERFACE
ELECTRICAL
RS-232-C
ensure
ment
manufacturers.
The RS-232-C standard defines a range
munication
Home
organizes the
tions.
When
mean
use
essential aspects
the
Accordingly,
mean " using
is
the
standard
the
uniformity
and data processing terminals. This standard
link
. The ATARI 850 Interface
Computer
we
refer
that
signals
the
adjective " RS-232-C-compatible"
standard
to
bit
stream
to a communication
to
of
is
the
many
the
voltage levels in
adopted
of
transmission
adapt
to
of
or
from
the
RS-232-C standard. Perhaps
specification
other
publications
by the Electronic Industries Association (EIA)
the
values
communication
port
that
port conform
of
voltage levels
the
MODULE
SPECIFICATIONS
of
data
between
of
values
Module
of
these parameters. The interface
according
as
a RS-232-C
when
may use
RS-232-C
the
data
communications
is
followed
of
electrical parameters
is
the
SERIAL
to
the
RS-232-C standards.
the
communication
the
corresponding
term " RS-232-C
standard."
by most
device
to
software-coded
INTERFACE port,
most
important
used in ATARI
conforms
to
mark
compatible"
to
equip-
equipment
for a com-
module
intruc-
we
We
also
to
aspect
and space.
of
to
RS-232-C
SPECIFICATIONS
RS-232-C
" data terminals
the
Table 12-1. Sometimes such devices
pads, and
so
standard and usually
readiness
over
device
start
will
your
compatibility
device
on.
have
conforms
many
However, their
to
a data line).
will
accept after
up
again
to
familiarize yourself
ATARI
has
come
to
cover
,"
particularly
to
other
devices) also have lines
use
the
accept data
Unfortunately, there
when
the
Home
Computer
Table 7 2-7 RS-232-C Electrical
in
the
the
electrical RS-232-C specification,
is
often
different
use
is
specific
from
your
computer
the
line goes OFF,
device
becomes ready (if characte
with
your
and
the
FIRST
TYPE
OF
Binary signal
condition
Signal
Control
function
SIGNAL
-24
volts
many
personal
(which
to
is
no
nor a good
device
interface
STATE
to
-3
MARK
OFF
devices
computer
include
that
from
the
the
device.
(as
standard
's characteristics and then program
module
volts
that
are
world.
printers, plotters,
are called
use covered by
opposed
of
Specifications
DSR
One
such use
to
how
many
way
to
rs
have been lost). You
accordingly.
SECOND
+3 volts
not
" data sets"
This usually means
which
sending XOFF/
determine
is
shown in
digitizing
, DTR , RTS- and
the
RS-232-C
is
characters the
where
STATE
to
+24 volts
0
SPACE
ON
to
or
signal
XON
to
Page 61
It
is
common
to
connect
ground
followed; you
either
dards on
Baud rate
intend
own
to
entirely
to
connect
cable
XMT
7,
the
by
to
practice
CRX
may also run
same
connecting
connect
when
to
pin
to
8, and DTR
unrelated
connector)
to the
using the 25-pin
2,
RCV
to
3,
RTS
to
20.
into
cases
functions
two
ATAR/850
the
device
(such
or
possibly related
pins) . Carefully read the instructions
Interface
to
the
to
4,
However,
where
as
interface
D-connector
CTS
the
other
other
Module!
module.
most used
to
5,
DSR
these
conventions
pins in
types
of
communication
functions
You may have
to
6,
the
(such
with
common
may
connector
as
setting
of
any
device you
to
make
RS-232-C
signal
not
be
have
stan-
the
your
The RS-232-C standard does
and RCV. In fact, RS-232-C
vention
sion
state. A data character (sometimes called a transmission
START BIT, represented by the
commonly 8 of
The
state. The next
stays idle in
The data bits are sent least-significant first. The
and
stantly
receiver can then receive
each
the
same Baud rate.
There are
Module
word
represents
ASCII
words
codes such
can
uses.
and
other
standards have settled
convention.
word
is
so
on. The receiver does
monitors
will
arrive-
communication.
only
supports all
size
is
is
very occasionally sent in 7-bit words. The interface
for
these cases, and can also be used
communicate
When
them), each bit being represented
terminated
word
can
the
MARK
the
stopped
each
Of
a small
8 bits;
the
parity,
as
BCD (with
number
of
when
is
with
not
specify
explicitly
data
is
by 1 (sometimes
immediately
state (effectively,
not
MARK
the
rest
bit
has
the same
course,
of
the
most
sending ASCII ,
just set
or
without
old
Baudot
avoids this issue. Fortunately,
not
being sent,
SPACE
follow
know
state
of
the
both
the
common
common
to 1 or
parity). Five-bit
code
how
data should be transmitted
on
a fairly universal serial data transmis-
the
data line sits
state. It
2)
the
when
looking
duration
0,
is
followed
by
SPACE
STOP BIT(s), represented by
with
its start bit. If it does
stop bit lasts
bit
numbered 0 is
a character
for
the transition
bits in
the
word
as
established by
transmitter and receiver must use
Baud rates , and
ones. The most
which
is
a 7-bit code,
or
is
used
for
communication
teletypes
as a marker
words
for
on
XMT
common
idle
in
WORD)
will
radioteletype and similar
is
signalled by
by
the
data bits (most
for
0 and
indefinitely).
sent first, 1 pext,
be
coming,
to
a start bit. The
because it
the
the
ATARI850
common
the
8th bit usually
bit
of
module
are also
supports 7-bit
with
allowed
MARK
not, the
knows
Baud rate
transmission
7-bit
con-
the
MARK
for
the
MARK
so
it con-
when
Interface
some sort.
or
6-bit
so
one
1.
line
of
the
you
ELECTRICAL
SPECIFICATIONS
OF
THE
SERIAL
PORTS
Refer
to
the
interface
section.
There are basically
and a transmitting
to
a pin
of
one
The sending
10-ohm
approximately+
or
-5
allowed
operation). Th e
stand conn ection
voltage outside the range
module.
circuit
protective
volts),
by
when
the
module
two
types
circuit.
of
the
two
consists
resistor. The
9 volts
driving
RS-232-C standard; any
driv
er c
to
voltages
schematic diagram in
of
circuits
One
of
computer
of
an operational
for
SPACE,
a 3000-ohm load (3000
ircuit
will
within
-5.5
to
for
these circuits connects each RS-232-C signal line
1/0 chips in
op-amp
and-
5.5 volts
lower
withstand s
their
+ 9 volts may
Appendix C while
the
serial
port
lines: a receiving
the
interface
amplifier
is
driven
for
resistance may result in
hort
circuits
driving
resu
(op-amp)
"to
the
MARK
range. Shorting a
(guaranteed at
ohm
is
to
ground,
It
in damage
reading this
module
followed
rail
,"
and produces
the
worst-case load
and
driver
to
the interface
circuit
.
by a
least+
improper
will
with-
to
,
a
Page 62
The rece
the
4700-ohm
much
ground
unterminated
tivity
the
wires.
Port 4 may be set
current-loop
numbers
teletype keyboard-sending contacts are closed, pin 9 pulls RCV negative (MARK).
This
sion
the
receive a
iving
cir
minus/plus
input
current.
which
in
other
unterminated
is
the
of
a character
teletype
Notice
ensure that
wire
leads in the same cable. This
operation,
are
of
idle
state
is
turned
BREAK
cuit consists
RS-232-C voltages
resistor protects the outside
attached
wire
up
for
the 9-pin
of
from
off
signal.
of a diode
that
the
DSR
DSR
will
to
DSR
acts
as
an
antenna and
20-mA
pins 4 and 7
the teletype.
the teletype, RCV
current
connector
, this switch may be open and
and transistor
to
the voltages used by the 1/0 chips. A
inputs have 1800-ohm resistors attached
seem OFF if
can cause
loop
(RTS
of
the
Whenever
device
nothing
DSR
to
go
is
ca lled
the
"receives"
operation
+ 10v, and
interface
is
pulled posrtive
module).
the
switch opens
whose
function
from
having
is
attached
ON
and OFF
" antenna effect," because
the
signals in
(see
Figure C-4, page 90). In
RCV)
are tied together (pin
When
(SPACE).
the
interface
is
to
deliver
to
DSR. A long
if
there
the
the
during
Notice
module
to
convert
adjacent
attached
transmis-
that if
is
will
too
to
ac-
PRINTER
PORT
SPECIFICATIONS
current
For
(+
10v DTR and XMT). XMT
tivated in
passes
rent
Also note
teletype the send
shorted out).
Refer
diagrams (Figure 12-1).
All signals
fered by transistors
lines are buffered
The
open-collector
pulling
pects some such
will
be pulled
lines may slew
The interface
line
is
puter. This line
feature allows you
switch between
own
module
which
pull-up
alternate on and off; FAULT should stay on.
above
loop
output,
the
MARK
through
loop
to
the interface
1000-ohm
low, the
printer
to
FAULT may be attached, you may
at pin 9.
+ 5 volts.
the solenoid and it disengages.
device
that
if
If
this happens,
on
the
to
too
module
interface
is
them
to
the
operate
Be
that it does
the
printer
pull-up
+ 5 volts
the teletype' s
is
normally
state. XMT goes
not
apply
send and receive loops are
or
receive
module
to
supply
to
protect
output
pull-up
slowly
detects
low
if
to
connect
by
printer
the
printer. If
sure you
loop
try
swapping
schematic in
port
are
TIL
the
necessary
the
1/0 chips.
circuit
resistors in the
in
only
to
module
the ATARI 825 Printer
turning
can sink 5 mA. That is,
the
printer; if
by
the
TTL one.
the
presence
will
more
only
port
, FAULT must be high (TTL one)
there
do
not
printer
negative (MARK) ; thus
to
nearly+
excessive voltages
may
not
the send
Appendix
level
(0
drive
printer
pull-ups are
internal 10,000-ohm
of
not
respond
than
one
one
of
is
no
appropriate
connect
connect
solenoid
10v
Be
work
to+
5 volts). The
for
to
the
printer
to
is
turned
ATARI
them
FAULT
Do
is
tied
for
SPACE
careful
connected
TIL
on
not
when
to
correctly
or
receive
C and
the
the
printer
the
zero. The
not
present, the
pull-up
via
printer
FAULT (pin
requests
off
(or disconnected). This
printer
at a
time
signal
to
a busy-type line
attach FAULT
between
so
the
together
(the signal may be
output
circuit
the
to
. If you attach
from
pins 1 and 3
the
solenoid
very little
conn~cting
interface
wire
printer
electronics.
output
resistors and the
FAULT line. If this
the
computer
for
your
12)
to
current
a cur-
module
within
pairs.
port
timing
lines are buf-
is
capable
circuit
output
from
the
the
interface
printer
the
+5
which
to
a voltage
is
ac-
the
Input
of
ex-
lines
com-
, and
your
to
volt
will
.
The eight data lines are positive-logic. The data lines
is
sent
to
the
NULL). A data byte
on
the
eight data lines and pulsing
low
and goes
during
printer
the strobe pulse.
(when it
the
data STROBE. The STROBE
is
not
normally
BUSY) by placing the data
rest at zero (ASCII
is
normally
high,
Page 63
After sending each data byte
signal. The ATARI 825 80-Column Printer sends a positive-logic BUSY signal
processes each byte
printer
when
BUSYis
goes
all the characters have been accepted
the
Note: Early versions
the
your
Some printers using the Centronics-type interface
character received,
module
does
assuming the
merely saves each character in its
the
printer
the
only
, go
not
BUSY after the last character)
low
again, the interface
computer
printer
to
nearest
only
not
go on
Authorized
waits 200 microseconds for BUSY after sending a data byte . If BUSY
of
prints. The interface
requirement
that the
of
respond.
but
within
printer
has
to
the printer, the interface
data. The BUSY
is
module
print
operation
the ATARI 850 Interface
If
you suspect that you may have an early version,
ATARI
only
this
Computer
go BUSY
time
, the interface
completed
is
quite
short for most data bytes since the
own
memory, but
module
that the
sends the next character
by
is
during
its processing
does
printer
within
the
finished .
respond
30 seconds .
printer
Module
Service Center
printing. For this reason , the interface
module
module
not
care
to
Immediately
, the interface
will
for
do
not
sends the next character,
of
the preceding character.
waits for a BUSY
BUSY
how
long the
all 40 characters (that
to
the printer.
module
wait
four
details on upgrading.
signal BUSY for each
is
quite
printer
after BUSY
seconds for
contact
as
long
When
signals
it
is
Data
Strobe
Busy
0-7
I
I I
I
I
I
I
1..__37
I
!-IS !-iS
I
I
I
Figure 7 2-7 Timing
I
I
~
37
v
I
I
I
I
I
37
!-IS !-iS
0
I I
50
!-iS
I.-min**~
I
I I
t.--
50.~-tw
mm
of
200* I
to
~
I 80* * * I
Printer Ports
I
I
I
---1
I
-1
!-iS
I
\
****
*One
byte sent every 280 microseconds without
**Pulse must
must
***Approximate
****BUSY
must remain at least 50 microseconds after trailing edge of STROBE.
be
> 50 microseconds,
be
accepted
may follow either leading
by
the printer
no
maximum. However, 40 characters
in
30 seconds.
or
trailing edge
BUSY
of
STROBE. However, it
etc.
/etc.
/etc.
66
Inte rface
Module
Electrical Specifications
Page 64
13
SOFTWARE
O P
ERATION
PRINCIPLES
The ATAR I 850 Interface
microprocessor, bui lt-in program in
the
PARAL
LEL
forms
is also
and
400
or
Once
device. This handler contains
curs.
The RS-232-C handler
cute each type
that handles
bypass
executed
module.
module.
used
ATARI 800
booted, the RS-232-C
input/output.)
CIO
by
entirely
Some commands cause set-up in both the handler and in the interface
INTERFACE (printer) and
for
communication
Home
of
1/0 operation for
calling the RS-232-C handler directly. Some
by the handler (set-up) ,
Module
Computer.
SERIAL
code
is
called
by
the
The exception to this
OF
is
an
"intelligent"
ROM
, and extensive 1/0 capability. The 1/0
SERIAL
between the interface
INTERFACE
to
reestablish itself
Central!
the
nput/Output
R:
device. (The
but
OPERATION
INTERFACE (RS-232-C) ports,
port
handler
whenever
is
output
most are passed on
device. It contains a
module
subsysteiJl (CIO)
CIO
calls
of
and the ATARI
is
linked in
a
Ji'ti'MI;IiiMI
is
that part
from
the commands are
as
of
BASIC
to
the interface
the
to
exe-
the
which
R:
oc-
OS
The CONFIGURE
by
both the handler and the interface
module
ports. This
bits
tions 4, 5, and 9
The CONFIGURE TRANSLATION
This
1/
0.
The
lines for the indicated port are
as
TROL
to
command
The OPEN
information
by
rent
Sections 4 and
keep separate tables
command
to
transmit, and enable
command
See
Sections 4, 6, and 9
CONTROL
specified
command
SPACE
the handler; OPEN flags are cleared; any data in
Mode
following
sets
1/0
BAUD
for
sets
values that
command
by
the
contro
is
executed.
it
to
MARK.
command
for
the
port
is
shut
8.
RATE
command
for
each
allows you
further definitions and details.
any subsequent data transmission until another
is
executed
being opened. The
down.
to
set the Baud rate, "
or
disable the
MODE
control
for
further
is
executed
set
ON
l parameter.
Note
that
See
Sections
Any
data in
is
module.
of
the
checking
command
the translation and parity handling
definitions and details.
by
the interface
(or MARK), set OFF (or
Each
if
the XMT line
4,
entirely
an
a set-up
line
7, and 9
by
CLOSE
input
command
Both the handler and the interface
four
RS-232-C
word
of
DSR, CTS,
is
executed by the handler.
module.
is
left alone
is
set
for
more
the handler. It establishes
command
output
buffer
is
which
SERIAL
" size,
to
buffers
lost at
number
and
Outgoing
SPACE),
until
another
SPACE
information.
is
executed mostly
is
CLOSE
is
executed
INTERFACE
CRX. See
or
left alone,
, it
will
CONTROL
sent; Concur-
time.
of
stop
Sec-
during
control
CON-
return
control
See
Principles
of
Operation
67
Page 65
Block
Mode
character
fer. The
buffer
module
strips
to
the
port, the
it.
If
waits
The
data before
FORCE
through
buffer
(automatic short
as 8-bit
the
necessary
port. If
readiness
not
ready, the interface
while
FORCE
SHORT BLOCK
output
the
SHORT BLOCK
32
takes data
translation, and puts each character
is
trans
mitted
block
bytes. If
monitoring
interface
bytes have been collected.
7-,
number
is
checked
command
from
BASIC PRINT
when
it fills,
on
CR)
. Data
6-,
or
5-bit
words
of
high-
order
of
any external status line
by
the interface
module
module
command
returns a NAK.
transmits a
causes
has
no effect.
or
from
bits
or
PUT statements, puts each
into
the
32-byte
when
13
(decimal)
the
buffer
are
configured,
from
each byte before transmitting it
has
been
module
block.
the
If
there
whenever a block
The
ATARI
handler
is
no
See
Section 4 and
is sent
the
configured
to
transmit
data in
is
stored
to
interface
Home
the
output
into
the
interf
module
for
is
sent
Computer
the
block
buffer,
Appendix
buf-
the
ace
the
to
of
the
B.
When
The
starting
put
in and out. The
buffers. Then
should be started.
module
Characters
buffer. As
output
it
stops
4, 9, and 10
Input
through
C
the
to
e
data
a result
as
c
a
START CONCURRENT
handler
interrupt
During
is
empty). If
SERIAL
input
the
mpty
into
soon
ircularly-that is,
circular
marks
Concurrent
handlers
the
Concurrent
is
taken in by the handler's
to
be sent
the
serial
interrupt
the
putting
and
, BASIC
data
for
output
which
Concurrent
INTERFACE port. Rather,
buffer
output
buffer.
will
a full
output
of
the
interrupt-driven
as
data
buff
er ca n
handler
(translation occurs at this time) , and
is
MODE
the
Concurrent
Mode
1/0). The
as
necessary
establishes
handler
driver
input
into
more
statements (GET, PUT, PRINT, INPUT) executed
wait
put
the
informs
Mode
hardware
1/0, each character being received
to
the
interface
in
immediately
buffer
overflows, an
the
buffer
information.
1/0
is
If
an
input
until
the data arrives.
buffer, BASIC
sending
into
the buffer. The data
buff
er
is
automatically
hold
at
once
1/0
is
performed
Mode
1/0
as
handler
(depending
the
the
interface
interrupt
module
the
computer
sends
until
data
active
input
statement wants
will
is
one
sets
on 1/0
initial (empty) state
module
driver
are translated and
finishes sending each character, the
another
error
is
sent
do
not
directly
statements
If
an
wait
until
of
data
from
is
reused. The
byte
less
, a
number
active (if
up
character
is
to
more
output
space becomes ava ilable. This is
moved
there
its
own
serial
direction)
of
the
that
Concurrent
and placed in the
from
flagged;
free
output
the
than i
output
buffer
cause any 1/0
simply
retrieve data
statements
data
but
statement attempts
output
into
and
maximum amount
ts
size.
of
things
are no errors
input
/serial out-
to
field data going
input
and
Mode
from
the
interface
input
put
in the
the
buffer
buffer
overflow
space.
to
the
input
buffer,
out
See
to
a channel
the
that
put
which
of
each
Sections
occur.
while
output
1/0
buffer.
output
(unless
RS-232-
is
in
data in -
buffer is
to
put
starts
buffer
of
data
The interface
mon mode is
or
1/0
direction.
face
module
se
lected
pret ed by the
formed
nection
peripheral 1
module
is
sampled (checked)
nected"
28.9 microseconds.
mod~le
used
In this
's
micropr
port
to
the 1
int
erface
by the serial 1
" between the RS-232-C
/0
port
(one
from
outgo
ing line. The samplin g rate
ha
ndle
s Conc
when
8-bit
mod
e,
ocessor) the transmit (XMT) and receive (RCV) lines
/0
co
nnector
module
/0
hardware
is handled by software. Each line
the computer, one
over
and over, and its valu e
words
the
interface
in this
urrent
in the
SER
1/0 in
are being transmitted,
module "co
going
to
mode
computer consol
IAL INTERF
from
is
one
of
two
nnect
the comput
; all serialization
ACE port and the
coming
the RS-232-C
is
then passed on
34.6
kHz; the
ways. The most com-
no
matter
s"
(throu gh the
er. The data
of
e.
Note
into
SERIAL
INTERF
lin
es
are sampled every
what
the rate
is
not
the data
that the
computer's
the interface
ACE
to
the
inter-
of
inter-
is
per-
"co
port)
''con-
the
n-
Page 66
The
other
Concurrent
speed (300 Baud
face
module
corresponding
computer's
The interface
bit.
As
high-order 1-bits are added
error
flag if a framing
with
STATUS after the
receives a 7-, 6-,
8-bit character
hardware
module
each character
Mode
or
less) 7-, 6-,
is
not
receives the data by sampling it at a rate
is
error
Concurrent
1/0
is
established in the interface
or
5-bit
input
(half-duplex). In this
or
5-bit character
to
the
capable
sent
to
get 8-bit words. The interface
occurs in the
from
the interface
1
/0
of
receiving
is
from
computer.
incoming
stopped.
module
mode
the
port
and then transmits a
This
is
done
anything
module
data. This flag may be queried
but
8-bit serial words.
of
16 samples per
to
the
computer,
module
sets
for
, the inter-
because the
extra
an
internal
low
PRINTER
SOFTWARE
OPERATION
The interface
when
the
the program
The interface
readiness lines,
command.
The readiness lines are checked
depends on the activities the interface
be missed, a pulse on a readiness line should be at least a
in
duration
The STATUS
Concurrent
former
tion
. In the latter case, the handler
status and sense
more
information
The interface
senses a
Section
The AT ARI
which
handler
and STATUS.
module
Concurrent
"runs
This does
.
command
1/0
case, the handler supplies the user
module
printer
12
, for signal requirements between the interface
Home
will
address
: OPEN, CLOSE,
leaves
1/0 IOCB
off
the
module
for
the purpose
not
is
is
active)
information
.
responds
attached
Computer
one
printer
Concurrent
is
end."
is
constantly keeping track
of
apply
to
periodically
performed either
or
by both the handler and the interface
supplied by the interface
to
to
the parallel
Operating
, called
output
(represented by PUT, PRINT, and
Mode
when
closed, either
being able
the
RCV
module
combines
commands
port
System contains a
P:.
to
lines
through
is
by
with
information
(see
Four
it
is
with
a BASIC
of
report
or
any lines on the
sampling. The sampling rate
asked
to
the
RS-232-C handler alone (when
some
of
module. See
to
an ATARI
Parallel Printer Port Specifications,
commands
instructed
all
their
perform.
few
about
its
own
module
printer
are allowed by the
by
the handler
command
incoming
state
to
the STATUS
printer
In
order
dozen
printer
milliseconds
module.
its
current
information
Section 10 for
whenever
and a printer).
handler program
LIST
or
when
RS-232-C
port.
not
to
In the
opera-
with
P:
in BASIC),
it
an
To use the printer, one must OPEN
IOCB
when
it
is
no longer needed.
ATARI printers and the interface
described in Section 4
and
when
the buffer fills, the 40 bytes are sent
attached to the interface
and sends them,
printer. The
seconds on early models). If it cannot, the
See
139).
There
to
print
40-character buffer
this reason, the interface
EOL.
printer
the note at the end
is
one
exception to the above description:
an
ATASCII End-of-Line character, it fills any unused part
of
this manual). The
module
one
at a time, over the PARALLEL INTERFACE
must
acknowledge
with
blanks
module
, the interface
of
this section.
(following
ignor
IOCB
module
all 40 characters
es
any characters in the buffer that
to
the printer.
operate in Block
printer
computer
the
handler builds a 40-byte buffer,
to
the printer.
module
When
EOL)
accepts the 40 characters
will
the
and sends it immediately. For
CLOSE
Output
When a printer
port
within
30 seconds (four
return an
printer
handler
releases the
Mode
to
the attached
error
(usually
is
follow
asked
of
(as
is
the
an
Page 67
The interface
No
other
translations are made.
changed, and
without
blanks.
intervening characters, are sent
module
LF
is
translates EOL
not
added
into
ASCII
In
particular,
following CR.
to
CR
(Carriage Return,
bit
7 (high bit)
However, multiple
the
printer
as
alternating CR' s and
of
each byte
EOL' s in a
13
decimal) .
is
not
row
,
A special note
CLOSE
the end
with
40 characters
respond because most printers
Therefore, LPRINT should not be used
the end
clusively.
The STATUS request for device
printer
128
mand
frame h
timed
all in one. Execution
blanks
attached and it
if
the previous operation
to
ad
out-that is, the
will
of
the
your
an
about
LPRINT in BASIC: LPRINT
of
an
LPRINT statement
send
to
the interface
but
does not have an
to
the
printer
statement. Use PRINT in those cases. LPRINT
interface
error
(this should
(including the blanks),
is
turned on. The status returned in location 746 (decimal)