next up previous contents
Next: 3.9 A/D Converter and Up: 3 ADS Firmware Previous: 3.7 Error Handling   Contents

Subsections

3.8 CDMS Interface

The CDMS Interface software is implemented according to the document CDMS Subsystems & Instruments Electrical Interface Definition and Generic Payload Control, Extract from REID-A, Ver.5. from 27.10.1998. Please refer to this document for all CDMS related things (concepts, Action Codes, etc.). For the listing see part II.

3.8.1 Address Word Interrupt Service

After a CDMS address word is received (broadcast or with ADS CDMS address), the Address Strobe Interrupt Service is executed. First the CDMS address word is read from the register inside the FPGA. Then it is checked if it is a Transmit Status Word message, which is handled automatically in the FPGA and therefore ignored. If it is no TRSW message, the different address word parameters are extracted (Word Count, T/R flag, Action Code, if it is a broadcast message). Then the Action Code is decoded in the CDMS-TransAC word if it is a Transmit Action Code, or in the word CDMS-RecAC if it is a Receive Action Code.

3.8.2 Transmit Action Code Decoding

Inside the handlers for the different Transmit Action Codes the CDMS transmission is initiated (word CDMS-Trans for multi-word transmissions or g7! for single word transmissions). Then the CDMS Message Error (ME) flag is reset if it was a valid Action Code, otherwise it is set. The transmission of housekeeping data is a bit different.

3.8.3 Receive Action Code Decoding

Inside the handlers for the different Receive Action Codes it is first checked, if the last received message of the same type is already handled. If not, an error flag is set. This check is only performed for non-broadcast messages, because two broadcast messages can be transmitted immediately after each other on the main and redundant line and the processor is possibly to slow a the chosen clock frequency for finishing handling the first message until the second is received. But this seems to be no big problem because broadcast messages only are showing a status change and if only the first ore both messages are processed should be neglectible. After that receiving of data from CDMS is initiated (word CDMS-Rec). Then the CDMS Message Error (ME) flag is reset if it was a valid Action Code, otherwise it is set. For the RSST, STBY, RCMD and RCMS Action codes the word count to receive is stored to the first word of the corresponding buffer for easier processing.

3.8.4 Receiving and Decoding CDMS Command Words

Receiving of CDMS command words is initiated by the word CDMS-Rec when decoding Receive Action Codes. If receiving is already in progress an error flag is set. The word Rec-Service is the interrupt handler for receiving command words from CDMS and is called for every single command word. After receiving of a message is finished the Rec-Handle word is called. Handler code should be implemented into this word for the different CDMS messages.

After the processing of the received message is finished, the corresponding bit in the CDMS_Cmd? variable is reset.

3.8.5 Transmitting CDMS Data

Transmitting of CDMS data is initiated by the word CDMS-Trans when decoding Transmit Action Codes. If transmission is already in progress an error flag is set. The word TR-Service is the interrupt handler for transmitting words to CDMS and is called for every single data word.

3.8.6 Transmitting Housekeeping Data

The ADS instrument is able to deliver 8 different housekeeping words to the CDMS system. For all housekeeping words registers are existing inside the FPGA for holding the current values. The transmission of the housekeeping data is handled automatically by the FPGA, no interaction from the CPU is necessary (which is a request from the CDMS designers). The CPU is only responsible for the updating of the housekeeping registers with current values. This is best done after the THKD Action Code is received. Only the HK channel that will be transmitted is going to be updated. The current values of the HK channels are held in the HK_Buf array. Six of the housekeeping registers are freely disposable, two contain fixed values (the Control Register and a synchronisation word (0xAA55), which can also be used to check if ADS is powered and that no bit shift errors are occurring).

3.8.7 Requesting CDMS Service

To request a service from CDMS, the CDMS-Request word has to be called with the CDMS request code as argument. If there is already a new request pending, an error flag is set.


next up previous contents
Next: 3.9 A/D Converter and Up: 3 ADS Firmware Previous: 3.7 Error Handling   Contents
Peter Schmid 2001-05-18