DESC: Products #03 Raw Events, #04 Full Events 
   
HIST: 	05-10-94  JLC 	Created file (from p-mass.asm)
       	95-01-30  CAI  	Fix bug which stopped prod after 1 spin. v1.53
       	95-09-08  CAI  	Fix 2 bugs which stopped prod after 1 pkt. v1.88
      	95-11-13  CAI  	Update memory use comments.
       	96-01-13  CAI  	Implement 16-level prioritized tlm queues. v1.94
       	96-05-30  CAI  	Add P04 (Full Events). v2.11  
	96-06-07  AMD 	Ported the code to ESIC. Upgraded comments for 
 	 		16 * 22.5° sweeps
	02-09-97  AMD  	Fix r10-trashing error in events subtask
                      	error handling. according to CAI Cis-1 v2.20  
NOTE:   P03 AND P04 MEMORY USE
         
       	The summation buffer memory is reused for the telemetry 
       	packet buffer.  In addition four words are allocated just 
       	before the summation buffer for a 2-word packet handling 
       	structure and 2-word packet header.  Memory use is:  
            Length
           (words)   Description
            ------   ---------------
                2    packet handling structure
                2    packet header
             1024    Event summation Buffer
            ------   
             1028    total per product buffer
               21    product variables
               27    sub-task tss
            ------
             1076    Allocation for 1st buffer
               27    task tss (at prod task creation)
            ------
             1103    Total allocation for 1-buffer product
             1028    Allocation for 2nd buffer
            ------
             2131    Total allocation for 2-buffer product  
            After allocation, the memory is organized as follows:  
            Offset(h)  Memory use
            ---------  ----------------
            0000-0015  prod vars
            0016-0030  tss_s
            0031-0032  tlm pkt struct 1
            0033-0034  tlm pkt hdr 1
            0035-0C34  sum buf 1
            0C35-1034  tlm pkt struct 2 (if two buffers)
            1035-1036  tlm pkt hdr 2     (if two buffers)
            1037-1C36  sum buf 2         (if two buffers)  
       P03 GENERATION  
       This product monitors the TOF event interface via DMA data 
       collection.  Up to 1024 events are stored in the buffer.  
       Collection starts at the phase adjustment from SRP.
       P03 DATA COLLECTION
        
       The events are collected from the Event board via a DMA 
       interface.  The DMA interface is configured to prevent 
       periods of extremely high event frequency from excessively 
       preempting the CPU by monopolizing the bus.  The event 
       buffer size is set equal to the max # of events per 22.5 
       degree period (100 words).  
       P03, P08, and P35 use the TOF DMA channel.  Only one
       product at a time can use the DMA.  If another product is 
       using the DMA when P03_TASK starts, P03 will kill itself.  
       (See CIS.ASM, P-CIS.ASM, P-EVTS.ASM, and P-MASS.ASM.)  
       This product task must set a DMA flag  to 1 to enable the 
       DMA Event channel (performed by SECT_ISR at an even 22.5
       deg boundary).  Another flag  indicates whether the DMA 
       Event interface should be enabled.  These flags are set 
       when this product is enabled and are zeroed by INIT_PRODS 
       of MODE_TASK whenever a new operating mode is entered.  
       Thus, to init the DMA Event channel during task initializa-
       tion, the Enable flag is first set, then the channel 
       address is tested (if zero, it's not been unmasked since 
       reset).  If the address is zero, set the Unmask flag, else 
       test for a non-negative count.  If a negative count, set 
       the Unmask flag.  Otherwise, the DMA event channel is 
       already running; don't need to Unmask it.  The Enable flag 
       is the MSbit and the Unmask flag is the LSbit of the bit 
       flag variable.  
       The 16-bit event data is defined as:  
        MSB               DMA TOF EVENT BIT DEFINITIONS             LSB
       *-------*---*---*---*-----------*-------------------------------*
       | 0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 |
       *-------|---|---|---|-----------|-------------------------------*
       | 0   0  ps  sen ep      es                    tof              |
       *-------*---*---*---*-----------*-------------------------------*  
       MSbits: 00z = TOF event data; 11z = HV sector marker  
       ps  = proton suppression (0 = all, 1 = 1/16) (ignored by P03)
       sen = selected sensitivity (0 = L, 1 = H)    (ignored by P03)
       ep  = event stop address                     (ignored by P03)
       es  = event start address (anode #, 0-7)
       tof = time of flight (00-FFh)  
       	If the two MSbits equal 00z, the word is a TOF event 
       	(defined above).
       	If the two MSbits equal 11z, the word is a HV sector marker 
       	(defined below).  
        MSB             DMA HV MARKER BIT DEFINITIONS               LSB
       *---------------*-----------------------------------------------*
       | 0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 |
       *---------------|-----------------------------------------------*
       | 1   1   1   1   0               sector                        |
       *---------------*-----------------------------------------------*  
       sector = HV step number since SRP+phase (0000-07FFh, 0-2047),
       encompassing 4 HV steps per e-step, 32 e-steps per sweep,
       and 16 sweeps per spin as follows:  
       *---------------*-----------------------------------------------*
       | 0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 |
       *---------------|-------------------|-------------------|-------*
       | 1   1   1   1   0   sweep (0-15)      e-step (0-31)    HVstep |
       *---------------*-------------------*-------------------*-------*
  
       P04 GENERATION  
       Product 04 monitors the TOF event interface via the CODIF 
       digital board I/O interface.  Up to 512 two-word events are 
       stored in the collection buffer.  Each stored event consists 
       of a PHA_TOF register sample in the first word and a PHA_POS 
       register sample in the second word.  
       P04 DATA COLLECTION  
       The events are collected from the CODIF digital board via an 
       I/O interface.  Each event consists of a PHA_TOF register 
       sample (first word) and a PHA_POS register sample (second 
       word).  If the Data Flag bit of the TOF register is a one, 
       the register samples are saved in the collection buffer; if 
       the Data Flag is zero, the samples are ignored.  Collection 
       begins at the spin event and continues until the collection 
       buffer is full.  The collection buffer size is set equal to 
       the maximum telemetry packet size (1024 words).  
       The 16-bit PHA TOF register data is defined as:  
        MSB            PHA TOF REGISTER BIT DEFINITIONS            LSB
       *---*---------------------------*-------------------------------*
       | 0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 |
       *---|---------------------------|-------------------------------*
       | df  x   x   x   x   x   x   x                tof              |
       *---*---------------------------*-------------------------------*  
        df = data flag (1 = new event, 0 = after read)
         x = not defined
       tof = time of flight (00-FFh)  
        The 16-bit PHA POS register data is defined as:  
        MSB            PHA POS REGISTER BIT DEFINITIONS            LSB
       *---*-------------------*-------*-------------------------------*
       | 0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 |
       *---|-------------------|-------|-------------------------------*
       | df  x   x   x   x   x    stop               start             |
       *---*-------------------*-------*-------------------------------*  
          df = data flag (1 = new event, 0 = after read)
       	   x = not defined
        stop =  stop position bits PR2 (MSb) and PR1 (LSb) 
       start = start position bits PF8 (MSb) thru PF1 (LSb)   
       The 1024-word collection buffer becomes the telemetry 
       packet data.  No summation, averaging, compression, or
       other processing is performed.  

 


TLM tables ] [ Diag events ] Mag field ] Moments ] 3D Mass ] 3D distributions ] 3D compr ] Scrtch Pxs ]

Home Page