diff --git a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c index 0c7a3cd1d..a315c9c5e 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/gotthardDetectorServer/firmware_funcs.c @@ -256,13 +256,17 @@ int setDAQRegister(int adcval) reg=bus_r(addr); bus_w(addr,val); reg=bus_r(addr); -//#ifdef VERBOSE +#ifdef VERBOSE printf("DAQ reg:%x\n",reg); -//#endif +#endif + //clean fifo addr=ADC_SYNC_REG; - val=12; + val=ADCSYNC_VAL | ADCSYNC_CLEAN_FIFO_BITS; + bus_w(addr,val); + + val=ADCSYNC_VAL; bus_w(addr,val); reg=bus_r(addr); #ifdef VERBOSE diff --git a/slsDetectorSoftware/gotthardDetectorServer/registers_g.h b/slsDetectorSoftware/gotthardDetectorServer/registers_g.h index 1e5523dbe..070252965 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/registers_g.h +++ b/slsDetectorSoftware/gotthardDetectorServer/registers_g.h @@ -276,5 +276,9 @@ #define CHANNEL_OFFSET 16 #define ACTIVE_ADC_MASK 0x0000001f + +/**ADC SYNC CLEAN FIFO*/ +#define ADCSYNC_CLEAN_FIFO_BITS 0x300000 + #endif diff --git a/slsDetectorSoftware/gotthardDetectorServer/server_defs.h b/slsDetectorSoftware/gotthardDetectorServer/server_defs.h index 16401c6c0..711466251 100755 --- a/slsDetectorSoftware/gotthardDetectorServer/server_defs.h +++ b/slsDetectorSoftware/gotthardDetectorServer/server_defs.h @@ -33,6 +33,11 @@ #define ALLMOD 0xffff #define ALLFIFO 0xffff + + +#define ADCSYNC_VAL 0x32213 + + #ifdef VIRTUAL #define DEBUGOUT #endif