Changeset 10224


Ignore:
Timestamp:
Mar 4, 2011, 9:58:04 AM (9 years ago)
Author:
neise
Message:
new FAD data format implemented
Location:
fact/FADctrl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • fact/FADctrl/FAD.cc

    r10212 r10224  
    293293        else if (Match(Parameter[1],"continuous")) {
    294294          Boards[i]->Send(CMD_Trigger_C);
    295           if (Parameter.size() == 3 && ConvertToInt(Parameter[2], &Num)) {
    296             if (Num == 0) Boards[i]->Send(CMD_Trigger_S);               
    297                 else Boards[i]->Send(0x2100 + (unsigned char) (1000.0/Num/12.5));
     295          if (Parameter.size() == 3 && ConvertToInt(Parameter[2], &Num)) {                     
     296            if (Num == 0)
     297                                Boards[i]->Send(CMD_Trigger_S);         
     298                        else {
     299                                //Boards[i]->Send(0x2100 + (unsigned char) (1000.0/Num/12.5));
     300                                Boards[i]->Send( CMD_Write | BADDR_CONT_TRIGGER_TIME );
     301                                Boards[i]->Send((unsigned short) (1000.0/Num/12.5));
     302                        }
    298303          }
    299304        }
     
    617622
    618623        // Board identification
    619         PrintMessage("Board ID %d      Firmware revision %d      Serial %llx\n", S.BoardID, S.FirmwareRevision, S.DNA);
    620         PrintMessage("Board time %d      Event counter %d\n", S.BoardTime, S.EventCounter);
     624        PrintMessage("Board ID %.4x      Firmware revision %.4x      Serial %llx\n", S.BoardID, S.FirmwareRevision, S.DNA);
     625        PrintMessage("Board time %gs       Event counter %d\n", S.BoardTime/1.0e4 , S.EventCounter);
    621626
    622627        // Slow data
    623628        PrintMessage("Frequency %.2f GHz    Phase shift %d    PLL lock %d %d %d %d\n", S.Frequency, S.PhaseShift, S.Lock[0], S.Lock[1], S.Lock[2], S.Lock[3]);
     629        PrintMessage("DENABLE %d  DWRITE %d  SPI_clk %d DCM_lock: %d DCM_ready %d\n", S.denable, S.dwrite, S.spi_clk, S.DCM_lock, S.DCM_ready);
    624630        PrintMessage("DAC %d %d %d %d   %d %d %d %d\n", S.DAC[0], S.DAC[1], S.DAC[2], S.DAC[3], S.DAC[4], S.DAC[5], S.DAC[6], S.DAC[7] );
    625631        PrintMessage("Temperature %.2f %.2f %.2f %.2f", S.Temp[0], S.Temp[1], S.Temp[2], S.Temp[3]);
  • fact/FADctrl/FADBoard.cc

    r10212 r10224  
    418418
    419419          // Extract board and trigger information
    420           Status.BoardID = ntohl(Header->board_id);       
    421           Status.FirmwareRevision = ntohl(Header->version_no);
     420          Status.BoardID = ntohs(Header->board_id);       
     421          Status.FirmwareRevision = ntohs(Header->version_no);
    422422          Status.BoardTime = ntohl(Header->time);
    423423          Status.EventCounter = ntohl(Header->fad_evt_counter);
     
    428428
    429429          // Extract frequency related information
    430           Status.Frequency = ntohl(Header->REFCLK_frequency)/1.0e6;
    431           Status.PhaseShift = ntohs(Header->adc_clock_phase_shift);
     430          Status.Frequency = ntohl(Header->REFCLK_frequency)/1.0e3*2.048;
     431          Status.PhaseShift = Header->adc_clock_phase_shift;
    432432          for (unsigned int i=0; i<NChips; i++) {
    433                 if ((Header->PLLLCK & (1<<i)) != 0) Status.Lock[i] = true;
     433                if ((ntohs(Header->PLLLCK)>>12 & (1<<i)) != 0) Status.Lock[i] = true;
    434434                else Status.Lock[i] = false;
    435435          }
     436
     437                // Extract Firmware status info
     438                Status.denable = (bool) ( ntohs(Header->PLLLCK) & (1<<11) );
     439                Status.dwrite = (bool) ( ntohs(Header->PLLLCK) & (1<<10) );
     440                Status.DCM_lock = (bool) ( ntohs(Header->PLLLCK) & (1<<9) );
     441                Status.DCM_ready = (bool) ( ntohs(Header->PLLLCK) & (1<<8) );
     442                Status.spi_clk = (bool) ( ntohs(Header->PLLLCK) & (1<<7) );
     443
    436444
    437445          // Extract temperatures (MSB indicates if temperature is positive or negative)
  • fact/FADctrl/FADBoard.h

    r10212 r10224  
    4949          float Frequency;
    5050          bool Lock[NChips];
    51           uint16_t PhaseShift;
     51                bool denable;
     52                bool dwrite;
     53                bool DCM_lock;
     54                bool DCM_ready;
     55                bool spi_clk;
     56          int8_t PhaseShift;
    5257          uint16_t ROI[NChips][NChannels];
    5358          uint16_t DAC[NDAC];
  • fact/FADctrl/FADFormat.h

    r10212 r10224  
    3939#define BADDR_ROI 0x00          // Baseaddress ROI-Values
    4040#define BADDR_DAC 0x24          // Baseaddress DAC-Values
     41#define BADDR_CONT_TRIGGER_TIME 0x2C // Baseaddress for the continouus trigger timing.
    4142#define MAX_VAL 65535
    4243#define MAX_ROIVAL 1024
     
    6768
    6869  uint16_t board_id;
    69   uint16_t adc_clock_phase_shift;
     70        uint8_t  zeroes;
     71  int8_t adc_clock_phase_shift;
    7072  uint16_t number_of_triggers_to_generate;
    7173  uint16_t trigger_generator_prescaler;
Note: See TracChangeset for help on using the changeset viewer.