Specifications

62
ALARM
REG
I
STER
The
AMD
9513
contains
two
16
bit
alarm
registers
which
are constantly
compared
with counter
registers
1
and
2.
When
enabled. the outputs
of
the
comparators
take the place
of
the
normal
outputs
of
the counters.
OUT1
and
OUT2.
The
active level
is
determined
by
the setting of the
output control,
specified
in
bits
O.
1
and
2
of
the individual
Counter
Mode
Registers.
Comparators
1
and
2 are enabled
by
a 1 in Bits 2
and
3
respectively
in the
Master
Mode
Register.
In
the special case that
both
comparators
are enabled
and
the
time
of
day
function
has
been
enabled,
OUT2
will
be
the output of a full
32
bit
comparison
of
both
alarm
registers
with
their
respective counters. Since the counter
registers
have
accuracy to hundreths
of
a second,
it
is
impossible to
detect a true
comparator
output condition in
BASIC
using the
32
bit
comparison option, becasue the
comparator
output
will
only
be
true
for
.01
seconds.
The
following
programs
demonstrate
how
to
set
up
and
use
Alarm
2 for comparison
of
hours
and
minutes.
The
following
BASIC
programs:
PRINTS
THE
COMPARATOR
2
STATUS.
THE
STATUS
WILL
BE
A
"1"
UNTIL
THE
CLOCK
REACHES
THE
TIME
SPECIFIEO
IN
THE
ALARM
REGISTERS,
AT
WHICH
TIME
THE
STATUS
WILL
BECOME
A "0".
THE
"0"
WILL
LAST
FOR
ONE
MINUTE,
THE
TIME
THAT
COUNTER
2
AND
ALARM
REGISTER
2
ARE
THE
SAME.
The
time
is
inserted
at
the locations
marked
by
a
"*"
in the
program.
These
values are the decimal equivalents
of
the values indicated, in
HEX
form.
The
time
in these positions
is
set
to the desired time for
the
alarm
comparators to
be
true.
BASIC:
700
OUT(30)=23
710
QUT(2B)=251
720
OUT(30)=15
730
OUT(28)=
740
OUT(2B)=
750
STOP
BOO
X=IN(30)
B10
Y=X/4-(X/B)'2
B20
PRINT
Y
B30
GOTO
800
HEX
17
Set
Data
Pointer to
Master
Mode
Register
FB
Set
Master
Mode
Register to
Comparator
1 Disable,
Comparator
2
Enable
OF
Set
Data
Pointer
to
Alarm
2 Register
Tens
and
Ones-Minutes
Tens
and
Ones-Hours
INPUT
Status:Byte
Isolate Bit 4, the
Comparator
2
Output
(Note:
The
technique
used
is
for
INTEGER
BASIC
only)
PRINT
Output
of
Comparator
2
Go
Back
to a.ginning