mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-22 17:47:59 +02:00
ctb, moench, jungfrau server: changing phase only changes one clock in one direction. ctb and moench phase shift connected to adc clk, instead of run clk
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorPackage/slsDetectorServers/ctbDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 1103f56256f3f8b5037343f9e9a2ef90139dc6d0
|
||||
Revision: 37
|
||||
URL: origin https://www.github.com/slsdetectorgroup/slsDetectorPackage
|
||||
Repository Root: origin https://www.github.com/slsdetectorgroup/slsDetectorPackage
|
||||
Repsitory UUID: 6765fd0dc89176b4eceaf5e2304ef808a316ba9b
|
||||
Revision: 38
|
||||
Branch: refactor
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 4389
|
||||
Last Changed Date: 2019-03-08 14:05:26.000000002 +0100 ./RegisterDefs.h
|
||||
Last Changed Rev: 4394
|
||||
Last Changed Date: 2019-03-13 08:04:56.000000002 +0100 ./RegisterDefs.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "1103f56256f3f8b5037343f9e9a2ef90139dc6d0"
|
||||
#define GITURL "https://www.github.com/slsdetectorgroup/slsDetectorPackage"
|
||||
#define GITREPUUID "6765fd0dc89176b4eceaf5e2304ef808a316ba9b"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x4389
|
||||
#define GITDATE 0x20190308
|
||||
#define GITREV 0x4394
|
||||
#define GITDATE 0x20190313
|
||||
#define GITBRANCH "refactor"
|
||||
|
@ -786,7 +786,7 @@ void setSpeed(enum speedVariable ind, int val) {
|
||||
case ADC_PHASE:
|
||||
case PHASE_SHIFT:
|
||||
FILE_LOG(logINFOBLUE, ("Configuring ADC Phase\n"));
|
||||
configurePhase(RUN_CLK, val);
|
||||
configurePhase(ADC_CLK, val);
|
||||
break;
|
||||
case DBIT_PHASE:
|
||||
FILE_LOG(logINFOBLUE, ("Configuring Dbit Phase\n"));
|
||||
@ -1639,6 +1639,12 @@ void configurePhase(enum CLKINDEX ind, int val) {
|
||||
FILE_LOG(logERROR, ("\tPhase provided for C%d(%s) outside limits\n", ind, clock_names[ind]));
|
||||
return;
|
||||
}
|
||||
int relativePhase = clkPhase[ind] - val;
|
||||
|
||||
// same phase
|
||||
if (!relativePhase) {
|
||||
return;
|
||||
}
|
||||
|
||||
FILE_LOG(logINFO, ("Configuring Phase of C%d(%s) to %d\n", ind, clock_names[ind], val));
|
||||
|
||||
@ -1648,16 +1654,17 @@ void configurePhase(enum CLKINDEX ind, int val) {
|
||||
// set mode register to polling mode
|
||||
ALTERA_PLL_SetModePolling();
|
||||
|
||||
int phase = 0, inv = 0;
|
||||
if (val > 0) {
|
||||
inv = 0;
|
||||
phase = val;
|
||||
|
||||
int phase = 0;
|
||||
int maxShifts = ((ind == ADC_CLK) ? MAX_PHASE_SHIFTS_ADC_CLK : MAX_PHASE_SHIFTS_DBIT_CLK);
|
||||
|
||||
// delay clk
|
||||
if (relativePhase > 0) {
|
||||
phase = (maxShifts - relativePhase);
|
||||
} else {
|
||||
inv = 1;
|
||||
val = -1 * val;
|
||||
phase = (~val);
|
||||
phase = (-1) * relativePhase;
|
||||
}
|
||||
FILE_LOG(logINFO, ("\tphase out %d (0x%08x), inv:%d\n", phase, phase, inv));
|
||||
FILE_LOG(logINFO, ("\tphase out %d (0x%08x)\n", phase, phase));
|
||||
|
||||
ALTERA_PLL_SetPhaseShift(phase, (int)ind, 0);
|
||||
|
||||
|
@ -80,7 +80,8 @@ enum DACINDEX {D0, D1, D2, D3, D4, D5, D6, D7, D8, D9,
|
||||
/* Defines in the Firmware */
|
||||
#define MAX_PATTERN_LENGTH (0xFFFF)
|
||||
#define DIGITAL_IO_DELAY_MAXIMUM_PS ((OUTPUT_DELAY_0_OTPT_STTNG_MSK >> OUTPUT_DELAY_0_OTPT_STTNG_OFST) * OUTPUT_DELAY_0_OTPT_STTNG_STEPS)
|
||||
|
||||
#define MAX_PHASE_SHIFTS_ADC_CLK (320)
|
||||
#define MAX_PHASE_SHIFTS_DBIT_CLK (32)
|
||||
|
||||
#define WAIT_TME_US_FR_ACQDONE_REG (100) // wait time in us after acquisition done to ensure there is no data in fifo
|
||||
#define WAIT_TIME_US_PLL (10 * 1000)
|
||||
|
Reference in New Issue
Block a user