SECTION 6
SELF-CHECK
The self-check capability
of
the MC6805R2, MC6805U2, MC6805R3,
and
MC6805U3 microcom-
puters provides
an
internal check to determine if the part
is
functional. Connect the MCU
as
shown
in
Figure
6-1
and monitor the output of port C bit 3 for
an
oscillation of approximately 7 hertz. A
1O-volt level (through a
10k
resistor)
on
the timer input, pin
8,
and pressing then releasing the
RESE'F
button, energizes the ROM-based self-check feature. The self-check program exercises the
RAM,
ROM, TIMER, interrupts,
and
1/0 ports,
as
well
as
the
AID
for the MC6805R2 and
MC6805R3.
Several
of
the self-check subroutines
can
be
called by a user program with a JSR or
BSR
instruc-
tion. They
are
the RAM, ROM,
and
four-channel
AID
tests. The timer routine may also
be
called if
the timer input
is
the internal phase
two
clock.
6.1
RAM SELF-CHECK SUBROUTINE
The RAM self-check
is
called at location
$F6F
for the MC6805R2/MC6805U2 and at location
$F84
for the MC6805R3/MC6805U3. If any error
is
detected, it returns with the Z bit
cleared;.
otherwise
the
Z bit
is
set. The walking diagnostic pattern method
is
used
on
the MC6805R2/U2. The
MC6805R3/U3 test
causes
each
byte to
count
from 0 up
to
0 again with a check after
each
count.
The RAM test must
be
called with the stack pointer at
$07F.
When run, the test checks every RAM
cell except for
$07F
and
$07E
which
are
assumed
to
contain the return address.
The A and
X registers and
all
RAM locations except
$07F
and
$07E
are
modified.
6.2 ROM CHECKSUM SUBROUTINE
The
ROM
self-check
is
called at location $F8A for the MC6805R2/MC6805U2 and at location
$F95
for the MC6805R3/MC6805U3.
The A register should
be
cleared before calling the routine
in
the MC6805R3/MC6805U3. If any
error
is
detected,
it
retu
rns
with the Z bit cleared; otherwise Z =
1,
X = 0 on retu rn, and A
is
zero if
the test
passes.
RAM location
$040
is
overwritten.
6.3 ANALOG-TO-OIGITAL CONVERTER SELF-CHECK
The analog-to-digital self-check for the MC6805R2
is
called at location $FA4
and
for the MC6805R3
at
$FAE.
For both devices; it returns with the Z bit cleared if any error was found; otherwise the Z
bit
is
set.
6-1