# ![](media/image1.png){width="0.9479166666666666in" height="0.9479166666666666in"}

# Engineering Note

### Nicholas Weydert

**Date:** 29 June 2000

**Rev. Date:** 8 August 2000

**Project:** Digital Front End Crate Controller

**Doc. No:** 2000 06 29b

**Subject:** DFEC Command Set

**Summary**

The DFEC receives its commands from the 1553 bus via a block of memory
in a dual port ram. Engineering note 20000629a explains the protocol of
this interface. This document concerns the actual commands and their
functions including software design considerations.

## Issuing Commands

Issuing commands to the DFEC is relatively easy and is done buy
utilizing the 31-word command block in the DFEC's dual port ram. Issuing
a command involves loading the command and it's arguments into the
command block and then accessing sub-address 18 of the 1553 interface
with a read or write (it doesn't matter). Note: since sub-address 18 is
only used to generate an interrupt on the DFEC the 1553 will return an
error message that can simply be ignored. The interrupt that is
generated signals the DFEC to initiate the command stored in the command
block.

## Command Structure

All the commands are read from the command block of the dual port ram by
the DFEC during an interrupt cycle. All commands are a byte long and
reside in the lower byte of a given command word. Many commands have
arguments, which reside in the upper byte of a command word or in the
next consecutive word if more bits are needed. The command byte is
defined below.

  -------- -------- -------- -------- -------- -------- -------- --------
  MLT      HLV      C5       C4       C3       C2       C1       C0

  -------- -------- -------- -------- -------- -------- -------- --------

Figure 1: Command Byte Structure

**MLT:** This is the multiple command bit. It is set to indicate the
presence of another command after this one. This last command in a
multiple command sequence must have this bit cleared.

**HLV:** This bit is the high-level command bit. It is set to show that
the command is high level (nested subroutines). Most of the commands
used are high level though the low-level commands can still be accessed
by clearing this bit.

**C5-C0:** These are the command select bits that determine which
command in the high/low level subcategory will be implemented.

#### Command Set

Below is a tabular listing of the DFEC commands with their Op-Codes and
arguments.

##### ![](media/image2.wmf){width="6.8in" height="4.573611111111111in"}Figure 2: DFEC Command Set

### It must be noted that any command can indicate the presence of additional commands following it by setting the MLT bit of the Op-Code. A multiple command string will continue until a command is executed that does not have the MLT bit set, this is how the string is terminated. 

**No Operation 0x00** (No Arguments)

This command is fairly self-explanitory. It is used to as a default
command to help prevent errors due to non-terminated multiple command
strings and to introduce pauses in the DFEC command cycle.

**Compact Flash Status 0x01** (No Arguments)

This command simply returns the present contents of the compact flash
card's status register. The status is returned into the lower byte of
the Compact Flash Status word in the dual port ram (address 22h).
Information on decoding the returned status byte can be found in the
Compact Flash Specification at
[www.compactflash.org](http://www.compactflash.org/).

###### Compact Flash Diagnostic 0x02 (No Arguments)

This command initiates the compact flash card's self-diagnostic routine
and returns the results into the lower byte of the Compact Flash
diagnostic word in the dual port ram (address 23h). Information on
decoding the returned diagnostic byte can be found in the Compact Flash
Specification at [www.compactflash.org](http://www.compactflash.org/)

**Compact Flash Reset** **0x03** (No Arguments)

This command resets the compact flash card. After the execution of this
command, the card is ready to accept inputs and no data is lost.

**Sector to Compact Flash** **0x04**(Sec_hi : Sec_mid : Sec_low)

This command transfers a sector of data from the sector data buffer to
the compact flash card. The destination sector (in hex) in the compact
flash card is provided in the three 8-bit address arguments. The data
must be present in the data buffer prior to the execution of this
command. Additional care must be taken with this command and is further
described in the design considerations section of this document.

**Sector to 1553 Bus** **0x05** (Sec_hi : Sec_mid : Sec_low)

This command transfers a sector of data from the compact flash card to
the sector data buffer. The desired sector address on the compact flash
card is provided in the three 8-bit arguments. Additional care must be
taken with this command to prevent data corruption and is explained in
the design considerations section of this document.

**Backplane Register Read** **0x08** (MB / Register)

This command performs a direct read on the backplane registers. The
motherboard and register addresses are provided in the argument. The
register data is returned in the general 8-bit register. The byte
structure of the argument is shown below and the argument explanation
can be found in Engineering Note 20000128a.

  -------- -------- -------- -------- -------- -------- -------- --------
  MB4      MB3      MB2      MB1      MB0      R2       R1       R0

  -------- -------- -------- -------- -------- -------- -------- --------

**MB4 -- MB0** provide the motherboard address from 2 through 21

**R2 -- R0** provide the desired register address

**Backplane Register Write** **0x09** (MB / Register : 8-bit data)

This command performs a direct write to the backplane registers. The
motherboard and register addresses are provided in the argument as well
as the data to be written. The byte structure for the motherboard /
register argument is the same as above.

**Initialize Crate File A** **0x40** (No Arguments)

This command loads the whole crate with the "A" files (1-40). This
allows easy one command initialization of the motherboards after power
up and quick changes between file versions. This command uses the file
version tag to determine the crate location for each file and assumes
that files 1-40 are each exclusive to a single motherboard /
daughtercard. The DFEC file loading command checks for proper
initialization of the daughtercards. The error reporting process for
this event is outlined below in the write file to backplane (auto)
command.

**Initialize Crate File B** **0x41** (No Arguments)

This command is identical to the previous command except that it
initializes the crate with the "B" files (41-80). This command also uses
the file version tag to determine the crate location for each file and
assumes that files 41-80 are exclusive to a motherboard / daughtercard.
The DFEC file loading command checks for proper initialization of the
daughtercards. The error reporting process for this event is outlined
below in the write file to backplane (auto) command.

**Write File to Backplane (Auto) 0x42** (File)

This command automatically writes a file to the correct motherboard
based on the file's version tag, which contains the motherboard and
daughtercard information. The only argument needed is the file number
(1-80) to be loaded. This command checks for proper initialization of
the daughtercards. If one of the daughtercards does not load properly
the DFEC will exit all command operations, set the error bit, and return
an error into the error return word in the dual port ram. The lower byte
of the error word contains the MB/DC location where the error occurred
and is the same format as the address byte argument for the expert write
file to backplane argument described below. The upper byte of the error
word contains the error code. A code of AAh indicates a checksum error
in the file bitstream, while a code of ACh indicates an error in the
daughtercard start up process. A code of 94h shows a timeout error
usually indicating a missing motherboard. If the address in the file tag
is not a valid slot location then an error code of B3h will be reported.
This command will not report an error if there is a motherboard present
with no daughtercards installed.

**Write File to Backplane (Expert) 0x43** (File : MB / DC)

This command is similar to the previous command except that it allows
the user to define which motherboard / daughtercard the file is to be
loaded to. This command overrides the safety mechanism that the file
version tag provides and makes it possible to load a file into a
motherboard that it was not designed for. The two arguments provided are
the file number (1-80) and the Motherboard / Daughtercard address byte.
The structure of the MB / DC address byte is provided below and is
identical to the address byte present in the file version tag. The file
download checking for this command is identical to that of the auto
write file to backplane command.

  -------- -------- -------- -------- -------- -------- -------- --------
  MB4      MB3      MB2      MB1      MB0      BOT               

  -------- -------- -------- -------- -------- -------- -------- --------

**MB4 -- MB0** provide the motherboard address from 2 through 21

**BOT** is set to indicate the bottom daughercard

**Write File to Compact Flash 0x44** (File)

This command writes a complete file from the 1553 interface to the
compact flash card. The sector data buffer is used to shuffle the data
one sector at a time. The first sector of the file should be present in
the sector data buffer when this command is issued. When the command is
issued, the DFEC moves the sector to the file location specified in the
argument and sets the DRQ bit in the status register. The 1553 interface
then moves the next sector of data into the sector data buffer and
clears the DRQ bit. This shuffling continues until all the sectors for
the file are transferred.

**Write File to 1553 Bus** **0x45** (File)

This command is similar in operation to the previous command. When the
command is issued the DFEC moves the first sector of the file specified
in the argument to the sector data buffer and sets the DRQ bit. The 1553
interface then reads the sector and clears the DRQ bit, telling the DFEC
to fetch the next sector. This routine then continues until all the
sectors for the file are transferred.

**Compact Flash File Version** **0x48** (File)

This command returns the file version tag from the file specified in the
argument. The file version tag returned in this command is for the file
present in the compact flash card. The file version tag is returned to
the tag return word of the dual port ram (address 20h). This command is
useful to verify the file currently loaded in the compact flash file
location.

**Backplane File Version** **0x49** (MB / DC)

This command returns the file version tag from the file currently loaded
in the motherboard / daughtercard specified in the argument. The
argument structure is identical to the "Write File to Backplane
(Expert)" command. Only the second byte of the file version tag is
returned to the tag return word of the dual port ram (address 20h) due
to limitations of memory on the motherboard CPLD where the version tag
is stored. This command is helpful to verify the desired setup of the
motherboards.

**Backplane Reset** **0x4A** (MB)

This command invokes a reset on the motherboard specified in the
argument. This command is used to halt data processing on the
motherboard. The argument byte structure is shown below and there is a
provision in the argument to reset the entire crate of motherboards.

  -------- -------- -------- -------- -------- -------- -------- --------
  MB4      MB3      MB2      MB1      MB0                        

  -------- -------- -------- -------- -------- -------- -------- --------

**MB4 -- MB0** provide the motherboard address from 2 through 21, a
value of 0xF8 (all

> 1's) indicates the entire crate to reset.

**Update All Status** **0x4B** (No Arguments)

This command tells the DFEC to update the status block of data with the
current status of the peripherals. Because the status is not
automatically updated, this command must be used before reading to
insure the most current status is present in the status registers.
Status items updated include the compact flash status, the status from
all the motherboards, and the status of all the daughtercards. Further
information on the configuration of the status block is contained in
engineering note 20000629a.

## Design Considerations

1.  Due to the ability to modify individual sectors, extreme caution
    must be observed when using the "Sector to Compact Flash" low level
    command. It is possible to change the configuration files in the
    compact flash card without modifying the version tag, which can
    corrupt the data collection process. This problem can be very hard
    to find, if it is even noticed, and can only be repaired by
    replacing the invalid file

2.  Care must also be taken when using the "Sector to 1553 Bus" command.
    The data read is transferred to the sector data buffer and
    overwrites any data present in the buffer. It is therefore not
    recommended more than one low level sector movement command be used
    in a multiple command string due to the fact that there is no way to
    pause the command execution while the data is being read.

3.  For the same reasons listed above it is not recommended that file
    movement commands involving the 1553 sector data buffer be used in
    the same multiple command string. This also includes using low level
    commands which implement the data buffer because it is possible for
    the DFEC to overwrite data or rewrite it before the data buffer has
    a chance to be read or written to.

4.  Although some commands may use only a half of a word (byte) and
    leave the other half unused, the entire word must still be set aside
    for the given command. In other words it is not possible to
    "squeeze" a sequence of commands into fewer words by using the
    unused bytes.