GSFC/NGIMS-FSW-020 EEPROM Interface Control Document for CONTOUR/NGIMS Flight Software Prepared By: Michael Paulkovich, Lead Software Engineer for Hasso Niemann, Paul Mahaffy, Co-Investigators NASA/GSFC Code 915 Laboratory for Planetary Atmospheres October 31, 2001 Vers. 2.8 DOCUMENT CHANGE HISTORY Version Date Change 2.7 Oct 29, 01 First CM version. Remove auto-start data. 2.8 Oct 31, 01 Mods to AMB-38 through -41; Add to "notes" section: v3.7.00 Alt Boot statistics I Purpose This document describes the layout and data formats for the AMB (Adaptive Memory Block) area of EEPROM for the NGIMS instrument. The AMB area consists of: QP (quadrupole) computation parameters (for instance, Config Tables); Subscan Tables; appropriate calibration data; software adaptation data; and software constants. These represent constants that may be defined in any of the requirement, design or code phases, that are normally adjusted during testing and calibration phases, and thus should be modifiable and maintained in non-volatile memory (in this case EEPROM) for automatic application upon boot-up. II Overview The FSW (Flight Software) maintains default values for all AMB parameters (which can be uploaded to EEPROM) in PROM (which, of course, can not be changed). The AMB parameters are shadowed in (that is, loaded into) RAM for use by the FSW during program operation. Values in EEPROM can be altered after the final PROM has been inserted into the instrument, so EEPROM AMB values aren't necessarily the same of those placed into PROM. Note that {Patch} telecommands can alter EEPROM, but they don't automatically alter their shadowed RAM counterparts. Execution of the {TableUpdate} command results in loading of RAM with the AMB segment of EEPROM (with no checksum test). The EEPROM undergoes a checksum test upon boot-up. If the EEPROM checksum tests pass, the EEPROM values for AMB parameters are loaded into RAM for use by the FSW. Of course, if the EEPROM checksum tests fail, the "as-launched" PROM values are used by the FSW, and any uploaded EEPROM values are ignored. 1. Conventions This section describes the conventions and special nomenclature used to describe the interface data. 1.1 Word Definition The word size for the 1750 FC (Flight Computer) is 16 bits. The bit numbering is such that the MSB is bit 0, the LSB is bit 15. 1.2 Data Types Below are the basic data types for the AMB data objects: Type Notes # Bits Int16 MSB is sign. In this document, also refers to any unsigned 16-bit numbers 16 Boolean LSB is the only applicable bit. 1=TRUE. 16 Float 32-bit Mil-Std-1750A floating point type* 32 Fixed Radix point between two indicated bits; bits to right of radix point are fractional. 16 * Two-word Floating Point Format (see diagram below) - 8-bit signed Exponent in LSBs of 2nd word 23-bit Mantissa in bits 1..23 1-bit Sign in MSB of 1st word 0 1 15 s Mantissa MSBs 0 7 8 15 Mantissa LSBs s Exponent The decimal point in the mantissa is between bits 0 and 1. The value is computed as 2**exponent*mantissa. 1.3 Data Subtypes There are specific subtypes of the above basic types used in the NGIMS AMB data as shown below. The Size column indicates the number of words of EEPROM used to store the data type: Subtype Base Type Range LSB Size Notes Scale_8 Fixed -126.0 .. 126.0 1/256 1 Used for Correction Limits Scale_14 Fixed -1.999 .. 1.999 1/16384 1 Used for Temperature Coefficients Dac_Index Int16 1..29 1 1 1=Vac, 2=Vdc, etc - see DAC memo Rf_Dac Int16 1..2 1 1 Subset of Dac_Index: 1=Vac, 2=Vdc Amu_Code Int16 0..4020 1 1 0..301 = AMUs, 4000..4099 = Bands Band_Amu Int16 4000 .. 4020 1 index 0..20 Mass Int16 0..301 1 1 Used for "L" lookup table Freq Int16 0..2 1 1 0=XX, 1=XX, 2=XX Config Int16 0..3 1 1 Selected Config: 0=Open_Source, 1=Closed_Source, 2=Ion_Mode, 3=Neutral_Thermal Lconfig Int16 0..4 1 1 "Logical" Config. Computed based on: - "selected" Config - Mass Code - Ion Mode Cutoff Mass 0=Open_Source, 1=Closed_Source, 2=Ion_Mode_Lo_E, 3=Ion_Mode_Hi_E, 4=Neutral_Thermal Omega Int16 0..3 1 1 0 = 0 degrees 1 = 0.5 degrees 2 = 2.5 degrees 3 = 6.0 degrees IP_Index Int16 1..15 1 1 Used for indexing Select Words SS_Table Int16 0..255 1 1 Each SS_Table contains 15 Select Words SS_Rec Record 2 wds + 15 IPs n/a 17 Subscan Table layout: Adaptive Flag (note 1) Source (note 2) Subscan (note3) User_Mux Int16 1..91 1 1 "User" Mux ID number, 1..91. See 0770491 AD_Index Int16 0..255 1 1 Index into table of 256 A/D IDs note 1: Set = 1 means this table is a special subscan of all Bands for the Adaptive Scanning Algorithm note 2: Source: 0=OS, 1=CS, 2=IM, 3=NT note 3: The Subscan consists of 15 Select Words. 1.4 Data Structures There are two types of AMB data structures - Simple structures, and Arrays. Simple structures have a straightforward layout in EEPROM -- each Simple data object consists of one object, and in fact, just one 16-bit word (that is, there are no Simple structures of type Float). But arrays may be accessed by one, two, or more indices. The simplest example is an array of one dimension (one index); the following nomenclature form in this document: ... represents a one-dimensional array, accessed by an index of type Dac_Index (range 1..29). Each data item in such an array is one 16-bit word of type Int16 (16-bit integer). An array of this type yields the following layout in EEPROM: Array Index Address Offset (16-bit words:) 1 0 X X X X X X X X X X X X X X X X 2 1 X X X X X X X X X X X X X X X X 3 2 X X X X X X X X X X X X X X X X 4 3 X X X X X X X X X X X X X X X X 5 4 X X X X X X X X X X X X X X X X 6 5 X X X X X X X X X X X X X X X X 7 6 X X X X X X X X X X X X X X X X 8 7 X X X X X X X X X X X X X X X X 9 8 X X X X X X X X X X X X X X X X 10 9 X X X X X X X X X X X X X X X X 11 10 X X X X X X X X X X X X X X X X 12 11 X X X X X X X X X X X X X X X X 13 12 X X X X X X X X X X X X X X X X 14 13 X X X X X X X X X X X X X X X X 15 14 X X X X X X X X X X X X X X X X 16 15 X X X X X X X X X X X X X X X X 17 16 X X X X X X X X X X X X X X X X 18 17 X X X X X X X X X X X X X X X X 19 18 X X X X X X X X X X X X X X X X 20 19 X X X X X X X X X X X X X X X X 21 20 X X X X X X X X X X X X X X X X 22 21 X X X X X X X X X X X X X X X X 23 22 X X X X X X X X X X X X X X X X 24 23 X X X X X X X X X X X X X X X X 25 24 X X X X X X X X X X X X X X X X 26 25 X X X X X X X X X X X X X X X X 27 26 X X X X X X X X X X X X X X X X 28 27 X X X X X X X X X X X X X X X X 29 28 X X X X X X X X X X X X X X X X In this document, an example array of two dimensions is indicated by two indices in parenthesis, e.g. the following form: X_Array : array (Freq) (Rf_Dac) of Float ...would indicate an array with one dimension of Freq and a second dimension of Rf_Dac; and each data item in the array is of type Float. A "real" example of a multi-dimensional array is the "L" array of GSFC/NGIMS-FSW-015, which would be specified in this document as: Config_L : array (Freq) (Mass) (Rf_Dac) of Int16 ... which selects data of type Int16, based upon three indices: Freq (range 0..2), Mass (range 0..301); and Rf_Dac (range 1..2). It is depicted pictorially as follows: AMU 0 1 2 3 4 5 ... 300 301 LLF vac, vdc vac, vdc vac, vdc vac, vdc vac, vdc vac, vdc ... vac, vdc vac, vdc LMF vac, vdc vac, vdc vac, vdc vac, vdc vac, vdc vac, vdc ... vac, vdc vac, vdc LHF vac, vdc vac, vdc vac, vdc vac, vdc vac, vdc vac, vdc ... vac, vdc vac, vdc The Tartan Ada compiler allocates such an array in memory as shown below. The order of the indices dictates the grouping of the data blocks, in this example, first by Freq, then Mass, then Rf_Dac. The size of the data objects in the array, of course, along with the index ranges, dictates the size of each data block. Rel. Addr Freq Mass Data 0000 0001 0002 0003 0004 0005 0006 0007 ... LF 0 1 2 ... 301 Vac Vdc Vac Vdc Vac Vdc Vac Vdc Vac Vdc etc MF 0 1 ... 301 Vac Vdc Vac Vdc Vac Vdc Vac Vdc etc HF etc etc 2. AMB Data Formats and Addresses EEPROM Address (hex) AMB Data #Words (dec) AMB1-5 0000 spare 1 AMB-06 0005 Config Table A coefficients -- Config_A : array (LConfig) (Dac_Index) of Float 2 words each, 5x29 290 AMB-07 127 Config Table B coefficients -- Config_B : array (LConfig) (Dac_Index) of Float 2 words each, 5x29 290 AMB-08 249 Config Table G coefficients -- Config_G : array (LConfig) (Dac_Index) (Omega) of Float 2 words each, 5x29x4 1160 AMB-09 6D1 Config Table H coefficients -- Config_H : array (LConfig) (Dac_Index) of Int16 (note: valid values are range +-3000) 1 word each, 5x29 145 AMB-10 762 Config_K1 : array ((Dac_Index) of Int16 1 word each, 5x29 145 AMB-11 7F3 Config_L : array (Freq) (Mass) (Rf_Dac) of Int16 1 word each, 3x302x2 1812 AMB-12 F07 Config_E : array (Freq) (Dac_Index) of Float 2 words each, 3x29x2 174 AMB-13 FB5 Config_C : array (Int16, Int16, Scale_14, Int16) 4 words each (Lower, Upper, C1, C2), 2x12 96 AMB-14 1015 Config_K2 : array ((Dac_Index) of Int16 1 word each x 29 29 AMB-15 1032 RF_Corr_YN_Array : array (Dac_Index) of Boolean 1 word each x 29 29 AMB-16 104F Temp_Corr_YN_Array : array (Dac_Index) of Boolean 1 word each x 29 29 AMB-17 106C RFMon_Corr_Limit : array (Freq) of Int16 3 AMB-18 106F Temperature_Corr_Limit_RF : not used 1 AMB-19 1070 Temperature_Corr_Limit_Non_RF : not used 1 AMB-20 1071 RFMon_Avg_Sample_Number : Int16 1 AMB-21 1072 Temperature_Avg_Sample_Number (spare, PROM value of 3 is used) 1 AMB-22 1073 RFMon_Nominal_LF : Int16 1 AMB-23 1074 RFMon_Nominal_MF : Int16 1 AMB-24 1075 RFMon_Nominal_HF : Int16 1 AMB-25 1076 Ion_Mode_Mass_Switchover : Amu_Code 1 AMB-26 1077 spare 609 AMB-27 12d8 Subscan_Tables : array (SS_Table) (SS_Rec) of Int16 1 Select Word each (256)x(2+15). See GSFC/NGIMS-FSW-015 §10.1. 3165 AMB-28 23d8 Mux_Array : array (AD_Index) of User_Mux 256 AMB-29 24d8 DAC Overrides : array (29) of [Flag / Int16] records 58 AMB-30 2512 InitMode_DACs : array (29) of Int16 46 AMB-31 2540 Band_DAC : array (Band_Amu) (Dac_Index) of Int16 1 word each 21x29x3 2436 AMB-32 2EC4 spares 11 AMB-33 2ECD spares 3 AMB-34 2ED0 Config Table ID block 48 AMB-35 2F00 ETCBoot Version# 1 AMB-36 2F01 ETCBoot EEPROM Checksum computed byf LOG2CTB program 1 AMB-37 2F02 Patch "FAT" (in "Copytable" format) <256 required for load image; 5*256 added for up to 256 patches. 256 + 1280 =1536 AMB-38 3502 Load Image (in "Copytable" format) to ~E700 <44000 AMB-39 ~E700 Patch data area - start addr depends on NGIMS load image ~2300 AMB-40 F000 spares 1088 AMB-41 F440 Allocated for ATCS - spare 3004 AMB-42 FFFC AMB Load Flag: set to AB12h to cause FSW to do TableUpdate on boot 1 AMB-43 FFFD ETCBoot Load Counter: decrements to zero on each reboot/power cycle. Value of zero means don't ETCBoot. 1 AMB-44 FFFE spare 1 AMB-45 FFFF Checksum 1 NOTES EEPROM 0 Spares = ~ 609+11+1280+3840+1088=~ 6828d Sample output of LOG2CTB program: Starting Storage Addresses were: for Version: 2f00 for Checksum: 2f01 for CTB FAT: 2f02 for CTB Data: 3502 Total number of zeroblock words: 22425 (5799h) High EEPROM Data Address: dd67 High EEPROM FAT Address: 2fc6 Compressed data size (decimal): 43109 Compressed data size (hex): a865 v3.7.00 Alt Boot statistics Oct 30 2001: Starting Storage Addresses were: for Version: 2f00 for Checksum: 2f01 for CTB FAT: 2f02 for CTB Data: 3502 Total number of zeroblock words: 19912 (4dc8h) High EEPROM Data Address: e738 High EEPROM FAT Address: 3016 Compressed data size (decimal): 45622 Compressed data size (hex): b236 END