Intel MCS-80/85 Computer Hardware User Manual


 
'-I"
I,
I,
i,'
~'
1'1
burst
is
being received when T APEIN
is
called,
wait until the burst
is
over:
TAPEIN:
Mill
B,8
~1\lI
O
..
eeH
TI1:
CflLl
SiTIN
JC
TIl
CALL
SIiIN
JC
Til
(Throughout this subroutine, a level transition
is
recognized only after it has been read once initially
and then verified on the next reading. This pro-
vides some degree
of
software noise immunity.)
Now await the start
of
the next burst:
TI2
CFlLL
BHIN
.TNC
TI2
Ctill
E:I,W
,me
TI2
The
next
burst has now arrived. Keep reading the
SID pin, decrementing register D (thus making
it
more negative), each cycle until the pause
is
detected:
T13
nCR
[:t
CRLL
8iTIN
JC
TIl
CRlL
E:ITiH
JC
H2
Now continue reading the
SID
pin, incrementing
the D register (back towards zero), each cycle until
the next burst
is
received:
TI4
rt-JR
0
(FILL
SITYN
JNC
TI4
CRll
SHIN
JNC
TI4
Now,
if
the burst lasted longer than the space, D
was
not
incremented all the way back to zero; it
is
still negative.
If
the space was longer, D was incre-
mented up through zero; it
is
now positive. In
other
words, the sign bit
of
D will now correspond
to
the data bit that would lead to each
of
these
results.
Move
the sign bit into the CY, then rotate
it into register
C:
I'tIV
ltD
~AL
MOV
A,C
RAR
l1GV
CA
Mill
D,0l1r1
A1-41
Continue until the last bit has been received:
[.oCR
B
JNZ
TI3
RET
(Notice that the first half
of
this subroutine
is
incorporated in the second half. In fact, the
as-
sembled listing included
in
the Appendix makes
use
of
this fact
to
eliminate 24 bytes
of
duplicated
code.)
BITIN waits a short time
in
order
to
regulate the
sampling rate, then reads
SID
and moves the data
bit into the CY:
BITW:
l'tVi
E,
CI(RATE
(7"
I~
8I1:
OCR
E
(4)
JNZ
Bf1
(7/1iD
PIM
(4)
RAL
(4)
RET
<1.0>
The tone burst frequency and duration, and
the T APEIN sampling rate are determined by
HALFCYC, CYCNO, and CKRATE. Tables 10 and
11
give
typical values.
Table 10
EXAMPLE COMBINATIONS
OF
HALFCYC
AND
CYCNO.
APPROXIMATE
TONE
FREQUENCY
500
Hz
1 kHz
2 kHz
5 kHz
10 kHz
ALL
VALUES
IN
DECIMAL
CORRESPONDING
RESULTING
DATA
RATE
HALFCYC
8
20
100
VALUE
4
10
50
217
42
17
3.3
108
83
33 6.6
53
166
66
13
20 414
166 33
9
826
330 66
Table
11
MAXIMUM
SAMPLING RATES
FOR
VARIOUS VALUES OF
CKRATE
CKRATE
SAMPLING RATE
VALUE
(INCLUDING
CALL & RET)
1 17.6
J..lsec
20
104
J..lsec
80
378
J..lsec
250
1.14 msec
CYCNO
CYC/BURST
bps
bps
bps
bps
bps