Download Print this page

ZiLOG Z-80 SIB User Manual page 56

Advertisement

4,1.2
Enabling USAFTs
Enabling
the
USART requires careful attention.
It
should
be
enabled before the baud rate generator
is
turned
on
since
its
initial state
is
indeterminate and
it
may try
to
transmit
a
character
or
cause
an
interrupt
.
The
process involves
four
steps which should proceed
in
the
following order;
a.
Reset
the USART;
b.
Send
a
mode byte
(see
8251
Product
Spec.) to the
control port;
c.
Send
a
command byte
to the
control port; and
d.
Read one character from the data port
(the
data port
address
is
one less than the control port address
by convention)
.
A USART
may
be
reset by sending three zero bytes followed by
a
reset command
(40H)
.
The zero bytes are recommended since
the
USART may have been
in
the
synchronous mode,
and
therefore, would have interpreted the first two characters
as
sync characters.
USART application information suggests that
sending three reset commands will cause
a
reset, thus,
enabling
the
USART
to
receive
a
mode byte.
Since
the MCZ
System reset button
is
connected
to the
USART'
s
external
reset pin, pushing the system reset followed by three
internal reset commands will not cause the USART
to
accept
a
mode byte, but rather cause
the
USART
to treat the intended
mode byte
as
a
commmand
byte.
The next byte sent
to the
USART must
be
a
mode
byte.
The
value
8EH sets the mode
to 1,5
stop bits,
no
parity, eight
bit characters, and
a
16x baud rate factor.
The mode byte
must
be
followed
by
a
command
byte.
The
value 37H enables
the
USART
for
both transmitting and receiving.
Request
to
Send
(RTS)
(bit
5)
and Data Terminal
Ready
(DTR)
(bit
1)
should
be
turned
on
since USARTs and most modems only work
if
Clear
to Send
(CTS)
is low, and
one
of
these pins will be
connected
to CTS.
One character must
be read from the
USART
data port
to
clear the receiver data buffer.
The routine
should look
like:
48

Advertisement

loading
Need help?

Need help?

Do you have a question about the Z-80 SIB and is the answer not in the manual?

Questions and answers