gotthard dacs only save 10 bits but firmware is more than 14-16 bits..so changed setdacreg to save only msb and accordingly ignore a difference of 3 while setting. Problem not detected earlier, communicationfuncs.c.Solution: commented out a part from receiveModule

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@215 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2012-08-08 16:18:46 +00:00
parent d934111c2a
commit f686a575b6
5 changed files with 13 additions and 8 deletions

View File

@ -431,7 +431,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) {
free(dacptr);
return FAIL;
}
/*
if (nadcdiff<=0) {
ts+=receiveDataOnly(file_des,myMod->adcs, sizeof(double)*nAdcs);
#ifdef VERBOSE
@ -444,8 +444,7 @@ int receiveModule(int file_des, sls_detector_module* myMod) {
ts+=receiveDataOnly(file_des,adcptr, sizeof(double)*nadcdiff);
free(adcptr);
return FAIL;
}
}*/
if (nchipdiff<=0) {
ts+=receiveDataOnly(file_des,myMod->chipregs, sizeof(int)*nChips);
#ifdef VERBOSE

View File

@ -1187,6 +1187,8 @@ int setDACRegister(int idac, int val, int imod) {
return -1;
break;
}
//saving only the msb
val=val>>2;
off=(idac%3)*10;
mask=~((0x3ff)<<off);
@ -1198,6 +1200,9 @@ int setDACRegister(int idac, int val, int imod) {
bus_w(addr+(imod<<SHIFTMOD),reg);
}
val=(bus_r(addr+(imod<<SHIFTMOD))>>off)&0x3ff;
//since we saved only the msb
val=val<<2;
//val=(bus_r(addr)>>off)&0x3ff;

View File

@ -816,6 +816,7 @@ int initDACs(int* v,int imod)
#endif
int iaddr;
// sDac=0;
for (iaddr=0; iaddr<8; iaddr++) {
clearDACSregister(imod);
if (v[iaddr]>=0) {

View File

@ -990,8 +990,8 @@ int set_dac(int file_des) {
strcpy(mess,"Weird value read back or it has not been set yet\n");
else
ret=OK;
}
else if (retval==val || val==-1)
}//since v r saving only msb
else if ((retval-val)<=3 || val==-1)
ret=OK;
}
#endif