]> jspc29.x-matter.uni-frankfurt.de Git - mvd_soft.git/commitdiff
more cleanup of scurve.sh
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Tue, 2 Sep 2014 15:08:41 +0000 (17:08 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Tue, 2 Sep 2014 15:08:41 +0000 (17:08 +0200)
s-curves/scurve.sh

index 9c9b407b634ae9321f373db83e48f0977f80eef2..3931600b2d0f68c9a0e3810afdf431583df80c88 100755 (executable)
@@ -60,29 +60,32 @@ else
 fi
 
 
-### ------------ setting up the sensor ------------
+### ------------------------------------------------------------------
+
+# Setting up general properties of the ROC:
 
 # trbcmd w $trbaddr 0x8002 0xaaa0aaa0 # set sensor ID for sensor 0
 # trbcmd w $trbaddr 0x8402 0xbbb0bbb0 # set sensor ID for sensor 1
 trbcmd w $trbaddr 0x8006 0x1 # set testmode
 
 
-### ------------ start data taking ------------
-
+# Starting the configuration / readout cycles
 
 for BANK in A B C D
 do
-echo $BANK
-for i in `seq 0 $stepsize 255`
+echo -e "\nBank $BANK"
+for i in $(seq 0 $stepsize 255)
 do
-  trbcmd w $trbaddr 0x8005 0x1 # set soft reset to 1 (skip run 0)
-  echo Iteration $i
-  printf -v hex '%04x' $i
+  echo Threshold $i
+
+  printf -v threshhex '%04x' $i
   printf -v param '%04x' 0
-  trbcmd w $trbaddr 0x8007 0x$hex$param # write external info to FPGA (ROC) which is the pair "threshold - run"
+
+  trbcmd w $trbaddr 0x8005 0x1 # set soft reset to 1 (skip run 0)
+  trbcmd w $trbaddr 0x8007 0x$threshhex$param # write current scan parameters to ROC-FPGA (later in data)
+
+  # change sensor settings, i.e. thresholds to $i
   if [ "$BANK" = "A" ]; then
-    # so I know the scanning parameters for every frame
-    # TEST DISCRI A ONLY: echo "DAC_BIAS/IVDREF1A=$i;DAC_BIAS/IVDREF1B=255;DAC_BIAS/IVDREF1C=255;DAC_BIAS/IVDREF1D=255" | ./changeConfigVal.pl -c /local.1/htdocs/mvdconfig/config/sensorE0scurve2.xml
     #echo "DAC_BIAS/IVDREF1A=$i;DAC_BIAS/IVDREF1B=$i;DAC_BIAS/IVDREF1C=$i;DAC_BIAS/IVDREF1D=$i;DIS_DISCRI/DisDiscri=0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000" | ./changeConfigVal.pl -c /local.1/htdocs/mvdconfig/config/sensorE0scurve2.xml
     echo "DAC_BIAS/IVDREF1A=$i;DAC_BIAS/IVDREF1B=255;DAC_BIAS/IVDREF1C=255;DAC_BIAS/IVDREF1D=255" | ./changeConfigVal.pl -c /local.1/htdocs/mvdconfig/config/sensorE0scurve2.xml
   elif [ "$BANK" = "B" ]; then
@@ -92,23 +95,25 @@ do
   elif [ "$BANK" = "D" ]; then
     echo "DAC_BIAS/IVDREF1A=255;DAC_BIAS/IVDREF1B=255;DAC_BIAS/IVDREF1C=255;DAC_BIAS/IVDREF1D=$i" | ./changeConfigVal.pl -c /local.1/htdocs/mvdconfig/config/sensorE0scurve2.xml
   fi
-  # change sensor settings, i.e. thresholds to $i
 
+  # programming the sensor via JTAG
   if [ $1 == 'Vacuum' ]
   then
-#     ./init_setup.pl /local.1/htdocs/mvdconfig/setup/scurve2_setup.xml # program the JTAG parameters to the sensor and start once
-    ./startup.pl /local.1/htdocs/mvdconfig/setup/scurve2_setup.xml # program the JTAG parameters to the sensor and start once
+    #./init_setup.pl /local.1/htdocs/mvdconfig/setup/scurve2_setup.xml
+    ./startup.pl /local.1/htdocs/mvdconfig/setup/scurve2_setup.xml
   elif [ $1 == 'ELab' ]
   then
-#     ./init_setup.pl /local.1/htdocs/mvdconfig/setup/scurve2_setup_ELab2.xml # program the JTAG parameters to the sensor and start once
-    ./startup.pl /local.1/htdocs/mvdconfig/setup/scurve2_setup_ELab2.xml # program the JTAG parameters to the sensor and start once
+    #./init_setup.pl /local.1/htdocs/mvdconfig/setup/scurve2_setup_ELab2.xml
+    ./startup.pl /local.1/htdocs/mvdconfig/setup/scurve2_setup_ELab2.xml
   fi
   sleep 0.3 # wait until the run is finished (throw away data, because dirty)
 
-  for j in `seq 1 1 $numruns` # for all runs, to gather statistics
+  # Start taking data and cycle through runs:
+  for j in $(seq 1 1 $numruns) # for all runs, to gather statistics
   do
     echo "run $j"
-    printf -v run '%04x' $j
+
+    printf -v runhex '%04x' $j
     check="0"
     while [ "$check" -eq "0" ]; do
       trbcmd w $trbaddr 0x8005 0x1 # reset the FPGA buffers
@@ -117,7 +122,8 @@ do
       echo "attempting soft-reset..."
     done
     trbcmd w $trbaddr 0x8005 0x0 # clear the previous reset
-    trbcmd w $trbaddr 0x8007 0x$hex$run # write current scan parameters to FPGA (later in data)
+    trbcmd w $trbaddr 0x8007 0x$threshhex$runhex # write current scan parameters to ROC-FPGA (later in data)
+
     trbcmd w $trbaddr 0xb00b 0x1 # start the next run in the s-curve mode
     sleep 0.3 # wait until run is finished
   done