For
a typical calculation, see
the
example below.
EXAMPLE
To
produce 2400 baud with the standard 6.144
MHz
crystal:
2400
(6.144 X
10
6
)
+ 2
83
+ 14
(HO
14 (HO
(6.144 X
10
6
+2)
2400 - 83
(HO'
[(
61442~O~06
+
2)_
83J
+ 14 = 85.5
~
86
(HO'
8610 = 0056H
(HO
0157H = BITTIME
To determine the true data rate this parameter will
produce, substitute into equation (6):
6.144
X
10
6
+ 2
Date Rate
= 83 + 14(86)
= 2387 baud, which
is
0.54% slow.
For
9600 baud, the same calculations will yield (HO'
= 17, which
is
actually 0.3% slow; a sizzling 19200
baud or 38400 baud could each be generated
to
with-
in
5%
if
(HU'
= 6 or
O!
Table 9 presents the param-
eters for several standard baud rates.
Notice that the resolution
of
the delay algorithm -
the difference between bit times resulting from
parameters which differ by one -
is
14 machine
cycles.
As
a result, the true bit delay produced can
always manage to be within ±2.3
fJsec
of
the delay
Table 9
desired. This guarantees that at rates up
to
9600
baud, where each bit time
is
at
least 104
fJsec
wide,
some value
of
BITTIME can be found which will
be accurate
to
within 2.2%.
BAUD RATE IDENTIFICATION ROUTINE
The function
of
BRID
is
to compute
the
appropri-
ate parameters BITTIME and HALFBIT.
It
accom-
plishes this by observing the data pattern received
when the space bar
is
pressed on the console
device. Since a space character has
the
ASCII code
20H = 001
OOOOOB,
the pattern represented back in
Figure 4
is
transmitted. Notice
that
the initial
Zero
level
is
6 bits wide. Suppose it could be determined
that
this corresponds
to
M machine cycles. Then
one bit would correspond
to
(M+6) machine
cycles. The reason for dividing down a space
several bits long
is
so
that any distortion caused
by
the signal rise and
fall
times,
or
any lack
of
pre-
cision
in
detecting the two transitions, will be
reduced by a factor
of
six. Since the bit period
of
COUT and CIN
is
83 +
14
(HO', BRID must gener-
ate a value (HOi such that:
M + 6 = 83 + 14
(HOi
(HOi
(M
+
6)
- 83
14
(7)
(8)
I M
(HO
=
84
- 6 (approximately) (9)
This value can be determined by setting register
pair HL to
-6,
then incrementing it once every 84
machine cycles during the period
that
the incom-
DELAY PARAMETERS FOR STANDARD BAND RATES USING 6.144
MHz
CRYSTAL
TARGET
(HL)'10 (HL)'
16
(HL)
or
ACTUAL
%
BAUD
BITTIME
HALFBIT
BAUD
RATE
RATE
(See Text)
(See Text)
(See Text)
PRODUCED ERROR
110
1989 07C5 08C6 04E3
109.99
-0.006
150
1457
05Bl 06B2
0309
149.99
-0.005
300 726
0206
0307
026C
299.80
-0.068
600 360
0168 0269
01A5
599.65
-0.059
1200 177
OOBl
01B2 0159 1199.5
-0.039
2400 86 0056 0157 012C 2386.9
-0.547
4800 40
0028
0129 0115
4777.6
-0.469
~600
17
0011
0112 0109 9570.1
-0.312
19200
6 0006
0107 0104
18395.2
-4.37
A1-36
1",1.,'.'
f
\:
I:,
I
!
I
II
!,
I