mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 03:20:42 +02:00
gotthard: changed the fpga dummyreg read/write test
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@49 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
025c6ae10f
commit
5d687a1dee
@ -138,22 +138,24 @@ int setDummyRegister() {
|
||||
printf("Writing %d in DAC(0-7) %d \n",dacvalue,dacnum);
|
||||
}
|
||||
*/
|
||||
u_int32_t val,addr;
|
||||
volatile u_int32_t val,addr;
|
||||
|
||||
addr = DUMMY_REG;
|
||||
// (else use bs_w16)
|
||||
int i;
|
||||
for(i=0;i<100;i++)
|
||||
if(result==OK)
|
||||
{
|
||||
//dummy register
|
||||
val=45;
|
||||
val=0x5A5A5A5A-i;
|
||||
bus_w(addr, val);
|
||||
// bus_w(SET_DELAY_LSB_REG,0);
|
||||
//val=bus_r(addr);
|
||||
val=bus_r(addr);
|
||||
if (val!=45) {
|
||||
printf("ATTEMPT:%d:\tFPGA dummy register wrong!! %x instead of 0xF0F0F0F0 \n",i,val);
|
||||
if (val!=0x5A5A5A5A-i) {
|
||||
printf("ATTEMPT:%d:\tFPGA dummy register wrong!! %x instead of %x \n",i,val,0x5A5A5A5A-i);
|
||||
result=FAIL;
|
||||
}
|
||||
|
||||
//dummy register
|
||||
val=0x0F0F0F0F;
|
||||
bus_w(addr, val);
|
||||
@ -167,7 +169,7 @@ int setDummyRegister() {
|
||||
bus_w(DUMMY_REG, val);
|
||||
val=bus_r(DUMMY_REG);
|
||||
if (val!=0xF0F0F0F0) {
|
||||
printf("ATTEMPT:%d:\tFPGA dummy register wrong!! %x instead of 0xF0F0F0F0 \n",i,val);
|
||||
printf("ATTEMPT:%d:\tFPGA dummy register wrong!! %x instead of 0xF0F0F0F0 \n\n",i,val);
|
||||
result=FAIL;
|
||||
}
|
||||
}
|
||||
@ -181,12 +183,6 @@ int setDummyRegister() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//aldos function volatile (not needed)
|
||||
u_int16_t bus_w16(u_int32_t offset, u_int16_t data) {
|
||||
u_int16_t *ptr1;
|
||||
|
@ -756,8 +756,9 @@ void showbits(int h)
|
||||
|
||||
int initDACs(int* v,int imod)
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
printf("\n..inside initdacs\n");
|
||||
|
||||
#endif
|
||||
int iaddr;
|
||||
// sDac=0;
|
||||
for (iaddr=0; iaddr<8; iaddr++) {
|
||||
@ -783,7 +784,9 @@ int initDACs(int* v,int imod)
|
||||
|
||||
int setSettings(int i)
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
printf("\ninside set settings wit settins=%d...\n",i);
|
||||
#endif
|
||||
int imod, isett, is;
|
||||
int vrefds[] = VREFDS_VALS;
|
||||
int vcascn[] = VCASCN_VALS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user