Commit c72cf5ac authored by Evangelia Gousiou's avatar Evangelia Gousiou

last modifications before delivery to Jans tech

parent 6cdce109
...@@ -14,11 +14,12 @@ sudo ./usbtmc_load ...@@ -14,11 +14,12 @@ sudo ./usbtmc_load
cd .. cd ..
cd ~/fmc-tdc-1ns-5cha-tst/pts cd ~/fmc-tdc-1ns-5cha-tst/pts
LOGDIR_CALIB=./logs/calib
LOGDIR=../logs/log_fmctdc1ns5cha mkdir -p $LOGDIR_CALIB
sudo rm -fr $LOGDIR_CALIB/fmc-tdc-1ns-5cha-tst*
mkdir -p $LOGDIR LOGDIR_FUNC=./logs/func
sudo rm -fr $LOGDIR/fmc-tdc-1ns-5cha-tst* mkdir -p $LOGDIR_FUNC
sudo rm -fr $LOGDIR_FUNC/fmc-tdc-1ns-5cha-tst*
serial=$1 serial=$1
if [ x$1 = x"" ]; then if [ x$1 = x"" ]; then
...@@ -59,15 +60,14 @@ do ...@@ -59,15 +60,14 @@ do
echo "--- Functionality tests ---" echo "--- Functionality tests ---"
sudo ./pts.py -b FmcTdc1ns5cha_funct -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/functionality/python -l $LOGDIR 00 #01 02 03 04 05 06 07 08 09 10 11 12 sudo ./pts.py -b FmcTdc1ns5cha_funct -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/functionality/python -l $LOGDIR_FUNC 00 01 02 03 04 05 06 07 08 09 10 11 12
echo -n "Do you wish to continue with the calibration tests [y,n]? " echo -n "Do you wish to continue with the calibration tests [y,n]? "
read reply read reply
if [ "$reply" = "y" ] if [ "$reply" = "y" ]
then then
echo "--- Calibration tests ---\n" echo "--- Calibration tests ---\n"
LOGDIR=../logs/log_fmctdc1ns5cha_calib sudo ./pts.py -b FmcTdc1ns5cha_calib -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/calibration/python -l $LOGDIR_CALIB 13 14 15 16 17 18
sudo ./pts.py -b FmcTdc1ns5cha_calib -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/calibration/python -l $LOGDIR 16 17 18 #13 14 15 16 17 18
fi fi
if [ "$nb_test" != "$nb_test_limit" ] if [ "$nb_test" != "$nb_test_limit" ]
...@@ -89,5 +89,5 @@ echo -n "End of the test, do you want to switch the computer OFF? [y,n]" ...@@ -89,5 +89,5 @@ echo -n "End of the test, do you want to switch the computer OFF? [y,n]"
read reply read reply
if [ "$reply" = "y" ] if [ "$reply" = "y" ]
then then
sudo halt sudo poweroff
fi fi
...@@ -14,7 +14,7 @@ cd .. ...@@ -14,7 +14,7 @@ cd ..
cd ~/fmc-tdc-1ns-5cha-tst/pts cd ~/fmc-tdc-1ns-5cha-tst/pts
LOGDIR=../logs/log_fmctdc1ns5cha_calib LOGDIR=./logs/calib
mkdir -p $LOGDIR mkdir -p $LOGDIR
sudo rm -fr $LOGDIR/fmc-tdc-1ns-5cha-tst* sudo rm -fr $LOGDIR/fmc-tdc-1ns-5cha-tst*
......
#!/bin/sh
# Copyright CERN, 2011
# Author: Matthieu Cattin <matthieu.cattin@cern.ch>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
sudo rmmod cp210x
cd ~/fmc-tdc-1ns-5cha-tst/pts
sudo insmod ./cp210x-driver/cp210x.ko
cd usbdriver
sudo ./usbtmc_load
cd ..
cd ~/fmc-tdc-1ns-5cha-tst/pts
LOGDIR=./logs/func
mkdir -p $LOGDIR
sudo rm -fr $LOGDIR/fmc-tdc-1ns-5cha-tst*
serial=$1
if [ x$1 = x"" ]; then
echo -n "Please scan CERN serial number bar-code, then press [ENTER]: "
read serial
fi
if [ x$serial = x"" ]; then
serial=0000
fi
if [ -e serial.txt ]; then
sudo rm -f serial.txt
fi
echo $serial >> serial.txt
extra_serial=$2
if [ x$2 = x"" ]; then
echo -n "If needed input extra serial number and press [ENTER] OR just press [ENTER]: "
read extra_serial
fi
if [ x$extra_serial = x"" ]; then
extra_serial=0000
fi
echo " "
nb_test_limit=2
nb_test=1
while [ "$nb_test" -le "$nb_test_limit" ]
do
echo "--------------------------------------------------------------"
echo "Test series run $nb_test out of $nb_test_limit"
echo " "
echo "--- Functionality tests ---"
sudo ./pts.py -b FmcTdc1ns5cha_funct -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/functionality/python -l $LOGDIR 00 01 02 03 04 05 06 07 08 09 10 11 12
if [ "$nb_test" != "$nb_test_limit" ]
then
echo " "
echo -n "Do you want to run the test series again [y,n]? "
read reply
if [ "$reply" != "y" ]
then
break
fi
fi
nb_test=$(($nb_test+1))
done
echo "--------------------------------------------------------------"
echo " "
echo -n "End of the test, do you want to switch the computer OFF? [y,n]"
read reply
if [ "$reply" = "y" ]
then
sudo poweroff
fi
...@@ -15,27 +15,27 @@ ...@@ -15,27 +15,27 @@
## | ## |
## Description Calibration of the TDC Channel 1 with White Rabbit. | ## Description Calibration of the TDC Channel 1 with White Rabbit. |
## | ## |
## For the calibration, we plug a pre-calibrated 38ns LEMO cable [1] to the TDC | ## For the calibration, we plug a pre-calibrated 2 ns LEMO cable [1] to the TDC |
## Channel 1; the other end of the cable is connected to the PPS output of the White | ## Channel 1; the other end of the cable is connected to the PPS output of the White |
## Rabbit switch. | ## Rabbit master. |
## We also connect a fiber (of any lenght) between the SFP connector of the SPEC | ## We also connect a fiber (of any lenght) between the SFP connector of the SPEC |
## carrier and any of the 18 ports of the White Rabbit switch. | ## carrier and any of the 18 ports of the White Rabbit master (switch or node). |
## | ## |
## With White Rabbit, through the exchange of Ethernet messages in the fiber, a | ## With White Rabbit, through the exchange of Ethernet messages in the fiber, a |
## common notion of time is established between the TDC and the White Rabbit switch. | ## common notion of time is established between the TDC and the White Rabbit master. |
## Therefore, the TAI pulse within the TDC core, that signals the arrival of a new | ## Therefore, the TAI pulse within the TDC core, that signals the arrival of a new |
## TAI second and the PPS pulse in the input of the TDC board, are in principle | ## TAI second and the PPS pulse in the input of the TDC board, are in principle |
## expected to arrive as the following drawing shows: | ## expected to arrive as the following drawing shows: |
## | ## |
## TAI : ____________|-|_____________________________________ | ## TAI : ____________|-|_____________________________________ |
## | ## |
## PPS at the switch : ____________|-|_____________________________________ | ## PPS at the master : ____________|-|_____________________________________ |
## | ## |
## PPS at TDC Channel 1 : _______________________________|-|__________________ | ## PPS at TDC Channel 1 : _______________________________|-|__________________ |
## <----------------> | ## <----------------> |
## 38ns | ## 2 ns |
## | ## |
## However, to this 38ns we need to add the delays from the Channel 1 LEMO connector | ## However, to this 2 ns we need to add the delays from the Channel 1 LEMO connector |
## to the input of the ACAM chip (track lengths and input buffer delay). | ## to the input of the ACAM chip (track lengths and input buffer delay). |
## This amount of delay differs slightly from board to board. | ## This amount of delay differs slightly from board to board. |
## There is also an offset added by the ACAM chip calculations, in the order of 293ns| ## There is also an offset added by the ACAM chip calculations, in the order of 293ns|
...@@ -131,7 +131,7 @@ def main (default_directory='.'): ...@@ -131,7 +131,7 @@ def main (default_directory='.'):
tmp_stdin = sys.stdin; tmp_stdin = sys.stdin;
sys.stdin = sys.__stdin__; sys.stdin = sys.__stdin__;
ask = raw_input("--> Please connect White Rabbit fiber and PPS; press y/n when finished [y/n]: ") ask = raw_input("--> Please connect the DIO PPS to TDC Channel 1; press y/n when finished [y/n]: ")
ask = ask.upper() ask = ask.upper()
if (ask == "N"): if (ask == "N"):
msg = ("Operator decided not to perform the White Rabbit calibration") msg = ("Operator decided not to perform the White Rabbit calibration")
...@@ -159,7 +159,7 @@ def main (default_directory='.'): ...@@ -159,7 +159,7 @@ def main (default_directory='.'):
# Bind SPEC object to FMC TDC card # Bind SPEC object to FMC TDC card
print "\n-------------------------------------------------------------------" print "\n-------------------------------------------------------------------"
print "----------------------------- TDC PTS -----------------------------" print "----------------------------- FMC TDC -----------------------------"
print "-------------------- White Rabbit Calibration ---------------------\n" print "-------------------- White Rabbit Calibration ---------------------\n"
print ("White Rabbit calibration of the TDC Channel 1.\n") print ("White Rabbit calibration of the TDC Channel 1.\n")
...@@ -324,7 +324,7 @@ def main (default_directory='.'): ...@@ -324,7 +324,7 @@ def main (default_directory='.'):
print "max : %.2f ps"%(max(all_measurs_max)) print "max : %.2f ps"%(max(all_measurs_max))
print "min : %.2f ps"%(min(all_measurs_min)) print "min : %.2f ps"%(min(all_measurs_min))
print "avg : %.2f ps"%(sum(all_measurs_avg, 0.0) / len(all_measurs_avg)) print "avg : %.2f ps"%(sum(all_measurs_avg, 0.0) / len(all_measurs_avg))
wr_calib_value = (((sum(all_measurs_avg, 0.0) / len(all_measurs_avg)) - 38000)*100) wr_calib_value = (((sum(all_measurs_avg, 0.0) / len(all_measurs_avg)) - 1200)*100) # finally the 2 ns cable was measured 1.2
print "\n\nCalibration value : %.2f ps"%(wr_calib_value/100) print "\n\nCalibration value : %.2f ps"%(wr_calib_value/100)
print "Calibration hex value written in file: %s"%WRABBIT_CALIB_FILENAME print "Calibration hex value written in file: %s"%WRABBIT_CALIB_FILENAME
print"[ ", print"[ ",
......
...@@ -118,7 +118,7 @@ def main (default_directory='.'): ...@@ -118,7 +118,7 @@ def main (default_directory='.'):
# Bind SPEC object to FMC TDC card # Bind SPEC object to FMC TDC card
print "\n-------------------------------------------------------------------" print "\n-------------------------------------------------------------------"
print "----------------------------- FMC TDC -----------------------------" print "----------------------------- FMC TDC -----------------------------"
print "----- TDC mezz EEPROM writting with White Rabbit Calibration ------\n" print "------ TDC mezz EEPROM writing with White Rabbit Calibration ------\n"
print ("Retrieval of the existing calibration values already inside the\n" print ("Retrieval of the existing calibration values already inside the\n"
"TDC EEPROM, addition of the White Rabbit calibration value\n" "TDC EEPROM, addition of the White Rabbit calibration value\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment