Download MPA Multi-Protocol Terminal Emulation Adapter Using the DP8344

Transcript
MPA-II interface mode. A number of user selectable options
are available with the Loader which provide maximum flexibility in loading, running, and configuring the MPA-II system.
The Loader can also be used to run diagnostics by specifying the ‘‘selftest’’ option. This will test the functionality of the
MPA-II hardware. The Loader syntax is:
LD [ConfigÐoptions . . . ] [Options . . . ] kFilenamel
4) Read the parm/response register (I/O location 2DBh)
for the command’s response (if any).
A PC program called MPADB.EXE has been included with
the MPA-II which communicates with the MPA-II using this
interface. MPADB is written in C and has some additional
debugging capabilities, such as reading blocks of BCP
memory using one command. After starting MPADB, type
‘‘help’’ at the prompt, b l, for information on the commands supported by MPADB. All the source code for
MPADB is included, see MPADB.C under the directory
DEBUG.
The read and write data commands use an internal MPA-II
register called the MPA-II address counter, AC. This address counter works much like the Coax and Twinax address counters. The read command returns the byte pointed
to by the MPA-II address counter. The write command
places its data at the location pointed to by the MPA-II address counter. Whether or not the MPA-II address counter
auto-increments depends on the contents of the MPA-II
control register, see Figure 6-21 . If the LSB is a one (1) then
the MPA-II address counter auto-increments, otherwise it
does not change.
where the following notation applies:
[]
Items enclosed in square brackets are optional.
kl
Items enclosed in triangular brackets are required.
ALL CAPS Items in all capital letters must be entered exactly as shown.
lower case Items in lower case letters indicate that desired
values should be substituted.
The Loader Options that apply to the ‘‘soft-loading’’ of instruction memory will be discussed in the section titled
‘‘Soft-Loading
Instruction
Memory’’.
The
Loader
ConfigÐoptions will be discussed in the section titled ‘‘Configuring the MPA-II’’. The Loader options that apply to the
selftest facility will be discussed in the section titled ‘‘MPA-II
Diagnostics’’. Examples demonstrating the Loader options
as well as the Loader defaults will also be provided in this
chapter.
The Loader is primarily written in Microsoft ‘‘C’’5.1. The portion of the Loader code which performs the MPA-II Diagnostics has been written using National Semiconductor’s
DP8344 BCP Assembler System as well as Microsoft’s
Macro Assembler 5.1. All of the source code required for
the Loader is included on the distribution disks and is well
documented. For complete details of the implementation of
the Loader functions described in this section, refer to the
source code.
The Loader provides two levels of help. The first level of
help is provided in a brief, single screen and is accessed by
typing LD with no options at the DOS system prompt. A
multi-screened, comprehensive help, is accessed by specifying the -h option of the Loader as shown below:
LD bh
TL/F/10488 – 65
FIGURE 6-21. MPA-II Control Register
The Load Address Counter High, Load Address Counter
Low, Read Address Counter High, and Read Address Counter Low commands simply provide access to the 16-bit
MPA-II address counter. The Load Control Register allows
one to write to the 8-bit MPA-II control register.
The receiver error counter commands provide an easy, reliable way to read the MPA-II receiver error counters located
in the MPA-II Device Control Page, DCP. PC software that
uses these commands does not have to be updated if the
receiver errors are relocated in BCP data memory because
the BCP assembler will automatically update all references
to those error counters when the MPA-II microcode is re-assembled.
Finally, the Revision Number command allows the PC to
determine a) if the MPA-II running and b) what version of the
MPA-II microcode is the MPA-II running. This MPA-II command is used by the Loader when the Loader performs an
autoload (-a option). For the PC to read the revision number,
the REV command must be executed three (3) times. Each
returned byte’s bits are defined as ‘‘xxcc dddd’’, where:
dddd e a revision digit coded in Binary Coded Decimal,
BCD
e a count showing the position of the revision digit
cc
The Loader provides the following return values which are
useful when using the Loader in a batch file:
0 PASSED: Loader ran to completion as requested by the
user.
8 WARNING: Loader ran to completion, but not exactly as
requested by the user.
16 FATAL ERROR: Loader was unable to run to completion due to a fatal error.
Before the Loader implements any of its primary functions, the Loader will verify that the MPA-II printed circuit
board is present in the PC. This is done in two different
stages (see the Loader flow chart, Figure 7-1 ). First, the
Loader performs a non-intrusive test. This test entails
reading RIC a number of times while checking that the
value of RIC does not change and that the single step bit
of RIC is not set. The second test is intrusive, meaning
that it will affect the current state of operation of the
MPA-II, if the MPA-II is ‘‘alive’’ (more on this later). This
test checks for the presence of the MPA-II by writing various patterns to RIC, then reading RIC back to check that it
contains the correct value. For example, when the pattern
written to RIC has the single-step bit set and the start bit
cleared, the Loader expects to read back RIC with the
single-step bit cleared. If either of the instrusive or non-in-
e reserved
xx
For example, if calling REV three times returned (in hex) 20,
34, and 13, then the revision number is 3.04.
Last notes, unused commands and invalid parms are ignored. In addition, commands with values less than 3F(hex)
are reserved for National Semiconductor. Feel free to define
commands with values greater than this if compatibility with
future MPA-II releases is desired.
7.0 LOADER AND MPA-II DIAGNOSTICS
The Loader is a PC program designed to load the MPA-II
with BCP microcode, start the BCP, and configure the
69