Home Random Page


CATEGORIES:

BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism






Message Control Field

Table 23: Message Control Field

Bit 7 (MSB) “Poll/Final” Bit
Bit 6 “B” Bit
Bit 5 “ACK” Bit
Bits 4 – 0 Command code

The message control field packs four values into a single byte. The command code is an enumerated value between 0x00 and 0x1F that determines how the data field should be interpreted.

The “ACK” bit is ignored on commands coming into the star tracker. On telemetry reply messages sent by the star tracker it is set to indicate successful execution of the command, or cleared to indicate that the command cannot be executed.

The “B” bit is copied unchanged from a command message into its reply message. The star tracker does not use it internally.

The “Poll/Final” bit is interpreted differently for command and telemetry messages. For a command, the bit is “Poll”. If it is set to ‘1’ then the star tracker will generate a telemetry message in reply. If it is cleared to ‘0’ then the command will be executed, but no response telemetry message will be sent.

For a telemetry message, the bit is “Final”. If a reply consists of a single telemetry message, then the bit is set to ‘1’. If a reply is too large to fit into a single message then the final message has the bit set to ‘1’ and the others have the bit cleared to ‘0’.

Data Field

The interpretation of the data field is dependent on the command code in the message control field. Some command codes may have no data, some may require a certain fixed number of data bytes, and some can accept a variable data length.

Message CRC

Each NSP message contains a 2 byte (16-bit) CRC to guard against errors in transmission. The 16-bit CCITT polynomial is used: x^16 + x^12 + x^5 + 1. The initial shift register value is 0xFFFF. Bytes are fed into the CRC computation starting with the destination address, and concluding with the last byte of the data field. Within a byte, bits are fed in LSB first.

The following fragment of C code, courtesy of Henry Spencer, illustrates how the CRC can be computed.

#define POLY 0x8408 /* bits reversed for LSB-first */

unsigned short crc = 0xffff;

while (len-- > 0) {

unsigned char ch = *bufp++;

for (i = 0; i < 8; i++) {

crc = (crc >> 1) ˆ ( ((ch ˆ crc) & 0x01) ? POLY : 0 );

ch >>= 1;

}

}

Error Conditions

The star tracker will ignore NSP command messages where the destination address does not correspond to the NSP address of either the supervisor or functional processor. NSP messages addressed to the functional processor will be ignored if the unit is not in maintenance mode. NSP messages with invalid CRC, invalid encapsulation, too short or too long are also ignored. In none of these cases will any reply message be generated.

If an NSP command message is in error due to an unknown command code, or if the data field is not consistent with the requirements of the command code, and if the “Poll” bit is set, then a NACK reply message will be generated. This message will be the same length as the command message, and contain the same data field. The command code will be the same, as will the “B” bit. The “ACK” bit will be cleared to ‘0’.



Command Timing

For the star tracker attitude data to be useful, it is necessary to communicate quaternion epoch information with the host spacecraft. In those configurations where a discrete synchronization pulse connection is not available, timing information is carried over the command and telemetry serial link.

When a command is sent by the host to the supervisor processor, the time that the packet is received is recorded. This is defined as the time of reception of the final FEND, including the stop bit. The host spacecraft may elect to transmit most of a command, and then delay the final FEND until the exact desired moment. Since there are no timeouts on the NSP link this delay can be arbitrarily long.

When the star tracker returns epoch information in telemetry, the time is measured relative to the FEND character that finishes the GO or COMBINATION command that has caused the imaging cycle.


Date: 2015-12-17; view: 671


<== previous page | next page ==>
Asynchronous Serial | Protocol Layer 5 (Session Layer)
doclecture.net - lectures - 2014-2024 year. Copyright infringement or personal data (0.006 sec.)