PHYSICAL DESIGN AND DEBUGGING
The 80386 stops running only for one of three reasons:
• The READY # signal
is
never asserted
to
terminate the bus cycle.
• The HALT instruction
is
encountered,
so
the 80386 enters a HALT state.
• The 80386 encounters a shutdown condition.
In
Real Mode operation (as in the simple
diagnostic program), a shutdown usually indicates that the
80386
is
reading garbage on
the data bus.
If
the 80386 stops running, the cause can be determined easily if the system contains simple
hardware decoders with associated LEDs to visually indicate halt and shutdown conditions.
The
80386 emits specific codes
on
its W
/R#,
D/C#,
M/IO#,
and address outputs to indicate
halt or shutdown. A circuit to decode these signals can be tested by executing a
HLT
instruction (F4H) to see if the halt LED
is
turned on. The shutdown LED cannot be tested
in
the same way, but its decoder
is
so
similar to the halt decoder that if the halt decoder
works, the shutdown decoder should also work.
If
the shutdown LED comes on and the 80386 stops running, the data being read in during
code fetch cycles
is
garbled. The programmer should check the EPROM contents, the wiring
of the address path and data path, and the data transceivers. The 4-byte diagnostic program
should be used to investigate the system. This program should work before more complex
software
is
used.
If
neither the halt LED nor the shutdown LED
is
on
when the 80386 stops running, the
READY # generation circuit has not activated READY # to complete the bus cycle. The
80386
is
adding wait states to the cycle, waiting for the READY # signal
to
go active. The
address
at
the address latch outputs and the states of the W
/R#,
D
/C#,
and
M/IO#
signals
should be checked to narrow the investigation to a specific part of the
READY # generation
circuit. Then the circuit should be investigated with the logic analyzer.
Once the basic system
is
built and debugged, more software and further enhancements can
be added to the system. The incremental approach described applies to these additions.
Systematic, step-by-step testing and debugging
is
the surest way to build a reliable
80386-based system.
11-17