EasyManua.ls Logo

Radio Shack 26-1145 - Page 22

Radio Shack 26-1145
35 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
;
OUTPUT CHARACTER TO UART
FOR TRANSMISSION
;
A SHOULD CONTAIN CHARACTER
TO
BE TRANSMITTED
PUSH
A
;
SAVE CHARACTER TO BE
TRANSMITTED
STATIN IN A, (0EAH)
;
LOAD UART STATUS REGISTER
BIT 6#A ;
TEST TRANSMITTER
HOLDING
REGISTER FOR A HIGH
JR
Z, STATIN
;
TR
Y A G Al N
I
F NOT
POPAF
;
RESTORE CHARACTER
TO
BE
TRANSMITTED
OUT
(0EBH),A
; LOAD HOLDING REGISTER
WITH CHARACTER
An input operation from Port Address EBH
reads the
UART
Receiver Holding Register
and resets the
Received
Data bit in
the
UART Status Register. You
should not
do
this until the
Received
Data bit
is set
in
the UART Status Register
(meaning that a
com-
plete character has been received and transferred to the
Receiver
Holding
Register). The following sequence
of Assembly
Language
instructions illustrate how this is
done.
;
INPUT
A
CHARACTER FROM
THE UART
;
CHARACTER RECEIVED WILL BE
IN
A
INCHAR IN A,
(0EAH)
;
LO
A
D U
ART
ST ATUS
BIT
7,
A
;
TEST DATA RECEIVED FOR HIGH
JR
Z
,
INCHAR
;
TRY AGAIN IF
NOT
IN
A,
(0EBH)
;
LOAD RECEIVED CHARACTER
Execution
of
this
sequence
will
load
the
character received
into
register A and
the UART
Control Register
Received Data bit will
be reset.
Earlier we
told you that there are
two categories
of RS-232-C
equipment, data
terminal equipment
and
data communications. The
two categories differ in which
pins on the DB-25
connector are used
for the Transmit Data
and
Receive
Data functions. Data terminal
equipment transmits
data on pin
2 and receives
data on pin 3.
Equipment
which interfaces
to data terminal equipment must
therefore receive data on
pin
2
and transmit data on pin 3 (refer to
Table
2).
This means that it is
sometimes
necessary to
reverse the
operation of these
two signals,
depending on the specific interface
requirements.
A
double-pole double-throw
switch is provided in
the
Radio
Shack RS-232-C Interface for
this purpose (refer to
Schematic Diagram). One position
is
labeled TERM
(data
terminal)
and other
COMM (communications equipment).
19

Other manuals for Radio Shack 26-1145

Related product manuals