diff --git a/firmware/register_map_eval5.xls b/firmware/register_map_eval5.xls index c5389c9..49e37e0 100644 Binary files a/firmware/register_map_eval5.xls and b/firmware/register_map_eval5.xls differ diff --git a/software/include/DRS.h b/software/include/DRS.h index 2606989..333ac0c 100644 --- a/software/include/DRS.h +++ b/software/include/DRS.h @@ -76,6 +76,7 @@ unsigned int millitime(); #define REG_EEPROM_PAGE_MEZZ 0x0001A // DRS4 Mezz #define REG_TRG_CONFIG 0x0001C // DRS4 Eval4 #define REG_LMK_LSB 0x0001E // DRS4 Mezz +#define REG_READOUT_DELAY 0x00020 // DRS4 Eval5 #define REG_WARMUP 0x00020 // DRS4 Mezz #define REG_COOLDOWN 0x00022 // DRS4 Mezz #define REG_READ_POINTER 0x00026 // DRS4 Mezz @@ -640,6 +641,7 @@ public: int GetTriggerDelay() { return fTriggerDelay; } double GetTriggerDelayNs() { return fTriggerDelayNs; } int SetSyncDelay(int ticks); + int SetReadoutDelay(int ticks); int SetTriggerLevel(double value); int SetIndividualTriggerLevel(int channel, double voltage); int SetTriggerPolarity(bool negative); diff --git a/software/src/DRS.cpp b/software/src/DRS.cpp index 33042e3..cfb5819 100644 --- a/software/src/DRS.cpp +++ b/software/src/DRS.cpp @@ -2020,6 +2020,8 @@ int DRSBoard::Init() SetDecimation(0); } + SetReadoutDelay(30303 * 0); // in ms + // disable calibration signals EnableAcal(0, 0); SetCalibTiming(0, 0); @@ -2318,6 +2320,19 @@ int DRSBoard::SetSyncDelay(int ticks) /*------------------------------------------------------------------*/ +int DRSBoard::SetReadoutDelay(int ticks) +{ + if (fBoardType == 9) { + Write(T_CTRL, REG_READOUT_DELAY, &ticks, 4); + + return 1; + } + + return 0; +} + +/*------------------------------------------------------------------*/ + int DRSBoard::SetTriggerSource(int source) { short int reg; @@ -4560,7 +4575,7 @@ double DRSBoard::GetTrueFrequency() int DRSBoard::GetTime(unsigned int chipIndex, int channelIndex, int tc, float *time, bool tcalibrated, bool rotated) { - int i, scale, iend; + int i, scale; double gt0, gt; /* for DRS2, please use function below */