Changeset 10224
- Timestamp:
- 03/04/11 09:58:04 (14 years ago)
- Location:
- fact/FADctrl
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/FADctrl/FAD.cc
r10212 r10224 293 293 else if (Match(Parameter[1],"continuous")) { 294 294 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 } 298 303 } 299 304 } … … 617 622 618 623 // Board identification 619 PrintMessage("Board ID % d Firmware revision %dSerial %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); 621 626 622 627 // Slow data 623 628 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); 624 630 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] ); 625 631 PrintMessage("Temperature %.2f %.2f %.2f %.2f", S.Temp[0], S.Temp[1], S.Temp[2], S.Temp[3]); -
fact/FADctrl/FADBoard.cc
r10212 r10224 418 418 419 419 // Extract board and trigger information 420 Status.BoardID = ntoh l(Header->board_id);421 Status.FirmwareRevision = ntoh l(Header->version_no);420 Status.BoardID = ntohs(Header->board_id); 421 Status.FirmwareRevision = ntohs(Header->version_no); 422 422 Status.BoardTime = ntohl(Header->time); 423 423 Status.EventCounter = ntohl(Header->fad_evt_counter); … … 428 428 429 429 // Extract frequency related information 430 Status.Frequency = ntohl(Header->REFCLK_frequency)/1.0e 6;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; 432 432 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; 434 434 else Status.Lock[i] = false; 435 435 } 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 436 444 437 445 // Extract temperatures (MSB indicates if temperature is positive or negative) -
fact/FADctrl/FADBoard.h
r10212 r10224 49 49 float Frequency; 50 50 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; 52 57 uint16_t ROI[NChips][NChannels]; 53 58 uint16_t DAC[NDAC]; -
fact/FADctrl/FADFormat.h
r10212 r10224 39 39 #define BADDR_ROI 0x00 // Baseaddress ROI-Values 40 40 #define BADDR_DAC 0x24 // Baseaddress DAC-Values 41 #define BADDR_CONT_TRIGGER_TIME 0x2C // Baseaddress for the continouus trigger timing. 41 42 #define MAX_VAL 65535 42 43 #define MAX_ROIVAL 1024 … … 67 68 68 69 uint16_t board_id; 69 uint16_t adc_clock_phase_shift; 70 uint8_t zeroes; 71 int8_t adc_clock_phase_shift; 70 72 uint16_t number_of_triggers_to_generate; 71 73 uint16_t trigger_generator_prescaler;
Note:
See TracChangeset
for help on using the changeset viewer.