slsDetectorSoftware: Eiger server, added 3 commands, measuredperiod,measuredsubperiod, status trigger. measured period is in 10ns in det server, status trigger reads reg,sets bit and unsets bit

This commit is contained in:
2018-08-10 19:14:05 +02:00
parent c934e92a41
commit 0018fa46f8
19 changed files with 282 additions and 40 deletions

View File

@ -37,6 +37,7 @@ unsigned int Feb_Control_acquireNReadoutMode; //safe or parallel, half or full s
unsigned int Feb_Control_triggerMode; //internal timer, external start, external window, signal polarity (external trigger and enable)
unsigned int Feb_Control_externalEnableMode; //external enabling engaged and it's polarity
unsigned int Feb_Control_subFrameMode;
unsigned int Feb_Control_softwareTrigger;
unsigned int Feb_Control_nimages;
@ -1958,6 +1959,56 @@ int Feb_Control_GetRightFPGATemp(){
return (int)temperature;
}
int64_t Feb_Control_GetMeasuredPeriod() {
unsigned int sub_num = (Module_TopAddressIsValid(&modules[1])) ?
Module_GetTopLeftAddress (&modules[1]):
Module_GetBottomLeftAddress (&modules[1]);
unsigned int value = 0;
Feb_Interface_ReadRegister(sub_num,MEAS_PERIOD_REG, &value);
return value*10;
}
int64_t Feb_Control_GetSubMeasuredPeriod() {
unsigned int sub_num = (Module_TopAddressIsValid(&modules[1])) ?
Module_GetTopLeftAddress (&modules[1]):
Module_GetBottomLeftAddress (&modules[1]);
unsigned int value = 0;
Feb_Interface_ReadRegister(sub_num,MEAS_SUBPERIOD_REG, &value);
return value*10;
}
int Feb_Control_SoftwareTrigger() {
unsigned int orig_value = 0;
Feb_Interface_ReadRegister(Feb_Control_AddressToAll(),DAQ_REG_CHIP_CMDS, &orig_value);
unsigned int cmd = orig_value | DAQ_REG_CHIP_CMDS_INT_TRIGGER;
if(Feb_Control_activated) {
// set trigger bit
#ifdef VERBOSE
cprintf(BLUE,"Setting Trigger, Register:0x%x\n",cmd);
#endif
if (!Feb_Interface_WriteRegister(Feb_Control_AddressToAll(),DAQ_REG_CHIP_CMDS,cmd,0,0)) {
cprintf(RED,"Warning: Could not give software trigger\n");
return 0;
}
// unset trigger bit
#ifdef VERBOSE
cprintf(BLUE,"Unsetting Trigger, Register:0x%x\n",orig_value);
#endif
if (!Feb_Interface_WriteRegister(Feb_Control_AddressToAll(),DAQ_REG_CHIP_CMDS,orig_value,0,0)) {
cprintf(RED,"Warning: Could not give software trigger\n");
return 0;
}
cprintf(BLUE,"Software Internal Trigger Sent!\n");
}
return 1;
}
uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data) {
uint32_t value=0;

View File

@ -200,6 +200,11 @@ int Feb_Control_GetModuleNumber();
int Feb_Control_GetLeftFPGATemp();
int Feb_Control_GetRightFPGATemp();
int64_t Feb_Control_GetMeasuredPeriod();
int64_t Feb_Control_GetSubMeasuredPeriod();
int Feb_Control_SoftwareTrigger();
uint32_t Feb_Control_WriteRegister(uint32_t offset, uint32_t data);
uint32_t Feb_Control_ReadRegister(uint32_t offset);
#endif

View File

@ -22,10 +22,10 @@
#define DAQ_REG_RO_OFFSET 12
#define DAQ_REG_STATUS (0 + DAQ_REG_RO_OFFSET) //also pg and fifo status register
//temp so far
#define FEB_REG_STATUS (3 + DAQ_REG_RO_OFFSET)
#define DAQ_REG_STATUS (DAQ_REG_RO_OFFSET + 0) //also pg and fifo status register
#define FEB_REG_STATUS (DAQ_REG_RO_OFFSET + 3)
#define MEAS_SUBPERIOD_REG (DAQ_REG_RO_OFFSET + 4)
#define MEAS_PERIOD_REG (DAQ_REG_RO_OFFSET + 5)
@ -64,7 +64,8 @@
#define DAQ_CHIP_CONTROLLER_QUARTER_SPEED 0x00080000 //everything at 50 MHz (25MHz ddr readout)
#define DAQ_CHIP_CONTROLLER_SUPER_SLOW_SPEED 0x000c0000 //everything at ~200 kHz (200 kHz MHz ddr readout)
#define DAQ_FIFO_ENABLE 0x00100000
//#define DAQ_FIFO_ENABLE 0x00100000 commented out as it is not used anywhere
#define DAQ_REG_CHIP_CMDS_INT_TRIGGER 0x00100000
//direct chip commands to the DAQ_REG_CHIP_CMDS register
#define DAQ_NEXPOSURERS_SAFEST_MODE_ROW_CLK_BEFORE_MODE 0x00200000 //row clk is before main clk readout sequence

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 3b6ead77836f2b6d2a795a9a994259d1dc8c131d
Revision: 343
Branch: developer
Repsitory UUID: c934e92a41da49db07f8d3fed98d88dc39325401
Revision: 344
Branch: eigerfeature
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3943
Last Changed Date: 2018-07-17 16:15:43.000000002 +0200 ./Makefile.virtual
Last Changed Rev: 3976
Last Changed Date: 2018-08-10 17:34:43.000000002 +0200 ./FebRegisterDefs.h

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "3b6ead77836f2b6d2a795a9a994259d1dc8c131d"
#define GITREPUUID "c934e92a41da49db07f8d3fed98d88dc39325401"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3943
#define GITDATE 0x20180717
#define GITBRANCH "developer"
#define GITREV 0x3976
#define GITDATE 0x20180810
#define GITBRANCH "eigerfeature"

View File

@ -764,6 +764,16 @@ int64_t setTimer(enum timerIndex ind, int64_t val){
}
int64_t getTimeLeft(enum timerIndex ind) {
switch(ind){
case MEASURED_PERIOD: return Feb_Control_GetMeasuredPeriod();
case MEASURED_SUBPERIOD: return Feb_Control_GetSubMeasuredPeriod();
default:
cprintf(RED,"This timer left index (%d) not defined for Eiger\n",ind);
return -1;
}
}
@ -1579,6 +1589,12 @@ int stopStateMachine(){
#endif
}
int softwareTrigger() {
if (!Feb_Control_SoftwareTrigger())
return FAIL;
return OK;
}
int startReadOut(){

View File

@ -12,7 +12,7 @@
#include <stdint.h>
#define GOODBYE (-200)
#define REQUIRED_FIRMWARE_VERSION (21)
#define REQUIRED_FIRMWARE_VERSION (22)
#define IDFILECOMMAND "more /home/root/executables/detid.txt"
#define STATUS_IDLE 0