Command Interface

The DPU receives and processes CCSDS telecommand packets containing one or more commands. Each telecommand packet can be up to 2560 bytes long. The packet consists of a CCSDS header and data; the data is composed of commands. The DPU does not wait for the entire telecommand packet to arrive before dispatching commands within the packet.

Table 13. Telecommand Packet Header Format
NameLength (bits) Value (binary)Description
Version 3 000 Designates a source packet
Type 1 1 Designates a telecommand packet
Secondary? 1 0 No secondary header is present
Application Process ID 11 101 1000 0000
110 0000 0000
CFI
CRISP
Grouping 2 11 = None Grouping flags
Sequence Count 14   Unused
Length 16 0 - 2559 Number of bytes in packet

Command and Macro Processing

Most commands are executed as soon as they are received; exceptions are noted in the individual command descriptions. Each command is echoed after it is executed by the DPU. A command echo subpacket containing the opcode and some arguments along with a code summarizing the command's result is downlinked.

Sixty-four kbytes of DPU memory are reserved for the storage of macros. This memory is initialized with default macros stored with the flight software. A macro can be any length as long as the total length of all the macros fit in the memory. Up to 256 macros may be defined; each macro is identified by a small integer, 0 - 255.

Each command has a "macro" bit. The command handler can be commanded into a "learning" mode to define a macro. If a command arrives with the macro bit set when the command handler is in learning mode, the command is echoed, but not executed; instead the command is added to the macro currently being constructed. Any command that arrives without the macro bit set, will be handled as usual. When not in learn mode, a command that arrives with the macro bit set will be rejected. Later, when a macro is executed, its component commands will be executed and echoed.

Up to 64 macros can be running concurrently. If more than one macro has been commanded to run, one of them is run until completion or until a delay command is executed. Then the next runnable macro is run. At all times, new commands arriving from the C&DH system have priority over macros. Since all commands are executed as soon as they are received from the C&DH system, a macro run command and the macro's constituent commands will also be run immediately. However, the first macro command after a macro delay command will execute near the beginning of the one second 1553-bus major frame.

There are commands for running and stopping a macro. There are also special commands for adding delays to a macro; these can be used only within a macro. One macro can call another or can execute loops. Both calls and loops can be nested. Loop nesting depth is traded with macro nesting depth; each running macro context has a 32 element stack. Each macro call uses two elements; each loop uses three elements.

Several default macros are available as soon as the DPU is started. Most of these macros are one or two commands long and are used by the monitoring subsystem to respond to out of limit conditions. A default macro can be replaced with a new macro via CXX_MAC_DEF and CXX_MAC_ENDDEF.

Commands

All commands start with a 16-bit opcode, the macro bit, and a 15-bit length and conclude with a 32-bit checksum that is the XOR of the entire command. Opcodes are defined to have odd parity so that two bit-flips are needed to transform a valid opcode into another valid opcode. The length field contains the length of the entire command, including the checksum, in 32-bit words. All commands are consequently multiples of 32 bits long. Following the length field are the arguments. Most arguments are a single byte; larger arguments are spread over multiple bytes with the most significant byte first. The last argument may be followed by zero-fill padding to force alignment of the checksum to a 32-bit boundary. The largest command, CXX_MEM_LOAD, determines the largest length field value.

Table 14. Command Format
NameLength (bits) ValueDescription
Opcode 16 Unsigned integer Opcode
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 - 36 Command length in 32-bit words
Argument 1 1-32   First argument
Argument 2 1-32   Second argument
...     Remaining arguments
Pad 0-31 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

The CRISP and CFI common commands are defined below. Generic mnemonics are shown. For every command shown, there is a corresponding CRISP command and CFI command, e.g. CRS_CMD_NULL and CFI_CMD_NULL, etc.

CXX_CMD_CNT_CLR - Clear Command Counter

Clear selected command counter.

NameLength (bits) ValueDescription
Opcode 16 0x0001  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Counter 8 0 = Commands executed
1 = Commands rejected
2 = Macro commands executed
3 = Macro commands rejected
255 = All
Counter to clear
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_CMD_NULL - Do Nothing

Do nothing. Useful for testing command uplink and command echo downlink.

NameLength (bits) ValueDescription
Opcode 16 0x0002  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_CMD_WRAP - Wrapped Command

Process the arguments as a command. Note: the wrapped command will be echoed, not the CXX_CMD_WRAP command.

NameLength (bits) ValueDescription
Opcode 16 0x0004  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 - 36 Command length in 32-bit words
Opcode 16 Unsigned integer Command opcode
Arguments M * 8   Arguments
Pad N * 8 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MAC_DEF - Begin Macro Definition

Start defining the identified macro. All subsequent commands, which have their macro bit set, will be added to the macro; commands without the bit set, will be executed as usual. Macro definition continues until a CXX_MAC_ENDDEF command is seen; CXX_MAC_ENDDEF must not have its macro bit set to end the definition. The macro cannot be run until the definition is complete. If a macro with the same id already exists, the new macro will replace the old when the CXX_MAC_ENDDEF is received. The command will be rejected if the id is invalid.

NameLength (bits) ValueDescription
Opcode 16 0x0007  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Macro Id 8 0 - 255 Macro id
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MAC_DELAY - Delay Macro

Delay macro execution. When a macro executes this command, it will stop for the given number of seconds. This command will be rejected if used outside of a macro definition.

NameLength (bits) ValueDescription
Opcode 16 0x0008  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Delay 16 Unsigned integer Delay (in seconds)
Pad 16 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MAC_END - End Macro

Terminate macro execution. If this is a nested macro, resume the calling macro. This command will be rejected if used outside of a macro definition. Note: the user never need to use this command explicitly; see CXX_MAC_ENDDEF below.

NameLength (bits) ValueDescription
Opcode 16 0x000b  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_MAC_ENDDEF - End Macro Definition

Terminate macro definition. Add an CXX_MAC_END command to the macro being defined and end the definition. This command will be rejected if no macro is being defined.

NameLength (bits) ValueDescription
Opcode 16 0x000d  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_MAC_HALT - Halt Macro

Stop the identified macro. This command will be rejected if the id is invalid, if the identified macro is undefined, or it is not running.

NameLength (bits) ValueDescription
Opcode 16 0x000e  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Macro Id 8 0 - 255 Macro id
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MAC_LOOP_BEGIN - Start a Macro Loop

Start a loop with the given number of iterations. CXX_MAC_LOOP_END decrements the loop index. If it is non-zero, the next command to be executed will be the one after the CXX_MAC_LOOP_BEGIN. If it is zero, the next command will be the one after the CXX_MAC_LOOP_END. This command will be rejected if used outside of a macro definition.

NameLength (bits) ValueDescription
Opcode 16 0x002f  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Iterations 16 Unsigned integer Loop iterations
Pad 16 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MAC_LOOP_END - End a Macro Loop

Mark the end of a macro loop (see CXX_MAC_LOOP_BEGIN). This command will be rejected if used outside of a macro definition.

NameLength (bits) ValueDescription
Opcode 16 0x0031  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_MAC_NEST - Nest Macro

Run the identified macro. The macro that contains the CXX_MAC_NEST command is suspended until the new macro completes. This command will be rejected if the id is invalid or if the identified macro is undefined. This command will also be rejected if used outside of a macro definition.

NameLength (bits) ValueDescription
Opcode 16 0x0010  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Macro Id 8 0 - 255 Macro id
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MAC_PAUSE - Pause Macro

Pause macro execution. When a macro executes this command, the macro will pause until the actual MET is greater than or equal to the given MET. This command will be rejected if used outside of a macro definition.

NameLength (bits) ValueDescription
Opcode 16 0x0013  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Time 32 Unsigned integer MET
Checksum 32   32 bit XOR

CXX_MAC_RESTORE - Restore Macros Saved in EEPROM

Restore the macros saved in EEPROM. All running macros are aborted.

NameLength (bits) ValueDescription
Opcode 16 0x0037  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_MAC_RUN - Run Macro

Run the identified macro. This command will be rejected if the id is invalid or if the identified macro is undefined.

NameLength (bits) ValueDescription
Opcode 16 0x0015  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Macro Id 8 0 - 255 Macro id
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MAC_SAVE - Save Macros in EEPROM

Save all macros in EEPROM.

NameLength (bits) ValueDescription
Opcode 16 0x0038  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_MAC_VERIFY - Verify Macros

Verify macros. TBD.

NameLength (bits) ValueDescription
Opcode 16 0x003b  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 TBD Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_MEM_CHECK - Check Memory

Calculate the checksum of up to 65535 bytes of memory at the given address. The checksum is the 16-bit two's complement sum of the memory indicated. The results are downlinked in a subpacket.

NameLength (bits) ValueDescription
Opcode 16 0x0016  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 4 Command length in 32-bit words
Source 32 Unsigned integer Source address
Byte Count 16 Unsigned integer Number of bytes to check
Pad 16 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MEM_COPY - Copy Memory

Copy DPU memory from source to destination. The source or destination can be either RAM or EEPROM. The result is undefined if the source and destination regions overlap.

NameLength (bits) ValueDescription
Opcode 16 0x0019  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 5 Command length in 32-bit words
Source 32 Unsigned integer Source address
Destination 32 Unsigned integer Destination address
Byte Count 16 Unsigned integer Number of bytes to copy
Pad 16 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MEM_LOAD - Load Memory

Load memory to the DPU. The byte count determines how many load bytes follow and may be up to 128 bytes. The padding after the data forces the size of the load to be a multiple of 4 bytes; M+N is always a multiple of 4.

NameLength (bits) ValueDescription
Opcode 16 0x001a  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 4 - 36 Command length in 32-bit words
Address 32 Unsigned integer Starting address
Byte Count 8 0 - 128 (M) Number of bytes in data field
Spare 24    
Data M * 8   Load data
Pad N * 8 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MEM_READ - Read Memory

Dump up to 65535 bytes of memory from given address.

NameLength (bits) ValueDescription
Opcode 16 0x001c  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 4 Command length in 32-bit words
Source 32 Unsigned integer Source address
Byte Count 16 Unsigned integer Number of bytes to dump
Pad 16 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MEM_READ_ABT - Abort Memory Read

Abort the current memory dump.

NameLength (bits) ValueDescription
Opcode 16 0x001f  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_MEM_RUN - Run a Program

Run a program at the given address. The program must either execute very quickly (so as not to hold up the command handler) or must take over completely. If the program returns, there must be no net stack effects.

NameLength (bits) ValueDescription
Opcode 16 0x0020  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Address 32 Unsigned integer Program start address
Checksum 32   32 bit XOR

CXX_MEM_STR_LOAD - Load Values into a Data Structure

Load the data values into the identified data structure at the location denoted by the offset. The byte count determines how many load bytes follow and may be up to 128 bytes. The padding after the data forces the size of the load to be a multiple of 4 bytes; M+N is always a multiple of 4.

NameLength (bits) ValueDescription
Opcode 16 0x0023  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 4 - 35 Command length in 32-bit words
Id 8 Imager specific Id of data structure
Byte Count 8 0 - 128 (M) Number of bytes in data field
Offset 16 Unsigned integer Byte offset into data structure
Data M * 8   Load data
Pad N * 8 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MEM_STR_READ - Read a Data Structure

Dump the identified data structure.

NameLength (bits) ValueDescription
Opcode 16 0x0025  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Id 8 Imager specific Id of data structure
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_MON_CNTRL - Enable / Disable Monitor Response

Enable or disable monitor response. If enabled, a persistent out-of-limits condition will cause a corresponding response macro to be executed.

NameLength (bits) ValueDescription
Opcode 16 0x0026  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Mode 8 0 = Disable
1 = Enable
Enable/disable response
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_STAT_INT - Set Status Generation Interval

Set the interval between status subpackets.

NameLength (bits) ValueDescription
Opcode 16 0x0029  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Interval 8 1 - 255 (0 = Off) Interval in seconds
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR

CXX_TLM_FLUSH - Flush Telemetry Subpackets

If there is a partially filled subpacket packet, generate a flush subpacket so that the packet will be downlinked.

NameLength (bits) ValueDescription
Opcode 16 0x002a  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 2 Command length in 32-bit words
Checksum 32   32 bit XOR

CXX_TLM_FLUSH_AUTO - Enable/Disable Automatic Subpacket Flush

Enable or disable automatic flushing of partially filled subpacket packet. If enabled, the DPU will try to send a subpacket packet every second, even if the packet has not been completely filled. This is most useful during ground testing since it gives low-latency feedback of command echoes, etc.

NameLength (bits) ValueDescription
Opcode 16 0x002c  
Macro? 1 0 = Execute
1 = Append to macro
Macro load bit
Length 15 3 Command length in 32-bit words
Mode 8 0 = Disable
1 = Enable
Enable/disable automatic flush
Pad 24 0 Pad up to 32-bit boundary
Checksum 32   32 bit XOR


home Return to Common Software User's Guide. Report problems to John Hayes. mail