4.0
PROGRAMMING AND INITIALIZATION
4.1
Initialization
This section describes the programming techniques
for the
Serial Interface Board
(SIB),
It is
assumed
that the board
has been correctly installed
and that all
necessary jumpers
have been connected.
Before any data can
be
transmitted
or
received, the SIB must
be
initialized.
The SIB
is
intended
to be
interrupt driven,
in
which case
the CTC
interrupts must
be
enabled
and
interrupt handlers must
be coded.
4.1.1
Disabling Interrupts
It
is
impor tant
,
espec ially dur
ing
program development
,
to
start any program by disabling
all of the CTC
interrupt
generators
(CTC
1
and
2)
.
This may not need
to be
done
if
the
previously
run
program terminated normally
and
disabled
the CTC, and
if
the
USART
is
enabled
and
cleared before
interrupts
are re-enabled.
Programming
the
USART with
interrupts enabled can often cause spurious interrupts during
the
enabling process.
The
following routine stops
all four
channels
of
both CTCs
involved
in
interrupt triggering.
The CTC command byte has
the
stop operation bit set and the interrupt enable bit reset
(see
Z80-CTC Product Specification)
.
Clear All CTCs
-
Interrupt Off
CLCTCS
LD
LD
LD
OUT
INC
B,4
CCTCl
A,0FFMOD
DO
RECEIVER CHANNELS
CLLPl
(C)
,A
C
LD
LD
LD
OUT
INC
DJNZ
CLLPl
B,4
AND TRANSMITTER CHANNELS
C,CTC2
A,OFFMOD
CLLP2
(C)
,A
C
DJNZ
RET
CLLP2
OFFMOD
EQU
43H
NO INTS AND STOPPED
47
Need help?
Do you have a question about the Z-80 SIB and is the answer not in the manual?
Questions and answers