diff --git a/RELEASE.txt b/RELEASE.txt index 80948afad..f65e9b01a 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -98,7 +98,7 @@ This document describes the differences between v7.0.0 and v6.x.x - ctb and moench Fw fixed (to work with pattern commdand) )addreess length - setting rx_hostname (or udp_dstip with rx_hostname not none) will always set udp_dstmac. solves problem of chaing udp_dstip and udp_dstmac stays the same - jungfrau reset core and usleep removed (fix for 6.1.1 is now fixed in firmware) - +- g2 change clkdivs 2 3 4 to defaults for burst and cw mode. 2. Resolved Issues ================== diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 27823ec5d..fc419b4bf 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2563,6 +2563,7 @@ class Detector(CppDetectorApi): Note ---- BURST_INTERNAL (default), BURST_EXTERNAL, CONTINUOUS_INTERNAL, CONTINUOUS_EXTERNAL + Also changes clkdiv 2, 3, 4 """ return self.getBurstMode() diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 299ee4664..12020d844 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 3e49b802e..c517d5a51 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -1750,6 +1750,52 @@ void updatingRegisters() { LOG(logINFO, ("\tDone Updating registers\n\n")); } +int updateClockDivs() { + char *clock_names[] = {CLK_NAMES}; + switch (burstMode) { + case BURST_INTERNAL: + case BURST_EXTERNAL: + if (setClockDivider(SYSTEM_C0, DEFAULT_BURST_SYSTEM_C0) == FAIL) { + LOG(logERROR, ("Could not set clk %s speed to %d.\n", + clock_names[SYSTEM_C0], DEFAULT_BURST_SYSTEM_C0)); + return FAIL; + } + if (setClockDivider(SYSTEM_C1, DEFAULT_BURST_SYSTEM_C1) == FAIL) { + LOG(logERROR, ("Could not set clk %s speed to %d.\n", + clock_names[SYSTEM_C0], DEFAULT_BURST_SYSTEM_C1)); + return FAIL; + } + if (setClockDivider(SYSTEM_C2, DEFAULT_BURST_SYSTEM_C2) == FAIL) { + LOG(logERROR, ("Could not set clk %s speed to %d.\n", + clock_names[SYSTEM_C0], DEFAULT_BURST_SYSTEM_C2)); + return FAIL; + } + break; + case CONTINUOUS_INTERNAL: + case CONTINUOUS_EXTERNAL: + if (setClockDivider(SYSTEM_C0, DEFAULT_CNTNS_SYSTEM_C0) == FAIL) { + LOG(logERROR, ("Could not set clk %s speed to %d.\n", + clock_names[SYSTEM_C0], DEFAULT_CNTNS_SYSTEM_C0)); + return FAIL; + } + if (setClockDivider(SYSTEM_C1, DEFAULT_CNTNS_SYSTEM_C1) == FAIL) { + LOG(logERROR, ("Could not set clk %s speed to %d.\n", + clock_names[SYSTEM_C0], DEFAULT_CNTNS_SYSTEM_C1)); + return FAIL; + } + if (setClockDivider(SYSTEM_C2, DEFAULT_CNTNS_SYSTEM_C2) == FAIL) { + LOG(logERROR, ("Could not set clk %s speed to %d.\n", + clock_names[SYSTEM_C0], DEFAULT_CNTNS_SYSTEM_C2)); + return FAIL; + } + break; + default: + LOG(logERROR, ("Unknown burst mode. Cannot update clock divs.\n")); + return FAIL; + } + return OK; +} + void setTiming(enum timingMode arg) { switch (arg) { case AUTO_TIMING: @@ -2780,6 +2826,9 @@ int setBurstMode(enum burstMode burst) { } updatingRegisters(); + + updateClockDivs(); + return configureASICGlobalSettings(); } diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h index bc47b8e06..4e17a88e9 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h @@ -65,6 +65,14 @@ #define DEFAULT_SYSTEM_C2 (5) //(144444448) // sync_clk, 144 MHz #define DEFAULT_SYSTEM_C3 (5) //(144444448) // str_clk, 144 MHz +#define DEFAULT_CNTNS_SYSTEM_C0 (10) // (72222224) run_clk, 72 MHz +#define DEFAULT_CNTNS_SYSTEM_C1 (20) // (36111112) chip_clk, 36 MHz +#define DEFAULT_CNTNS_SYSTEM_C2 (10) // (72222224) sync_clk, 72 MHz + +#define DEFAULT_BURST_SYSTEM_C0 (5) // (144444448) run_clk, 144 MHz +#define DEFAULT_BURST_SYSTEM_C1 (10) // (72222224) chip_clk, 72 MHz +#define DEFAULT_BURST_SYSTEM_C2 (5) // (144444448) sync_clk, 144 MHz + #define DEFAULT_READOUT_SPEED (G2_108MHZ) #define SPEED_144_CLKDIV_0 (6) #define SPEED_144_CLKDIV_1 (6) diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 6f68fe0bd..727d06a7d 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -404,6 +404,7 @@ void setSynchronization(int enable); #ifdef GOTTHARD2D void updatingRegisters(); +int updateClockDivs(); #endif void setTiming(enum timingMode arg); enum timingMode getTiming(); diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index a1f851e12..a09a3c70e 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1395,7 +1395,7 @@ class Detector { Result getBurstMode(Positions pos = {}); /** [Gotthard2] BURST_INTERNAL (default), BURST_EXTERNAL, - * CONTINUOUS_INTERNAL, CONTINUOUS_EXTERNAL */ + * CONTINUOUS_INTERNAL, CONTINUOUS_EXTERNAL. Also changes clkdiv 2, 3, 4 */ void setBurstMode(defs::burstMode value, Positions pos = {}); /** [Gotthard2] */ diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index b5189a8d4..0d3ce8681 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -2190,7 +2190,8 @@ std::string CmdProxy::BurstMode(int action) { os << cmd << ' '; if (action == defs::HELP_ACTION) { os << "[burst_internal or 0, burst_external or 1, cw_internal or 2, " - "cw_external or 3]\n\t[Gotthard2] Default is burst_internal type" + "cw_external or 3]\n\t[Gotthard2] Default is burst_internal " + "type. Also changes clkdiv 2, 3, 4" << '\n'; } else { if (action == defs::GET_ACTION) { diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 4cb199884..a95c5519b 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -11,4 +11,4 @@ #define APIJUNGFRAU 0x220831 #define APIMOENCH 0x220831 #define APIMYTHEN3 0x220901 -#define APIGOTTHARD2 0x220901 +#define APIGOTTHARD2 0x220902