-   -
-   Home Page Field Missions Engineering More Info [MAP Menu]

SB/64 Ungated Counters

Addressing

Status Word

Operation

The counters are automatically synchronized with reads of the status word, but in order for this to work reliably, we need to take steps to make sure the status and the counters are read in the correct order and close together in time. i.e. we need to use a TM group to collect the counters:

    %{
      #define CT24long(x) ((long)(x).low + (((long)(x).high)<<8))

      TM typedef struct {
        unsigned short low;
        unsigned char high;
      } CT24 { convert long CT24long(); }
      TM CT24 4 Hz DetA;
      TM CT16 4 Hz DetB, DetC, DetD;

      Group Cts ( CtStat, DetA, DetB, DetC, DetD ) {
        CtStat = sbwa( CtStat.address );
        DetA.low =  sbwa( DetA.address );
        DetA.high = sbba( DetA.address+2 );
        DetB = sbwa( DetB.address );
        DetC = sbwa( DetC.address );
        DetD = sbwa( DetD.address );
      }
    %}

Initialization:

The counters must be programmed initially to set the integration period. This must match the reporting rate.

      %{
        #define DG_CUSTOM_INIT Ct64_init()
        static void Ct64_init( void ) {
          sbwr( 0x600, 0x0300 ); /* HCtr 4 Hz */
          sbwr( 0x640, 0x0300 ); /* NCtr 4 Hz */
        }
      %}


last updated: Fri Oct 4 15:12:06 2002 webmaster@huarp.harvard.edu
Copyright 2002 by the President and Fellows of Harvard College
[Home] [People] [More Info] [Research Areas] [Field Missions] [Engineering]